@chieflab/cli
v0.6.3
Published
ChiefLab CLI — `chieflab launch-here` is the one product verb. State-aware: boots the workspace first, resumes pending approvals / manual-publish gaps / proactive drafts when present, only mints a fresh launch when the workspace is clear. Auto-attaches Ch
Maintainers
Readme
@chieflab/cli
Hosted MCP from your terminal. ChiefLab's repo-aware launch flow plus approval-gated execution.
Package status: live on npm as
@chieflab/cli.
curl -X POST https://api.chieflab.io/api/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Why a CLI when the MCP is an HTTP endpoint?
Because curl is great until you need the second call. Once you've got a runId to look up, an actionId to publish, a reviewUrl to open, an accountId to pass — you want a real shell tool, not a fistful of JSON-RPC envelopes.
This CLI:
- Saves your API key once (
~/.chieflab/config.json,chmod 600) - Wraps every operator + the closed-loop launch flow with sane flags
- Has zero npm dependencies (node 20+ built-ins only — install in <5s)
- Is honest about JSON output (
--jsonon any command)
Install
Use the one-shot attach path from the repo you just built:
npx -y @chieflab/cli attach --runtime auto --project . --intent "launch this"attach detects the local agent runtime, mints the workspace key, writes MCP
config, plants repo instructions, and persists the pending intent so the agent
can resume after a runtime restart. Both chieflab and chiefmo work as bin
names for manual use later.
Auth
chieflab login # interactive prompt
chieflab login --key clp_... # non-interactive
chieflab whoami # confirm workspace
chieflab logout # forget the keyOr skip the file and pass via env (good for CI):
export CHIEFLAB_API_KEY=clp_live_...
chieflab whoamiGet a key at https://chieflab.io/get-key.
The closed loop
# 0. Install repo instructions so agents call ChiefLab after build
chieflab init
# 1. Plan + draft from the current repo
chieflab launch-here https://yoursite.com --channels linkedin,x,email
# → returns launchId + publishActions + reviewUrl
# 2. Approve on the reviewUrl (open it in a browser)
# 3. Fire the approved actions
chieflab publish launch-action-run_xxx-linkedin \
--content "..." --platform linkedin --account zer_acc_xxx
chieflab send-email launch-action-run_xxx-email \
--from "Brand <[email protected]>" --to [email protected] \
--subject "Launch day" --html "<h1>...</h1>"
# 4. Wait 24h, then read results + get the next-move recommendation
chieflab review run_xxxFull launch wedge in 4 commands.
init writes AGENTS.md, a Cursor rule, Claude command, Codex note, and an MCP config stub. It tells agents to call chieflab_get_users_after_build, surface agentGuide.userMessage, wait for the reviewUrl, execute only approved actions, resume with chiefmo_continue_launch_loop, and measure after 24h.
Compatibility: chieflab install-agent-hook still works. Public docs should prefer npx @chieflab/cli init.
chieflab init --dry-run
chieflab init --runtime cursor
chieflab init --runtime all --forceLaunch Commands
chieflab launch-here https://yoursite.com # preferred: gathers repo context
chieflab launch https://yoursite.com # URL-only fallback
chieflab marketing "Diagnose our current funnel"Each accepts --url <product-url> (auto-extract brand context), --tenant-id <id> (use stored tenant), --idempotency-key <key> (cached re-runs).
Trigger phrases
When an agent calls the CLI on a user's behalf, these phrases map to launch-here:
- "launch this"
- "get users"
- "market this"
- "announce this"
- "post this"
For an existing program ("why is X not working"), use chieflab marketing "<goal>" (calls chiefmo_diagnose_marketing).
Connections
chieflab connections # show what's connected
chieflab connect ga4 # OAuth start (also: search_console, hubspot)
chieflab set-key zernio sk_... # for set-key flows (also: resend)Inbox
chieflab runs # list workspace runs
chieflab runs --limit 50
chieflab open run_xxx # print the signed reviewUrlTools introspection
chieflab tools # list the live MCP tools available on this key
chieflab tools --json # for piping into jqFlags
| Flag | What |
|------|------|
| --json | Emit raw JSON (suppresses pretty terminal output) |
| --key <key> | Override saved key for this call only |
| --endpoint <url> | Override endpoint (default https://api.chieflab.io/api/mcp) |
| Env | What |
|-----|------|
| CHIEFLAB_API_KEY | Wins over saved config (CI-friendly) |
| CHIEFLAB_ENDPOINT | Wins over saved endpoint |
| NO_COLOR | Disable ANSI colors |
License
Apache 2.0. Source at https://github.com/bdentech/chieflab.
