From a5d73fe4d7b71259961b29dd1097d0aeb750261f Mon Sep 17 00:00:00 2001 From: Pasha Sviderski Date: Fri, 26 Jun 2026 20:07:15 +1000 Subject: [PATCH] refactor(cli): move cmd/uncloud to cmd/uc, change the artifact name uncloud_* -> uc_* --- .goreleaser.yaml | 15 +++++----- AGENTS.md | 6 ++-- HACKING.md | 4 +-- Makefile | 2 +- cmd/{uncloud => uc}/art.txt | 0 cmd/{uncloud => uc}/build.go | 0 cmd/{uncloud => uc}/caddy/config.go | 0 cmd/{uncloud => uc}/caddy/deploy.go | 0 cmd/{uncloud => uc}/caddy/logs.go | 2 +- cmd/{uncloud => uc}/caddy/root.go | 0 cmd/{uncloud => uc}/context/args_test.go | 0 cmd/{uncloud => uc}/context/connection.go | 0 cmd/{uncloud => uc}/context/ls.go | 0 cmd/{uncloud => uc}/context/root.go | 0 cmd/{uncloud => uc}/context/show.go | 0 cmd/{uncloud => uc}/context/use.go | 0 cmd/{uncloud => uc}/deploy.go | 0 cmd/{uncloud => uc}/dns/release.go | 0 cmd/{uncloud => uc}/dns/reserve.go | 2 +- cmd/{uncloud => uc}/dns/root.go | 0 cmd/{uncloud => uc}/dns/show.go | 0 cmd/{uncloud => uc}/docs.go | 0 cmd/{uncloud => uc}/image/ls.go | 0 cmd/{uncloud => uc}/image/push.go | 0 cmd/{uncloud => uc}/image/root.go | 0 cmd/{uncloud => uc}/images.go | 2 +- cmd/{uncloud => uc}/machine/add.go | 2 +- cmd/{uncloud => uc}/machine/constants.go | 0 cmd/{uncloud => uc}/machine/init.go | 4 +-- cmd/{uncloud => uc}/machine/logs.go | 0 cmd/{uncloud => uc}/machine/ls.go | 0 cmd/{uncloud => uc}/machine/rename.go | 0 cmd/{uncloud => uc}/machine/rm.go | 0 cmd/{uncloud => uc}/machine/root.go | 0 cmd/{uncloud => uc}/machine/rtt.go | 0 cmd/{uncloud => uc}/machine/update.go | 0 cmd/{uncloud => uc}/main.go | 16 +++++------ cmd/{uncloud => uc}/proxy.go | 0 cmd/{uncloud => uc}/ps.go | 0 cmd/{uncloud => uc}/ps_test.go | 0 cmd/{uncloud => uc}/service/exec.go | 0 cmd/{uncloud => uc}/service/exec_test.go | 0 cmd/{uncloud => uc}/service/inspect.go | 0 cmd/{uncloud => uc}/service/logs.go | 0 cmd/{uncloud => uc}/service/ls.go | 0 cmd/{uncloud => uc}/service/rm.go | 0 cmd/{uncloud => uc}/service/root.go | 0 cmd/{uncloud => uc}/service/run.go | 0 cmd/{uncloud => uc}/service/scale.go | 0 cmd/{uncloud => uc}/service/start.go | 0 cmd/{uncloud => uc}/service/stop.go | 0 cmd/{uncloud => uc}/version.go | 0 cmd/{uncloud => uc}/volume/create.go | 0 cmd/{uncloud => uc}/volume/inspect.go | 0 cmd/{uncloud => uc}/volume/ls.go | 0 cmd/{uncloud => uc}/volume/rm.go | 0 cmd/{uncloud => uc}/volume/root.go | 0 cmd/{uncloud => uc}/wg/wg.go | 0 mise.toml | 2 +- scripts/install_cli.sh | 28 ++++++++----------- .../docs/2-getting-started/1-install-cli.md | 15 ++++------ 61 files changed, 45 insertions(+), 55 deletions(-) rename cmd/{uncloud => uc}/art.txt (100%) rename cmd/{uncloud => uc}/build.go (100%) rename cmd/{uncloud => uc}/caddy/config.go (100%) rename cmd/{uncloud => uc}/caddy/deploy.go (100%) rename cmd/{uncloud => uc}/caddy/logs.go (92%) rename cmd/{uncloud => uc}/caddy/root.go (100%) rename cmd/{uncloud => uc}/context/args_test.go (100%) rename cmd/{uncloud => uc}/context/connection.go (100%) rename cmd/{uncloud => uc}/context/ls.go (100%) rename cmd/{uncloud => uc}/context/root.go (100%) rename cmd/{uncloud => uc}/context/show.go (100%) rename cmd/{uncloud => uc}/context/use.go (100%) rename cmd/{uncloud => uc}/deploy.go (100%) rename cmd/{uncloud => uc}/dns/release.go (100%) rename cmd/{uncloud => uc}/dns/reserve.go (97%) rename cmd/{uncloud => uc}/dns/root.go (100%) rename cmd/{uncloud => uc}/dns/show.go (100%) rename cmd/{uncloud => uc}/docs.go (100%) rename cmd/{uncloud => uc}/image/ls.go (100%) rename cmd/{uncloud => uc}/image/push.go (100%) rename cmd/{uncloud => uc}/image/root.go (100%) rename cmd/{uncloud => uc}/images.go (89%) rename cmd/{uncloud => uc}/machine/add.go (99%) rename cmd/{uncloud => uc}/machine/constants.go (100%) rename cmd/{uncloud => uc}/machine/init.go (98%) rename cmd/{uncloud => uc}/machine/logs.go (100%) rename cmd/{uncloud => uc}/machine/ls.go (100%) rename cmd/{uncloud => uc}/machine/rename.go (100%) rename cmd/{uncloud => uc}/machine/rm.go (100%) rename cmd/{uncloud => uc}/machine/root.go (100%) rename cmd/{uncloud => uc}/machine/rtt.go (100%) rename cmd/{uncloud => uc}/machine/update.go (100%) rename cmd/{uncloud => uc}/main.go (91%) rename cmd/{uncloud => uc}/proxy.go (100%) rename cmd/{uncloud => uc}/ps.go (100%) rename cmd/{uncloud => uc}/ps_test.go (100%) rename cmd/{uncloud => uc}/service/exec.go (100%) rename cmd/{uncloud => uc}/service/exec_test.go (100%) rename cmd/{uncloud => uc}/service/inspect.go (100%) rename cmd/{uncloud => uc}/service/logs.go (100%) rename cmd/{uncloud => uc}/service/ls.go (100%) rename cmd/{uncloud => uc}/service/rm.go (100%) rename cmd/{uncloud => uc}/service/root.go (100%) rename cmd/{uncloud => uc}/service/run.go (100%) rename cmd/{uncloud => uc}/service/scale.go (100%) rename cmd/{uncloud => uc}/service/start.go (100%) rename cmd/{uncloud => uc}/service/stop.go (100%) rename cmd/{uncloud => uc}/version.go (100%) rename cmd/{uncloud => uc}/volume/create.go (100%) rename cmd/{uncloud => uc}/volume/inspect.go (100%) rename cmd/{uncloud => uc}/volume/ls.go (100%) rename cmd/{uncloud => uc}/volume/rm.go (100%) rename cmd/{uncloud => uc}/volume/root.go (100%) rename cmd/{uncloud => uc}/wg/wg.go (100%) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 5c06d8de..f6b8645f 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -20,9 +20,9 @@ snapshot: version_template: "{{ incminor .Version }}-nightly-{{.ShortCommit}}" builds: - - id: uncloud - main: ./cmd/uncloud - binary: uncloud + - id: uc + main: ./cmd/uc + binary: uc env: # Use CGO to be able to build fsevent required by compose on macOS. - CGO_ENABLED={{ if eq .Os "darwin" }}1{{ else }}0{{ end }} @@ -60,9 +60,9 @@ builds: -X github.com/psviderski/uncloud/internal/version.builtBy=goreleaser archives: - - id: uncloud + - id: uc builds: - - uncloud + - uc formats: # gz is not compatible with homebrew releases, so we use tar.gz - tar.gz @@ -103,10 +103,9 @@ brews: description: "Uncloud CLI" homepage: "https://uncloud.run" ids: - - uncloud + - uc install: | - bin.install "uncloud" - bin.install_symlink "uncloud" => "uc" + bin.install "uc" skip_upload: false repository: owner: psviderski diff --git a/AGENTS.md b/AGENTS.md index 08fe7d4d..af5480d9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -72,7 +72,7 @@ management. - **`cmd/`**: Contains main applications - - `uncloud/`: CLI tool with subcommands for machine, service, volume management + - `uc/`: CLI tool with subcommands for machine, service, volume management - `uncloudd/`: Daemon that runs on each machine - `ucind/`: Development cluster management for testing @@ -131,7 +131,7 @@ github.com/siderolabs/grpc-proxy // gRPC proxy for forwarding ```bash # Build binaries -go build -o uncloud ./cmd/uncloud +go build -o uc ./cmd/uc go build -o uncloudd ./cmd/uncloudd ``` @@ -239,7 +239,7 @@ uc context use # Switch context ### Important Files to Understand -- `cmd/uncloud/main.go`: CLI entry point and command structure +- `cmd/uc/main.go`: CLI entry point and command structure - `internal/cli/cli.go`: CLI implementation and configuration - `internal/machine/machine.go`: Core machine management - `pkg/api/`: Public API definitions diff --git a/HACKING.md b/HACKING.md index ab8242e0..4c2fa51e 100644 --- a/HACKING.md +++ b/HACKING.md @@ -32,13 +32,13 @@ available outside the project, so they don't interfere with system packages. Build the CLI: ```shell -go build -o uc ./cmd/uncloud +go build -o uc ./cmd/uc ``` Or build and run the CLI with a single command: ```shell -go run ./cmd/uncloud --help +go run ./cmd/uc --help ``` The Uncloud daemon (`uncloudd`) only supports Linux, so you need to cross-compile it if you're developing on macOS or diff --git a/Makefile b/Makefile index 232f8e66..c1fb8205 100644 --- a/Makefile +++ b/Makefile @@ -72,4 +72,4 @@ _lint: .PHONY: cli-docs cli-docs: - go run ./cmd/uncloud docs + go run ./cmd/uc docs diff --git a/cmd/uncloud/art.txt b/cmd/uc/art.txt similarity index 100% rename from cmd/uncloud/art.txt rename to cmd/uc/art.txt diff --git a/cmd/uncloud/build.go b/cmd/uc/build.go similarity index 100% rename from cmd/uncloud/build.go rename to cmd/uc/build.go diff --git a/cmd/uncloud/caddy/config.go b/cmd/uc/caddy/config.go similarity index 100% rename from cmd/uncloud/caddy/config.go rename to cmd/uc/caddy/config.go diff --git a/cmd/uncloud/caddy/deploy.go b/cmd/uc/caddy/deploy.go similarity index 100% rename from cmd/uncloud/caddy/deploy.go rename to cmd/uc/caddy/deploy.go diff --git a/cmd/uncloud/caddy/logs.go b/cmd/uc/caddy/logs.go similarity index 92% rename from cmd/uncloud/caddy/logs.go rename to cmd/uc/caddy/logs.go index df408b86..b744cac9 100644 --- a/cmd/uncloud/caddy/logs.go +++ b/cmd/uc/caddy/logs.go @@ -1,7 +1,7 @@ package caddy import ( - "github.com/psviderski/uncloud/cmd/uncloud/service" + "github.com/psviderski/uncloud/cmd/uc/service" "github.com/psviderski/uncloud/internal/cli" "github.com/psviderski/uncloud/internal/cli/logs" "github.com/spf13/cobra" diff --git a/cmd/uncloud/caddy/root.go b/cmd/uc/caddy/root.go similarity index 100% rename from cmd/uncloud/caddy/root.go rename to cmd/uc/caddy/root.go diff --git a/cmd/uncloud/context/args_test.go b/cmd/uc/context/args_test.go similarity index 100% rename from cmd/uncloud/context/args_test.go rename to cmd/uc/context/args_test.go diff --git a/cmd/uncloud/context/connection.go b/cmd/uc/context/connection.go similarity index 100% rename from cmd/uncloud/context/connection.go rename to cmd/uc/context/connection.go diff --git a/cmd/uncloud/context/ls.go b/cmd/uc/context/ls.go similarity index 100% rename from cmd/uncloud/context/ls.go rename to cmd/uc/context/ls.go diff --git a/cmd/uncloud/context/root.go b/cmd/uc/context/root.go similarity index 100% rename from cmd/uncloud/context/root.go rename to cmd/uc/context/root.go diff --git a/cmd/uncloud/context/show.go b/cmd/uc/context/show.go similarity index 100% rename from cmd/uncloud/context/show.go rename to cmd/uc/context/show.go diff --git a/cmd/uncloud/context/use.go b/cmd/uc/context/use.go similarity index 100% rename from cmd/uncloud/context/use.go rename to cmd/uc/context/use.go diff --git a/cmd/uncloud/deploy.go b/cmd/uc/deploy.go similarity index 100% rename from cmd/uncloud/deploy.go rename to cmd/uc/deploy.go diff --git a/cmd/uncloud/dns/release.go b/cmd/uc/dns/release.go similarity index 100% rename from cmd/uncloud/dns/release.go rename to cmd/uc/dns/release.go diff --git a/cmd/uncloud/dns/reserve.go b/cmd/uc/dns/reserve.go similarity index 97% rename from cmd/uncloud/dns/reserve.go rename to cmd/uc/dns/reserve.go index 2d4107d8..85efe080 100644 --- a/cmd/uncloud/dns/reserve.go +++ b/cmd/uc/dns/reserve.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "github.com/psviderski/uncloud/cmd/uncloud/caddy" + "github.com/psviderski/uncloud/cmd/uc/caddy" "github.com/psviderski/uncloud/internal/cli" "github.com/psviderski/uncloud/internal/machine/api/pb" "github.com/psviderski/uncloud/pkg/api" diff --git a/cmd/uncloud/dns/root.go b/cmd/uc/dns/root.go similarity index 100% rename from cmd/uncloud/dns/root.go rename to cmd/uc/dns/root.go diff --git a/cmd/uncloud/dns/show.go b/cmd/uc/dns/show.go similarity index 100% rename from cmd/uncloud/dns/show.go rename to cmd/uc/dns/show.go diff --git a/cmd/uncloud/docs.go b/cmd/uc/docs.go similarity index 100% rename from cmd/uncloud/docs.go rename to cmd/uc/docs.go diff --git a/cmd/uncloud/image/ls.go b/cmd/uc/image/ls.go similarity index 100% rename from cmd/uncloud/image/ls.go rename to cmd/uc/image/ls.go diff --git a/cmd/uncloud/image/push.go b/cmd/uc/image/push.go similarity index 100% rename from cmd/uncloud/image/push.go rename to cmd/uc/image/push.go diff --git a/cmd/uncloud/image/root.go b/cmd/uc/image/root.go similarity index 100% rename from cmd/uncloud/image/root.go rename to cmd/uc/image/root.go diff --git a/cmd/uncloud/images.go b/cmd/uc/images.go similarity index 89% rename from cmd/uncloud/images.go rename to cmd/uc/images.go index f49bada5..9c50f3d4 100644 --- a/cmd/uncloud/images.go +++ b/cmd/uc/images.go @@ -3,7 +3,7 @@ package main import ( "strings" - "github.com/psviderski/uncloud/cmd/uncloud/image" + "github.com/psviderski/uncloud/cmd/uc/image" "github.com/spf13/cobra" ) diff --git a/cmd/uncloud/machine/add.go b/cmd/uc/machine/add.go similarity index 99% rename from cmd/uncloud/machine/add.go rename to cmd/uc/machine/add.go index 85fb9590..4f9e3e6a 100644 --- a/cmd/uncloud/machine/add.go +++ b/cmd/uc/machine/add.go @@ -10,7 +10,7 @@ import ( "charm.land/lipgloss/v2" "github.com/docker/compose/v2/pkg/progress" - "github.com/psviderski/uncloud/cmd/uncloud/caddy" + "github.com/psviderski/uncloud/cmd/uc/caddy" "github.com/psviderski/uncloud/internal/cli" "github.com/psviderski/uncloud/internal/cli/config" "github.com/psviderski/uncloud/internal/cli/tui" diff --git a/cmd/uncloud/machine/constants.go b/cmd/uc/machine/constants.go similarity index 100% rename from cmd/uncloud/machine/constants.go rename to cmd/uc/machine/constants.go diff --git a/cmd/uncloud/machine/init.go b/cmd/uc/machine/init.go similarity index 98% rename from cmd/uncloud/machine/init.go rename to cmd/uc/machine/init.go index 99559890..c4c95bb3 100644 --- a/cmd/uncloud/machine/init.go +++ b/cmd/uc/machine/init.go @@ -8,8 +8,8 @@ import ( "time" "github.com/docker/compose/v2/pkg/progress" - "github.com/psviderski/uncloud/cmd/uncloud/caddy" - "github.com/psviderski/uncloud/cmd/uncloud/dns" + "github.com/psviderski/uncloud/cmd/uc/caddy" + "github.com/psviderski/uncloud/cmd/uc/dns" "github.com/psviderski/uncloud/internal/cli" "github.com/psviderski/uncloud/internal/cli/config" "github.com/psviderski/uncloud/internal/cli/tui" diff --git a/cmd/uncloud/machine/logs.go b/cmd/uc/machine/logs.go similarity index 100% rename from cmd/uncloud/machine/logs.go rename to cmd/uc/machine/logs.go diff --git a/cmd/uncloud/machine/ls.go b/cmd/uc/machine/ls.go similarity index 100% rename from cmd/uncloud/machine/ls.go rename to cmd/uc/machine/ls.go diff --git a/cmd/uncloud/machine/rename.go b/cmd/uc/machine/rename.go similarity index 100% rename from cmd/uncloud/machine/rename.go rename to cmd/uc/machine/rename.go diff --git a/cmd/uncloud/machine/rm.go b/cmd/uc/machine/rm.go similarity index 100% rename from cmd/uncloud/machine/rm.go rename to cmd/uc/machine/rm.go diff --git a/cmd/uncloud/machine/root.go b/cmd/uc/machine/root.go similarity index 100% rename from cmd/uncloud/machine/root.go rename to cmd/uc/machine/root.go diff --git a/cmd/uncloud/machine/rtt.go b/cmd/uc/machine/rtt.go similarity index 100% rename from cmd/uncloud/machine/rtt.go rename to cmd/uc/machine/rtt.go diff --git a/cmd/uncloud/machine/update.go b/cmd/uc/machine/update.go similarity index 100% rename from cmd/uncloud/machine/update.go rename to cmd/uc/machine/update.go diff --git a/cmd/uncloud/main.go b/cmd/uc/main.go similarity index 91% rename from cmd/uncloud/main.go rename to cmd/uc/main.go index c712c6b1..a81e1501 100644 --- a/cmd/uncloud/main.go +++ b/cmd/uc/main.go @@ -8,14 +8,14 @@ import ( "os" "strings" - "github.com/psviderski/uncloud/cmd/uncloud/caddy" - cmdcontext "github.com/psviderski/uncloud/cmd/uncloud/context" - "github.com/psviderski/uncloud/cmd/uncloud/dns" - "github.com/psviderski/uncloud/cmd/uncloud/image" - cmdmachine "github.com/psviderski/uncloud/cmd/uncloud/machine" - "github.com/psviderski/uncloud/cmd/uncloud/service" - "github.com/psviderski/uncloud/cmd/uncloud/volume" - "github.com/psviderski/uncloud/cmd/uncloud/wg" + "github.com/psviderski/uncloud/cmd/uc/caddy" + cmdcontext "github.com/psviderski/uncloud/cmd/uc/context" + "github.com/psviderski/uncloud/cmd/uc/dns" + "github.com/psviderski/uncloud/cmd/uc/image" + cmdmachine "github.com/psviderski/uncloud/cmd/uc/machine" + "github.com/psviderski/uncloud/cmd/uc/service" + "github.com/psviderski/uncloud/cmd/uc/volume" + "github.com/psviderski/uncloud/cmd/uc/wg" "github.com/psviderski/uncloud/internal/cli" "github.com/psviderski/uncloud/internal/cli/config" "github.com/psviderski/uncloud/internal/cli/tui" diff --git a/cmd/uncloud/proxy.go b/cmd/uc/proxy.go similarity index 100% rename from cmd/uncloud/proxy.go rename to cmd/uc/proxy.go diff --git a/cmd/uncloud/ps.go b/cmd/uc/ps.go similarity index 100% rename from cmd/uncloud/ps.go rename to cmd/uc/ps.go diff --git a/cmd/uncloud/ps_test.go b/cmd/uc/ps_test.go similarity index 100% rename from cmd/uncloud/ps_test.go rename to cmd/uc/ps_test.go diff --git a/cmd/uncloud/service/exec.go b/cmd/uc/service/exec.go similarity index 100% rename from cmd/uncloud/service/exec.go rename to cmd/uc/service/exec.go diff --git a/cmd/uncloud/service/exec_test.go b/cmd/uc/service/exec_test.go similarity index 100% rename from cmd/uncloud/service/exec_test.go rename to cmd/uc/service/exec_test.go diff --git a/cmd/uncloud/service/inspect.go b/cmd/uc/service/inspect.go similarity index 100% rename from cmd/uncloud/service/inspect.go rename to cmd/uc/service/inspect.go diff --git a/cmd/uncloud/service/logs.go b/cmd/uc/service/logs.go similarity index 100% rename from cmd/uncloud/service/logs.go rename to cmd/uc/service/logs.go diff --git a/cmd/uncloud/service/ls.go b/cmd/uc/service/ls.go similarity index 100% rename from cmd/uncloud/service/ls.go rename to cmd/uc/service/ls.go diff --git a/cmd/uncloud/service/rm.go b/cmd/uc/service/rm.go similarity index 100% rename from cmd/uncloud/service/rm.go rename to cmd/uc/service/rm.go diff --git a/cmd/uncloud/service/root.go b/cmd/uc/service/root.go similarity index 100% rename from cmd/uncloud/service/root.go rename to cmd/uc/service/root.go diff --git a/cmd/uncloud/service/run.go b/cmd/uc/service/run.go similarity index 100% rename from cmd/uncloud/service/run.go rename to cmd/uc/service/run.go diff --git a/cmd/uncloud/service/scale.go b/cmd/uc/service/scale.go similarity index 100% rename from cmd/uncloud/service/scale.go rename to cmd/uc/service/scale.go diff --git a/cmd/uncloud/service/start.go b/cmd/uc/service/start.go similarity index 100% rename from cmd/uncloud/service/start.go rename to cmd/uc/service/start.go diff --git a/cmd/uncloud/service/stop.go b/cmd/uc/service/stop.go similarity index 100% rename from cmd/uncloud/service/stop.go rename to cmd/uc/service/stop.go diff --git a/cmd/uncloud/version.go b/cmd/uc/version.go similarity index 100% rename from cmd/uncloud/version.go rename to cmd/uc/version.go diff --git a/cmd/uncloud/volume/create.go b/cmd/uc/volume/create.go similarity index 100% rename from cmd/uncloud/volume/create.go rename to cmd/uc/volume/create.go diff --git a/cmd/uncloud/volume/inspect.go b/cmd/uc/volume/inspect.go similarity index 100% rename from cmd/uncloud/volume/inspect.go rename to cmd/uc/volume/inspect.go diff --git a/cmd/uncloud/volume/ls.go b/cmd/uc/volume/ls.go similarity index 100% rename from cmd/uncloud/volume/ls.go rename to cmd/uc/volume/ls.go diff --git a/cmd/uncloud/volume/rm.go b/cmd/uc/volume/rm.go similarity index 100% rename from cmd/uncloud/volume/rm.go rename to cmd/uc/volume/rm.go diff --git a/cmd/uncloud/volume/root.go b/cmd/uc/volume/root.go similarity index 100% rename from cmd/uncloud/volume/root.go rename to cmd/uc/volume/root.go diff --git a/cmd/uncloud/wg/wg.go b/cmd/uc/wg/wg.go similarity index 100% rename from cmd/uncloud/wg/wg.go rename to cmd/uc/wg/wg.go diff --git a/mise.toml b/mise.toml index ec8b182b..5473da63 100644 --- a/mise.toml +++ b/mise.toml @@ -49,7 +49,7 @@ protoc --go_out=. --go_opt=paths=source_relative --go-grpc_out=. --go-grpc_opt=p [tasks.uc] description = "Run the Uncloud CLI" -run = "go run ./cmd/uncloud" +run = "go run ./cmd/uc" [tasks.ucind] description = "Run ucind CLI for managing local Docker-based clusters" diff --git a/scripts/install_cli.sh b/scripts/install_cli.sh index d125725e..39f5ed74 100755 --- a/scripts/install_cli.sh +++ b/scripts/install_cli.sh @@ -11,12 +11,11 @@ print_manual_install() { RELEASES_URL="https://github.com/${GITHUB_REPO}/releases/${VERSION}" echo "Failed while attempting to install uncloud CLI. You can install it manually:" echo " 1. Open your web browser and go to ${RELEASES_URL}" - echo " 2. Download uncloud__.tar.gz for your platform (OS: linux/macos, ARCH: amd64/arm64)." - echo " 3. Extract the 'uncloud' binary from the archive: tar -xvf uncloud_*.tar.gz" - echo " 4. Install the binary to /usr/local/bin: sudo install ./uncloud ${INSTALL_DIR}/uncloud" - echo " 5. Optionally create a 'uc' symlink: sudo ln -sf ${INSTALL_DIR}/uncloud ${INSTALL_DIR}/uc" - echo " 6. Delete the downloaded archive and extracted binary: rm uncloud*" - echo " 7. Run 'uncloud --help' to verify the installation. Enjoy! ✨" + echo " 2. Download uc__.tar.gz for your platform (OS: linux/macos, ARCH: amd64/arm64)." + echo " 3. Extract the 'uc' binary from the archive: tar -xvf uc_*.tar.gz" + echo " 4. Install the binary to /usr/local/bin: sudo install ./uc ${INSTALL_DIR}/uc" + echo " 5. Delete the downloaded archive and extracted binary: rm uc*" + echo " 6. Run 'uc --help' to verify the installation. Enjoy! ✨" } fetch_latest_version() { @@ -64,7 +63,7 @@ esac if [ "$VERSION" = "latest" ]; then fetch_latest_version fi -BINARY_NAME="uncloud_${BINARY_OS}_${BINARY_ARCH}.tar.gz" +BINARY_NAME="uc_${BINARY_OS}_${BINARY_ARCH}.tar.gz" BINARY_URL="https://github.com/${GITHUB_REPO}/releases/download/${VERSION}/${BINARY_NAME}" CHECKSUM_URL="https://github.com/${GITHUB_REPO}/releases/download/$VERSION/checksums.txt" @@ -73,7 +72,7 @@ TMP_DIR=$(mktemp -d) trap 'rm -rf "$TMP_DIR"' EXIT # Download the binary and checksums file. -echo "Downloading uncloud binary ${VERSION} ${BINARY_URL}" +echo "Downloading uc binary ${VERSION} ${BINARY_URL}" curl -fsSL "$BINARY_URL" -o "${TMP_DIR}/${BINARY_NAME}" curl -fsSL "$CHECKSUM_URL" -o "${TMP_DIR}/checksums.txt" echo "Download complete." @@ -91,17 +90,14 @@ echo "Checksum is valid." tar -xf "${BINARY_NAME}" if [ -z "${SUDO}" ]; then - echo "Installing uncloud binary to ${INSTALL_DIR}" + echo "Installing uc binary to ${INSTALL_DIR}" else - echo "Installing uncloud binary to ${INSTALL_DIR} using sudo. You may be prompted for your password." + echo "Installing uc binary to ${INSTALL_DIR} using sudo. You may be prompted for your password." fi -if ! $SUDO install ./uncloud "${INSTALL_DIR}/uncloud"; then - echo "Failed to install uncloud binary to ${INSTALL_DIR}" +if ! $SUDO install ./uc "${INSTALL_DIR}/uc"; then + echo "Failed to install uc binary to ${INSTALL_DIR}" print_manual_install exit 1 fi -# Create 'uc' shortcut symlink. -$SUDO ln -sf "${INSTALL_DIR}/uncloud" "${INSTALL_DIR}/uc" -echo "Successfully installed uncloud binary ${VERSION} to ${INSTALL_DIR}/uncloud" -echo "Created a shortcut command 'uc' for convenience ✨" +echo "Successfully installed uc binary ${VERSION} to ${INSTALL_DIR}/uc ✨" diff --git a/website/docs/2-getting-started/1-install-cli.md b/website/docs/2-getting-started/1-install-cli.md index 3c85eb66..83e0f18c 100644 --- a/website/docs/2-getting-started/1-install-cli.md +++ b/website/docs/2-getting-started/1-install-cli.md @@ -36,8 +36,7 @@ The script will: - Detect your operating system and architecture - Download the appropriate latest binary from [GitHub releases](https://github.com/psviderski/uncloud/releases) -- Install it to `/usr/local/bin/uncloud` using `sudo` (you may need to enter your user password) -- Create a shortcut `uc` in `/usr/local/bin` for convenience +- Install it to `/usr/local/bin/uc` using `sudo` (you may need to enter your user password) Don't like `curl | sh`? You can download and review the [install script](https://get.uncloud.run/install.sh) first and then run it: @@ -66,26 +65,22 @@ You can manually download and use a pre-built binary from the ```shell - curl -L https://github.com/psviderski/uncloud/releases/latest/download/uncloud_macos_arm64.tar.gz | tar xz - mv uncloud uc + curl -L https://github.com/psviderski/uncloud/releases/latest/download/uc_macos_arm64.tar.gz | tar xz ``` ```shell - curl -L https://github.com/psviderski/uncloud/releases/latest/download/uncloud_macos_amd64.tar.gz | tar xz - mv uncloud uc + curl -L https://github.com/psviderski/uncloud/releases/latest/download/uc_macos_amd64.tar.gz | tar xz ``` ```shell - curl -L https://github.com/psviderski/uncloud/releases/latest/download/uncloud_linux_amd64.tar.gz | tar xz - mv uncloud uc + curl -L https://github.com/psviderski/uncloud/releases/latest/download/uc_linux_amd64.tar.gz | tar xz ``` ```shell - curl -L https://github.com/psviderski/uncloud/releases/latest/download/uncloud_linux_arm64.tar.gz | tar xz - mv uncloud uc + curl -L https://github.com/psviderski/uncloud/releases/latest/download/uc_linux_arm64.tar.gz | tar xz ```