Skip to content

Conversation

@sofusalbertsen
Copy link
Contributor

@sofusalbertsen sofusalbertsen commented Sep 29, 2025

This PR introduces a script, install-cli.sh, that automates the installation of the Kosli CLI binary for different operating systems and architectures.

It performs the following key functions:

  • Configuration: Sets up variables for OS, architecture, version, and GitHub token (mostly needed for test in the CI).

  • Argument Parsing: Accepts command-line arguments to enable debug mode and specify the version of the Kosli CLI to install.

  • Version Detection: If no version is specified, it fetches the latest version from the GitHub API, implementing a retry mechanism in case of failures.

  • OS and Architecture Detection: Identifies the operating system (Linux, Windows, or macOS) and architecture (amd64 or arm64) to construct the appropriate download URL.

  • Download and Extraction: Downloads the appropriate binary package (either a .tar.gz or .zip file) and extracts it.

  • Installation: Attempts to move the extracted binary to common directories in the user's PATH (bin, bin, /opt/bin), with fallback to using sudo if necessary.

  • Error Handling: Provides informative error messages and instructions if the installation fails.

This script simplifies the process of installing the Kosli CLI, ensuring compatibility across different environments while providing debugging options for troubleshooting.

This PR also includes:

  • Documentation is updated accordingly
  • A CI script is in place, running an install test on all 3 OS's.

@sofusalbertsen sofusalbertsen marked this pull request as ready for review October 6, 2025 11:49
@sofusalbertsen sofusalbertsen merged commit 2bf863e into main Oct 6, 2025
13 checks passed
@sofusalbertsen sofusalbertsen deleted the install-script branch October 6, 2025 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants