About stackbone-cli
stackbone-cli is a skill for agents operating the Stackbone CLI. It explains command sequences, safety conventions, documentation lookup, development, deployment, and CI workflows.
Key features
- 01MCP documentation lookup workflow
- 02CLI command and exit-code conventions
- 03Workspace setup and development loops
- 04Migration and deployment guidance
- 05Headless and CI operation
Use cases
- 01Scaffolding and running a Stackbone workspace
- 02Diagnosing CLI errors from JSON output
- 03Creating and applying database migrations
- 04Packaging and registering a deployment
MCP support
It directs agents to the public `stackbone-docs` MCP server and its `list_docs`, `get_doc`, and `search_docs` tools for current CLI documentation.
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ stackbone/ stackbone-skills --skill stackbone-cliAfter installing, type/stackbone-cliin Claude Code to confirm it loaded.
Details
From the project READMEStackbone CLI skill
This skill tells you how to drive the stackbone CLI: the order of operations, the conventions every command obeys, and the loops you run. It holds no flag tables: every flag, output shape and exit code lives in the docs, one page per command.
Where the facts live
The docs are served over MCP as the stackbone-docs server (https://docs.stackbone.ai/mcp, public, tools search_docs, get_doc, list_docs). stackbone docs prints the connection details.
- Start the session with
list_docs(areacli). It returns every CLI page under its section with a one-line description. How to find the page below says which page a task needs; take its path from that list andget_docit. Never type a path from memory: pages move, titles stay. - Before you run a command with a flag you have not verified in this session, read its page.
- When you do not know which command does something,
search_docswith the question in plain words andarea: "cli". stackbone <command> --helpis the local truth for the installed version. When the docs and the binary disagree, the binary wins.
No stackbone-docs tools in your session? Fetch https://docs.stackbone.ai/llms.txt: the same index, one line per page with its title, its description and a link to its raw markdown. Pick the page by title and fetch that link. https://docs.stackbone.ai/llms-full.txt is every page in one file (~700 KB).
How to call the CLI
- The binary is
stackbone(pnpm dlx @stackbone/cli <command>without installing, or a globalpnpm add -g @stackbone/cli). Ifstackbone --helpfails, the CLI is not installed. - Pass
--jsonon every call when you are the consumer: one{ "schema_version": 1, … }line on stdout, or{ "error": { "code", "message", "suggestion" } }on stderr. - Pass
--yesto any destructive verb (retry,cancel,remove,rollback,approve,reject). Without it the verb exits5before any network call. --json,--yesandCI=1all turn prompting off. A command that would have asked (a value, a picker, a confirmation) errors out instead of hanging, so pass every required value as a flag.- Branch on the exit code:
0ok,1generic,2not authenticated (stackbone login),3no project orstackbone devnot running,4not found or no registered deployment,5permission denied.error.codein the envelope is finer (dev_not_running,runtime_not_configured, …). - When a command fails, re-run it with
--jsonand readerror.suggestion: it is the next command to try. ThenSTACKBONE_LOG_LEVEL=debugfor the CLI's own logs on stderr, then--verbosewhen adevboot stage hangs.
Session start
Run these before anything else, and act on the exit code:
stackbone whoami --json # exit 2 → stackbone login (device flow; --no-browser when headless)
stackbone metadata --json # auth + linked project + agents in one payload; exit 3 → init or link
The loops
New workspace. stackbone login → stackbone init <dir> [--with agent|workflow|workflow-agent] [--name <ws>] → cd <dir> → stackbone dev. init links the workspace to the org and writes .stackbone/project.json, so it needs a signed-in session. It installs the workspace dependencies for you, so do not add an install step of your own; read the command's page when you need to skip or recover that. With a TTY it asks which coding agents to set up (skills + the docs MCP server); non-interactive runs set up none unless you pass --agents claude-code,cursor,….
Grow the workspace. stackbone add agent <name> / add workflow <name> [--calls <agent>] / add workflow-agent <name>. Offline, no login, writes only new files, never edits existing TypeScript; a name collision fails unless --force. Must run inside a workspace (exit 3 otherwise). Then write the code with the stackbone skill.
Dev loop. stackbone dev boots Postgres + Redis + MinIO, compiles and serves the workspace at http://127.0.0.1:4242 with hot reload, and opens a tunnel so cloud Studio can reach it. The first run on a fresh machine stops until a model provider is configured (a Studio link is printed; or export MODEL_PROVIDER_BASE_URL + MODEL_PROVIDER_API_KEY before booting). Then:
stackbone workflows list --json
stackbone workflows start <name> --input '{"…"}' --json # validates against the declared schema → { runId }
stackbone runs get <runId> --json
stackbone logs tail --run <runId> --json # the per-step frames; --follow for a live run
Chat with an agent through Studio's Playground or POST http://127.0.0.1:4242/openai/v1/chat/completions with "model": "<agent-name>" and any non-empty bearer (Getting started (CLI › Guides)).
Schema change. Edit src/schema.ts → stackbone db migrate create <name> → read the generated SQL under .stackbone/migrations/ → stackbone db migrate up → stackbone db migrate status. Never edit an applied migration; create a new one. No BEGIN / COMMIT in migration files.
Operate an installation. A verb with no --agent targets the local-dev installation and needs stackbone dev running (dev_not_running, exit 3, otherwise). stackbone agents list --json gives the installation ids; pass --agent <id> per call to target a deployed one. Approvals: stackbone hitl list --status pending --json → stackbone hitl approve|reject <id> --yes --json.
Ship. There is no publish command. stackbone package writes a deploy folder (compiled workspace + Dockerfile + compose + .env + README) someone runs with docker compose up -d; stackbone build writes only the bundle for an image you own. Then register the running box: stackbone link --agent <slug> --installation <id> --url <public-url> --secret <hmac-secret> --tag <image-tag> (the tag is the version; re-run link on every deploy). A box answers for one installation, so --installation is the id of a cloud row of that agent in stackbone agents list --json; link never creates an installation, so install the agent first. Read link (CLI › Reference) before the first link: it explains where the secret comes from.
After it ships, three skills take over. A box that nobody has wired reaches nothing and measures nothing, and each of these covers one sidebar group the CLI does not reach: stackbone-integrations connects a provider, arms a trigger so the agent receives on its own, and sends what it writes somewhere; stackbone-guardrails puts limits on a running agent — block a turn, mask data, hold it for a person; stackbone-evals turns a manual Playground poke into a suite you can run in CI.
CI / headless. Login is device-flow only (no token env var): run stackbone login once where a browser exists and carry ~/.stackbone/credentials.json (chmod 600) into CI. Then --json everywhere, --yes on destructive verbs, --agents <list> on init / link if you want the coding-agent setup.
Rules that hold everywhere
- Never commit
.stackbone/(initgitignores it). Runstackbone devin a clone without it and it asks which agent this project is, then writes the file.linkcannot do that job: it needs a deployed box (--installation --url --secret --tag), and with no project file to remember an installation id it refuses. - Paginated lists take
--limit+--cursorand returnitems+nextCursor; passnextCursorback to walk forward.logs tailstreams instead. - Secrets are never printed:
secrets listmasks values and there is no reveal verb. Do not try to read one from the CLI. db queryis a single read-onlySELECT; schema changes go throughdb migrate create. The RAG schema is platform-provisioned; never migrate it by hand.inittakes no--starter/--template; passing one exits non-zero with a migration message. Per-piece templates live onadd(stackbone add workflow <name> --template <t>).- Retired commands you may see in old material:
publish,openrouter,connectors. They do not exist; usebuild/package+link,Gateway(Home › Features), and Studio's integrations page. - Interactive prompts protect humans typing
! stackbone …. When you are the consumer,--json --yesis the default.
How to find the page
- A flag, a verb, an output shape or an exit code of one command: the page titled with the command's name under CLI › Reference (
login/logoutshareSign in and out;whoami/current/list/organization use/metadatashareAccount and organization). - A rule every command obeys (how a verb picks its target, the JSON envelope, pagination, the
--yesgate, exit codes):Command conventions, andConfiguration referencefor global flags, env vars and on-disk state (both under CLI › Reference). - A
devboot that stops, or a command that refuses to target:Troubleshootingunder CLI › Guides (or the stackbone-debug skill). - Anything else (the HTTP wire, shipping, setting up coding agents by hand):
search_docswith the question in plain words and areacli, or areahomefor deployment and setup pages.
Other skills
- stackbone: the code inside the workspace (
defineDeepAgent,'use workflow', the ambientstackboneclient). - stackbone-debug: locate the cause of an error, a failed or stuck run, a parked approval.
- stackbone-coder: start a new piece from a one-line idea through an interview.