kubectl-ai icon indicating copy to clipboard operation
kubectl-ai copied to clipboard

feat(install): add quick and manual install options in README and script

Open tuannvm opened this issue 7 months ago • 5 comments

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.sh script 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 required sudo privileges.
  • 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.

tuannvm avatar May 07 '25 06:05 tuannvm

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.

tuannvm avatar May 07 '25 06:05 tuannvm

@droot please have another look. Thanks!

tuannvm avatar May 08 '25 03:05 tuannvm

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 avatar May 08 '25 04:05 emlaker

@emlaker https://github.com/GoogleCloudPlatform/kubectl-ai/pull/150/files#diff-043df5bdbf6639d7a77e1d44c5226fd7371e5259a1e4df3a0dd5d64c30dca44fR13-R15

tuannvm avatar May 08 '25 04:05 tuannvm

Thanks @tuannvm, this is looking great. I will merge this tomorrow.

droot avatar May 08 '25 05:05 droot