Documentation

    Getting started

Developing with agents: the CLI and your coding agent

This guide is for developers who want to build and iterate on GraphN workflows and agents using the terminal and AI coding assistants—not only the web UI.
You will learn how to:
  • Install and configure the GraphN CLI
  • Bootstrap Cursor, Claude Code, Codex, and AGENTS.md with project rules and optional MCP
  • Use embedded skills and docs shipped with the CLI
  • Follow a tight edit → validate → dry-run → publish loop
If you are new to GraphN, start with Getting started and Core concepts.
Command names: graphn workflow and graphn wf are the same command; graphn blueprint and graphn bp are the same command. Examples below use the long form.

1. Install the CLI

Homebrew (macOS / Linux)

bash
brew tap voltagepark/graphn
brew install graphn

Direct download

Download the binary for your platform from GitHub Releases:
macOS (Apple Silicon):
bash
curl -sSL https://github.com/voltagepark/graphn-cli/releases/latest/download/graphn-darwin-arm64 -o graphn && sudo install graphn /usr/local/bin/graphn && rm graphn
macOS (Intel):
bash
curl -sSL https://github.com/voltagepark/graphn-cli/releases/latest/download/graphn-darwin-amd64 -o graphn && sudo install graphn /usr/local/bin/graphn && rm graphn
Linux (x86_64):
bash
curl -sSL https://github.com/voltagepark/graphn-cli/releases/latest/download/graphn-linux-amd64 -o graphn && sudo install graphn /usr/local/bin/graphn && rm graphn
Linux (ARM64):
bash
curl -sSL https://github.com/voltagepark/graphn-cli/releases/latest/download/graphn-linux-arm64 -o graphn && sudo install graphn /usr/local/bin/graphn && rm graphn

Verify and update

bash
graphn version
graphn --help
Update when needed:
bash
graphn update

2. Authenticate

Sign in with your browser — no API key needed:
bash
graphn login
This opens your default browser, authenticates via Google or GitHub, and stores a session token locally. Your workspace is selected automatically.

Or: API key

