From 231367a62b88f09bccbe661a8e9ae81deb6dc95d Mon Sep 17 00:00:00 2001 From: Rohit Malhotra Date: Thu, 28 May 2026 15:02:26 -0400 Subject: [PATCH] feat(cli): add --info flag to show default stack versions and ports (#902) agent-canvas --version only shows the package version. The new --info flag reads config/defaults.json and prints the full picture: agent-canvas version, default agent-server/automation/SDK versions, default ports, and the env vars available to override them. Co-authored-by: openhands --- bin/agent-canvas.mjs | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/bin/agent-canvas.mjs b/bin/agent-canvas.mjs index 9c6cc9d903..f785f6aed3 100755 --- a/bin/agent-canvas.mjs +++ b/bin/agent-canvas.mjs @@ -20,13 +20,35 @@ const PKG_JSON = join(__dirname, "..", "package.json"); // Build output is in build/ (not build/client/) - see react-router.config.ts unpackClientDirectory const BUILD_DIR = join(__dirname, "..", "build"); -// Check for version/help flags first +const DEFAULTS_JSON = join(__dirname, "..", "config", "defaults.json"); + +// Check for version/help/info flags first const args = process.argv.slice(2); if (args.includes("-v") || args.includes("--version")) { const { version } = JSON.parse(readFileSync(PKG_JSON, "utf-8")); console.log(version); process.exit(0); } +if (args.includes("--info")) { + const { version } = JSON.parse(readFileSync(PKG_JSON, "utf-8")); + const defaults = JSON.parse(readFileSync(DEFAULTS_JSON, "utf-8")); + console.log(`@openhands/agent-canvas ${version} + +Default stack versions: + agent-server: ${defaults.versions.agentServer} + automation: ${defaults.versions.automation} + automation-sdk: ${defaults.versions.automationSdk} + +Default ports: + ingress: ${defaults.ports.proxy} + agent-server: ${defaults.ports.agentServer} + automation: ${defaults.ports.automation} + +Override versions via environment variables: + OH_AGENT_SERVER_VERSION, OH_AGENT_SERVER_GIT_REF, OH_AGENT_SERVER_LOCAL_PATH + OH_AUTOMATION_VERSION, OH_AUTOMATION_GIT_REF`); + process.exit(0); +} if (args.includes("-h") || args.includes("--help")) { console.log(` @openhands/agent-canvas - Run the Agent Canvas UI with agent-server @@ -40,6 +62,7 @@ USAGE: OPTIONS: -p, --port Ingress port (default: 8000) -v, --version Show version number + --info Show version and default stack configuration -h, --help Show this help message ENVIRONMENT VARIABLES: @@ -58,6 +81,9 @@ EXAMPLES: # Use a specific port npx @openhands/agent-canvas --port 3000 + # Show default stack versions and ports + npx @openhands/agent-canvas --info + # Use local SDK checkout for development OH_AGENT_SERVER_LOCAL_PATH=/path/to/sdk npx @openhands/agent-canvas `);