From 0a8f1a13c4bc400ce48afbea87a1adaea69003d1 Mon Sep 17 00:00:00 2001 From: cte Date: Tue, 6 Jan 2026 03:42:31 -0800 Subject: [PATCH] A few more fixes --- apps/cli/package.json | 2 +- apps/cli/scripts/release.sh | 11 +++++++++-- apps/cli/src/index.ts | 10 +++++++++- apps/cli/tsup.config.ts | 2 ++ 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/apps/cli/package.json b/apps/cli/package.json index 9bcc2f1249..155a93f197 100644 --- a/apps/cli/package.json +++ b/apps/cli/package.json @@ -1,6 +1,6 @@ { "name": "@roo-code/cli", - "version": "0.1.0", + "version": "0.2.2", "description": "Roo Code CLI - Run the Roo Code agent from the command line", "private": true, "type": "module", diff --git a/apps/cli/scripts/release.sh b/apps/cli/scripts/release.sh index 43d5298956..3ade690252 100755 --- a/apps/cli/scripts/release.sh +++ b/apps/cli/scripts/release.sh @@ -130,7 +130,7 @@ create_tarball() { info "Copying CLI files..." cp -r "$CLI_DIR/dist/"* "$RELEASE_DIR/lib/" - # Create package.json for npm install (only runtime dependencies) + # Create package.json for npm install (runtime dependencies that can't be bundled) info "Creating package.json..." node -e " const pkg = require('$CLI_DIR/package.json'); @@ -139,7 +139,11 @@ create_tarball() { version: pkg.version, type: 'module', dependencies: { - commander: pkg.dependencies.commander + '@inkjs/ui': pkg.dependencies['@inkjs/ui'], + 'commander': pkg.dependencies.commander, + 'ink': pkg.dependencies.ink, + 'react': pkg.dependencies.react, + 'zustand': pkg.dependencies.zustand } }; console.log(JSON.stringify(newPkg, null, 2)); @@ -197,6 +201,9 @@ WRAPPER_EOF # Create version file echo "$VERSION" > "$RELEASE_DIR/VERSION" + # Create empty .env file to suppress dotenvx warnings + touch "$RELEASE_DIR/.env" + # Create tarball info "Creating tarball..." cd "$REPO_ROOT" diff --git a/apps/cli/src/index.ts b/apps/cli/src/index.ts index 40f7084e25..a67faf70fa 100644 --- a/apps/cli/src/index.ts +++ b/apps/cli/src/index.ts @@ -4,6 +4,7 @@ import { Command } from "commander" import fs from "fs" +import { createRequire } from "module" import path from "path" import { fileURLToPath } from "url" import { createElement } from "react" @@ -29,9 +30,16 @@ const REASONING_EFFORTS = [...reasoningEffortsExtended, "unspecified", "disabled const __dirname = path.dirname(fileURLToPath(import.meta.url)) +// Read version from package.json +const require = createRequire(import.meta.url) +const packageJson = require("../package.json") + const program = new Command() -program.name("roo").description("Roo Code CLI - Run the Roo Code agent from the command line").version("0.1.0") +program + .name("roo") + .description("Roo Code CLI - Run the Roo Code agent from the command line") + .version(packageJson.version) program .argument("[prompt]", "The prompt/task to execute (optional in TUI mode)") diff --git a/apps/cli/tsup.config.ts b/apps/cli/tsup.config.ts index 3181c43f32..d3bfb1407f 100644 --- a/apps/cli/tsup.config.ts +++ b/apps/cli/tsup.config.ts @@ -20,6 +20,8 @@ export default defineConfig({ "@anthropic-ai/vertex-sdk", // Keep @vscode/ripgrep external - we bundle the binary separately "@vscode/ripgrep", + // Optional dev dependency of ink - not needed at runtime + "react-devtools-core", ], esbuildOptions(options) { // Enable JSX for React/Ink components