From 655304676732d2ad641eae79b2fa7dfe35ea4671 Mon Sep 17 00:00:00 2001 From: Nico <47644445+nicotsx@users.noreply.github.com> Date: Mon, 23 Mar 2026 19:47:44 +0100 Subject: [PATCH] fix: cli not running (#703) --- .github/workflows/e2e.yml | 7 +++++++ app/server/cli/index.ts | 6 +++++- package.json | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 5a8d6ac9..18de0269 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -56,6 +56,13 @@ jobs: - name: Start zerobyte-e2e service run: bun run start:e2e -- -d + - name: Check CLI version + run: | + expected_version=$(docker exec zerobyte printenv APP_VERSION) + cli_version=$(docker exec zerobyte bun run --silent cli --version) + echo "$cli_version" + test "$cli_version" = "$expected_version" + - name: Wait for zerobyte to be ready run: | timeout 30s bash -c 'until curl -f http://localhost:4096/api/healthcheck; do echo "Waiting for server..." && sleep 2; done' diff --git a/app/server/cli/index.ts b/app/server/cli/index.ts index b7c3f82e..97560f0b 100644 --- a/app/server/cli/index.ts +++ b/app/server/cli/index.ts @@ -5,11 +5,15 @@ import { changeUsernameCommand } from "./commands/change-username"; import { disable2FACommand } from "./commands/disable-2fa"; import { rekey2FACommand } from "./commands/rekey-2fa"; import { resetPasswordCommand } from "./commands/reset-password"; +import { config } from "../core/config"; import { db } from "../db/db"; const program = new Command(); -program.name("zerobyte").description("Zerobyte CLI - Backup automation tool built on top of Restic").version("1.0.0"); +program + .name("zerobyte") + .description("Zerobyte CLI - Backup automation tool built on top of Restic") + .version(config.appVersion); program.addCommand(resetPasswordCommand); program.addCommand(disable2FACommand); program.addCommand(changeUsernameCommand); diff --git a/package.json b/package.json index 181fb6b0..0afe768d 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "start": "bun run .output/server/index.mjs", "preview": "bunx --bun vite preview", "cli:dev": "bun run app/server/cli/main.ts", - "cli": "ZEROBYTE_CLI=1 bun .output/server/_ssr/index.mjs", + "cli": "ZEROBYTE_CLI=1 bun .output/server/_ssr/ssr.mjs", "tsc": "tsc --noEmit && turbo run tsc", "start:dev": "docker compose down && docker compose up --build zerobyte-dev", "start:prod": "docker compose down && docker compose up --build zerobyte-prod",