Developers

CLI

Install Cohub CLI, sign in, and run the main Space workflows from your terminal.

The Cohub CLI exposes the same product surface from a terminal: Spaces, Chats, files, Saves, Apps, generation, and more.

Package: @neta-art/cohub-cli

Install

npm install -g @neta-art/cohub-cli
cohub --help

Sign in

cohub auth login
cohub auth whoami

The CLI stores a session and refreshes it automatically. CLI self-updates run in the background so commands are not blocked; a successful update takes effect on the next invocation. Set COHUB_CLI_AUTO_UPDATE=0 to disable them.

In Sandbox or CI, COHUB_EXECUTION_TOKEN can override stored auth for ephemeral runs.

Environments

Production is the default.

ENV=dev cohub auth login
ENV=dev cohub spaces ls

Global flags

Flag Purpose
-s, --space <id> Target Space for space-scoped commands
--json Machine-readable output
-h, --help Command help

Many workflows need a Space:

cohub -s <spaceId> spaces get
COHUB_SPACE_ID=<spaceId> cohub spaces get

Terminology

UI CLI
Chat Session
Save Checkpoint
Tasks Task runs
Scheduled prompt spaces prompt schedule / cron jobs

Common workflows

Spaces

cohub spaces ls --json
cohub spaces create --name "Demo" --json
cohub spaces get <spaceId> --json
cohub -s <spaceId> spaces files ls

Prompt a Chat

cohub -s <spaceId> spaces prompt "Fix the failing tests" --json
cohub -s <spaceId> spaces prompt --title "Planning" "Draft a launch plan" --json
cohub -s <spaceId> spaces prompt --session <sessionId> "Continue from the diff" --json

Schedule:

cohub -s <spaceId> spaces prompt --at "2026-07-20T09:00:00+08:00" "Weekly review" --json

Run a command in the Space workspace

cohub -s <spaceId> run -- git status

Files

cohub -s <spaceId> spaces files ls
cohub -s <spaceId> spaces files cat README.md
cohub -s <spaceId> spaces files write notes.md --stdin < notes.md
cohub -s <spaceId> spaces files upload ./src
cohub -s <spaceId> spaces files diff

upload places each file under --dir; a directory argument contributes its contents directly, so upload dist --dir apps/demo lands at apps/demo/index.html, not apps/demo/dist/index.html.

Apps

--file and --dir take paths relative to the Space workspace — the same paths spaces files ls shows, not your local filesystem.

cohub -s <spaceId> apps publish demo --file dist/index.html
cohub -s <spaceId> apps publish site --dir dist
cohub -s <spaceId> apps ls --json
cohub apps stats <workId|url|username/space/work>

Realtime rooms use a published App's runtime identity. Use client.app.realtime inside the App; the CLI intentionally has no room commands.

Drive the Cohub UI

An Agent running in a Space can show a file or App preview in the Cohub tab the chat started from, and call methods the App exposes.

cohub desktop open <appId|url|app://...|username/space/app|file://path>
cohub desktop open file://src/main.ts
cohub desktop open app://alice/studio/launch
cohub desktop open <app-or-file> --call selection.get
cohub desktop open <app> --call board.focus --data '{"nodeId":"n1"}'

Showing a preview is idempotent: repeating it re-activates the same tab. --call waits for the App to announce readiness, then invokes the method. Which methods exist is up to the App author, registered with client.app.surface.handle(name, handler).

Commands only ever reach the frontend instance that originated the current work, resolved from request provenance. They cannot target another user, and there is no DOM access or script evaluation.

Local Sandbox

Expose a local folder as the Space Sandbox:

cohub sandbox up ./my-project
cohub sandbox status

Search and models

cohub search "release notes"
cohub models ls
cohub models ls --model-type multimodal
cohub generate "A calm lake at sunrise" --model <model> --output lake.png

Output discipline

Use --json whenever a script or Agent needs to chain commands.

cohub spaces ls --json
cohub -s <spaceId> spaces sessions ls --json

Human-readable output is fine for interactive use. JSON is better for automation.

Next steps