If you prefer API keys (e.g. for CI or shared environments):
  1. In the GraphN web app, open your workspace Settings → API Keys (or click the API Keys button in the header) and create a key.
  2. Run the interactive setup:
    bash
    graphn init --setup-only
    This stores your API base URL (for production, typically https://cp.graphn.ai), API key, and default workspace ID in the CLI config.

Verify connectivity

bash
graphn whoami
graphn config show
You can override config with environment variables (useful in CI):
Scroll horizontally to compare
VariablePurpose
GRAPHN_API_KEYAPI key
GRAPHN_URLAPI base URL
GRAPHN_WORKSPACEWorkspace ID
GRAPHN_GATEWAY_URLRequired for graphn workflow run (production execution through the gateway)

3. Bootstrap your repo for AI assistants (graphn init)

Running graphn init (without --setup-only) creates files that teach your coding agent how to use the GraphN CLI when it works in your repository. Four targets are supported:
Scroll horizontally to compare
AgentFiles written
Cursor.cursor/rules/graphn.mdc, .cursor/mcp.json
Claude Code.claude/skills/graphn-workflow/SKILL.md, CLAUDE.md, .claude/settings.json
OpenAI Codex CLIAGENTS.md, .agents/skills/graphn-workflow/SKILL.md, .codex/config.toml
AGENTS.mdAGENTS.md
The agents target covers every tool that reads the cross-agent AGENTS.md convention — Zed, OpenCode, Amp, Roo Code, and GitHub Copilot among them — so those tools are supported without needing an entry of their own. Gemini CLI reads GEMINI.md by default, so it only picks up AGENTS.md if you add it to context.fileName in .gemini/settings.json.
codex and agents share the AGENTS.md writer, so selecting both writes the file once.
Every path is written inside your project — no agent configuration goes to ~/.codex, ~/.claude, or ~/.cursor, so everything graphn init changes about your agent setup shows up in git status and git checkout undoes it. CLAUDE.md, AGENTS.md, and .codex/config.toml are yours as well as GraphN's, so only the region between the graphn:start and graphn:end markers is rewritten; anything outside them is copied through untouched.
Codex trust prompt: because .codex/config.toml is project-scoped rather than global, Codex only loads it for directories you have trusted and prompts the first time you run codex in the project. Until you accept, the GraphN MCP server will not appear under /mcp.

Choosing agents

By default graphn init configures Cursor and Claude Code, plus any other agent this directory already shows evidence of. Use --agent to choose explicitly:
bash
graphn init                      # Cursor + Claude Code, plus any agent detected here
graphn init --agent codex        # one agent
graphn init --agent cursor,codex # several (repeatable or comma-separated)
graphn init --agent all          # every supported agent
graphn init --agent auto         # only agents this directory shows evidence of
Values are case-insensitive, deduplicated, and always applied in registry order, so --agent codex,cursor and --agent cursor,codex write the same files. An unrecognized value is an error rather than a silent no-op, and --agent auto fails in a directory with no coding agent in it.
Other flags:
  • --setup-only — only API/workspace setup; no rule files.
  • --skills-only — only create/update rule files; no setup wizard.
  • --cursor-only / --claude-only — deprecated aliases for --agent cursor / --agent claude. They still work, but cannot be combined with --agent.
After graphn init, your coding agent can suggest commands like graphn workflow dry-run, graphn agent update, and graphn blueprint deploy with the right context.

4. Embedded skills and documentation (graphn docs)

The CLI ships focused guides you can read in the terminal (no browser required):
bash
graphn docs skills                    # list available skills
graphn docs skills workflow-building  # patterns, deploy checklist, secrets
graphn docs skills rag-pipeline       # RAG / knowledge-base workflows
graphn docs skills debugging          # failure diagnosis, common errors
graphn docs skills gateway-modes      # sync vs async, --gateways flag, polling
graphn docs skills dsl-schema         # full DSL schema
graphn docs skills dsl-commands       # CLI command reference
Other topics:
bash
graphn docs dsl
graphn docs api
graphn docs helpers
graphn docs all
Relationship to “skills” in your editor: GraphN’s graphn docs skills … are built-in documentation topics bundled with the CLI. Separately, you can add your own agent skills in your repo (for example Cursor Agent Skills in .cursor/skills/your-skill/SKILL.md) for your team’s conventions. They work together: your skills describe your process; graphn docs describes GraphN’s workflows and APIs.

5. Expose the CLI to the IDE via MCP (graphn mcp-serve)

Model Context Protocol (MCP) lets a coding agent call external tools. GraphN can expose all CLI commands as MCP tools so the agent can list workflows, run dry-runs, or update agents without you pasting shell output.
Start the server on stdio (the IDE spawns it):
bash
graphn mcp-serve
graphn init already registers this server for Cursor, Claude Code, and Codex. The formats below are what it writes, for when you would rather configure it by hand.
Cursor — add to .cursor/mcp.json (create the file if needed):
json
{
  "mcpServers": {
    "graphn": {
      "command": "graphn",
      "args": ["mcp-serve"]
    }
  }
}
Claude Code — add to .claude/settings.json under mcpServers:
json
{
  "mcpServers": {
    "graphn": {
      "command": "graphn",
      "args": ["mcp-serve"]
    }
  }
}
Codex — add to the project's .codex/config.toml:
toml
[mcp_servers.graphn]
command = "graphn"
args = ["mcp-serve"]
Codex loads project config only for directories you have trusted, so the server appears under /mcp after you accept the trust prompt on your first codex run in the project.
Other MCP-capable agents take the same command and args in whichever config file they read.
Ensure graphn is on your PATH where the IDE runs. After connecting, the coding agent can invoke GraphN operations as structured tools (exact tool list depends on CLI version; use graphn --tool-schema for machine-readable command metadata if you automate).

6. A practical development loop

Typical flow when changing a workflow or agent:
  1. Inspect workspace state
    bash
    graphn context
    graphn workflow list
  2. Edit — In the UI, or locally: export a bundle or DSL if your team uses repo-backed YAML, then push changes to the API:
    bash
    graphn workflow update <workflow-id-or-name> --dsl ./workflow.yaml
    Use the workflow name or ID (wf_…) from graphn workflow list.
    The template YAML tab in the web app is the same DSL you can validate and update from disk:
    Workflow editor — YAML tab with DSL header and steps
    Workflow editor — YAML tab with DSL header and steps
    For a full DSL reference, see Workflow DSL.
  3. Validate
    bash
    graphn workflow validate ./workflow.yaml
    graphn workflow validate ./workflow.yaml --deep
  4. Test without the gateway
    bash
    graphn workflow dry-run <workflow-id-or-name> --input-file ./input.json
  5. Publish components so production runs resolve pinned versions:
    bash
    graphn agent publish "<Agent Name>"
    graphn workflow publish <workflow-id-or-name> -m "Describe change"
  6. Production run (requires gateway URL):
    bash
    graphn config set-gateway-url https://your-gateway-base
    graphn workflow run <workflow-id-or-name> --input-file ./input.json
Use -f text for human-readable tables and -v to print HTTP traces when debugging.

7. Blueprints from the CLI

List and deploy templates without opening the app:
bash
graphn blueprint list
graphn blueprint info kb-ingestion
graphn blueprint deploy kb-ingestion --name "My Company KB Search"
Blueprint IDs and names change over time; always use graphn blueprint list as the source of truth.

8. When you need more than the default templates

The Company Knowledge Search blueprint gives you: storage → OCR → KB ingest → Researcher (RAG) → Synthesizer. That is the right shape for document-grounded analysis, but the default prompts and tools are generic (for example, a single semantic_search tool and general Q&A instructions).
To match a strict domain workflow—such as extracting every shall / must into a compliance matrix with UCF sections—you typically need to:
  • Extend MCP tools (e.g. keyword search, document listing, bounded full-text read) where the product supports them.
  • Rewrite Researcher and Synthesizer instructions for your output schema (tables, columns, evidence quotes).
  • Run dry-runs on real contracts and iterate until stakeholders sign off.
See the Document analysis tutorial for the edit agents and prompts pattern in the UI. The same resources can be updated from the terminal (graphn agent update …, graphn mcp-server update …; mcp-server and mcp are the same command).

9. Telemetry

The CLI collects anonymous telemetry to help us diagnose crashes and improve performance. Telemetry is on by default and can be disabled at any time.
What is collected:
  • Command name, error messages, and CLI arguments
  • Workspace ID, org ID, and API URL
  • Request bodies (for debugging failed API calls)
  • CLI version, OS, and architecture
  • Anonymous device ID (random UUID, not tied to your account)
What is never sent: API keys and bearer tokens are always redacted before any data leaves your machine.
Sampling rates:
Scroll horizontally to compare
Event typeSample rate
Errors (crashes and failed commands)100% — every error is reported
Performance traces (successful commands)20%
Local crash log: Regardless of telemetry settings, errors are always written to ~/.graphn/crash.log (local-only, never sent remotely). The log rotates at 1 MB.
Opt out:
bash
# Disable permanently
graphn telemetry disable

# Disable for a single session
GRAPHN_TELEMETRY_DISABLED=1 graphn <command>

# Re-enable
graphn telemetry enable

# Check current status
graphn telemetry status
You are also prompted to opt out during graphn init.


11. Troubleshooting

Scroll horizontally to compare
IssueWhat to try
401 / 403Re-run graphn init --setup-only; check API key and workspace ID. If you recently changed the CP URL, the API key may belong to a different environment — run graphn config set-key <new_key> and graphn whoami to confirm.
graphn workflow publish "My Workflow" not foundUse the workflow ID (wf_…) from graphn workflow list.
workflow run says gateway requiredSet GRAPHN_GATEWAY_URL or graphn config set-gateway-url.
MCP tools not appearingConfirm graphn mcp-serve runs manually; check IDE MCP config and PATH.
mcp start --wait timed outThis is safe to ignore for dry-run and workflow runs. The runtime starts the server on-demand when the first tool call occurs. Only block on mcp start if you need the server running before external tests.
Dry-run or wf run hangs / client times outThe workflow likely takes over ~2 minutes. Switch to async: graphn workflow run <id> --mode async --input '…', then poll with graphn exec get <exec_id> --watch.
Feature missing after graphn updateVerify with graphn version. The installed binary may lag behind the latest commit; check GitHub Releases for the newest tag.
For deeper debugging, run graphn docs skills debugging. For gateway mode guidance (sync vs async), run graphn docs skills gateway-modes.
Previous

Getting started

Next

Core concepts