feat(install): add quick and manual install options in README and script
Summary
This update introduces a new install.sh script into the repository, enabling streamlined installation of the kubectl-ai CLI tool. The script automatically detects the user's OS and architecture, retrieves the latest release from GitHub, and installs the binary into /usr/local/bin. This simplifies the setup process, ensuring users can easily deploy the CLI tool with minimal manual steps.
Affected Modules
- New
install.shscript added to repository root.
Key Details
- OS Detection: Supports Linux and macOS (Darwin).
- Architecture Detection: Supports amd64/x86_64 and arm64/aarch64.
- Latest Release Fetch: Uses the GitHub API to automatically identify the most recent release.
- Installation Method: Downloads the release tarball, extracts the binary, and installs it to
/usr/local/bin, with requiredsudoprivileges. - User Feedback: Provides clear messaging on download progress, installation status, and success confirmation.
Potential Impacts
- Provides a quick, reliable method for users to install
kubectl-ai. - Facilitates consistency across environments, reducing setup errors.
- Minimal risk; installation relies on standard directory paths and permissions.
Local test
λ kubectl-ai % curl -sSL https://raw.githubusercontent.com/tuannvm/kubectl-ai/docs/one-liner-installation/install.sh | bash
Downloading https://github.com/GoogleCloudPlatform/kubectl-ai/releases/download/v0.0.7/kubectl-ai_darwin_arm64.tar.gz ...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
100 9.7M 100 9.7M 0 0 16.4M 0 --:--:-- --:--:-- --:--:-- 103M
Installing kubectl-ai to /usr/local/bin (may require sudo)...
✅ kubectl-ai installed successfully! Run 'kubectl-ai --help' to get started.
@droot please have another look. Thanks!
Really nice work! Auto-detecting OS and architecture definitely smooths out the install process. Just curious as an observer: what happens if someone runs this on an unsupported OS with something more niche? Does the script handle that with a clear message?
@emlaker https://github.com/GoogleCloudPlatform/kubectl-ai/pull/150/files#diff-043df5bdbf6639d7a77e1d44c5226fd7371e5259a1e4df3a0dd5d64c30dca44fR13-R15
Thanks @tuannvm, this is looking great. I will merge this tomorrow.