morigraph Developer Docs

Reference

One package, @morigraph/cli, with one command, morigraph. It needs Node.js 22 or newer and has no dependencies.

npm install -g @morigraph/cli     # or run any command as: npx @morigraph/cli@latest <command>

Sign in

morigraph login

Prints a code and a link, opens the link if a person is at the terminal, and waits for a workspace admin to approve. The key is stored in ~/.config/morigraph/credentials.json, readable only by you. See Authentication.

OptionEffect
--no-browserPrint the link without opening it
--with-keyRead an existing key from standard input and store it: printf %s "$KEY" | morigraph login --with-key
--name NAMEThe name the new key gets in the dashboard

MORIGRAPH_API_KEY, when set, is used instead of the stored key. morigraph logout forgets the stored key on this machine; it does not revoke the key.

Look around

morigraph whoami                  # workspace, key and credits available
morigraph credits                 # balance, and this key's last 30 days
morigraph tools                   # every tool, its price, and whether it is switched on
morigraph tools search image      # filter by text
morigraph tools schema image_gen  # one tool's arguments as JSON Schema

Call a tool

morigraph call web_search --arg query="rate limiting patterns" --arg num_results=3
morigraph call image_gen --json-args '{"prompt": "a lighthouse at dusk", "size": "landscape"}'
echo '{"query": "rate limiting patterns"}' | morigraph call web_search --stdin --yes
OptionEffect
--arg key=valueOne argument. Numbers, true, false, and JSON arrays or objects are parsed; anything else is a string. Repeat for more
--json-args JSONAll arguments as one JSON object
--stdinRead the JSON object from standard input
--yesSpend credits without asking. Required when no person is at the terminal. MORIGRAPH_YES=1 does the same
--waitFor a tool that returns a job, wait until it finishes
--idempotency-key KEYReuse a key to retry a call safely. One is generated when you give none

At a terminal, call shows the price and asks before spending.

Jobs

morigraph jobs get JOB_ID     # status now
morigraph jobs wait JOB_ID    # wait until it finishes

Set up a coding agent

morigraph setup agent

Installs a small skill that teaches Claude Code and Codex the commands on this page, for whichever of the two is present on the machine. It prints a line to paste to the agent. A skill you have edited is never overwritten. The agent still needs a key: run morigraph login or set MORIGRAPH_API_KEY.

Connect an assistant over MCP

morigraph setup --client claude-code (or codex, claude) is a different job: it connects an assistant to your workspace's files, memory, skills and connected apps over MCP, with OAuth and no API key. See Connect.

Output and exit codes

Output is JSON when --json is given or when standard output is not a terminal, so scripts and agents always get one JSON object per line. At a terminal it is plain text.

Exit codeMeaning
0Success
1Error. In JSON mode the output has status: "error", code and message
2Sign-in needed, or a manual step remains
3Out of credits

Safety

  • A key is read from MORIGRAPH_API_KEY or the stored login, never from the command line, and is never printed.
  • A key is sent only to morigraph. There is no option to change the address.
  • No command waits for input unless a person is at the terminal.
  • No telemetry and no install scripts.

Built-in help

This is the output of morigraph --help for the current release:

morigraph CLI
Package: @morigraph/cli · executable: morigraph · legacy alias: brainlet

Connect an assistant (MCP, signs in with OAuth, no API key):
  morigraph setup --client claude-code|codex|claude|manual [options]
  morigraph doctor --client claude-code|codex [options]

Call tools from a terminal, script or agent (uses an API key):
  morigraph login [--env prod|dev] [--no-browser]   Sign in; a workspace admin approves in the browser.
  morigraph login --with-key                        Read a key from standard input and store it.
  morigraph logout                                  Forget the stored key on this machine.
  morigraph whoami                                  The workspace, key and credit balance.
  morigraph tools [list | search TEXT | schema NAME]
  morigraph call NAME [--arg key=value ...] [--json-args JSON | --stdin] [--file PATH] [--wait] [--yes]
  morigraph jobs get|wait JOB_ID
  morigraph credits
  morigraph setup agent [--client claude-code|codex]  Install the skill that teaches an agent these commands.

Setup options:
  --env prod|dev       Production by default. Fresh dev uses morigraph-dev.
  --server-name NAME   Use an explicit MCP server name without replacing another.
  --dry-run           Show the plan; no commands, login, or writes.
  --no-login          Configure the host and skill; print the login step.

Everywhere:
  --json              Machine-readable output. The default when output is not a terminal.
  --yes               Allow a call to spend credits without asking (or set MORIGRAPH_YES=1).
  --version           Show the CLI version.
  --help              Show this help.

API keys come from MORIGRAPH_API_KEY or `morigraph login`, never from the command
line, and are sent only to morigraph. Exit codes: 0 ok, 1 error, 2 sign-in or a
manual step needed, 3 out of credits. Docs: https://morigraph.com/docs/
For AI agents: https://morigraph.com/docs/agents.md

Setup runs on the machine that configures your host. Automated setup supports
macOS and Linux. Claude chat and Windows receive manual connection instructions.
OAuth credentials stay with the host. No telemetry, remote scripts, custom URLs
or installation lifecycle hooks are used.
Matching existing brainlet/brainlet-dev connections are reused automatically.