@gennia/cli) is the gennia command you run in your terminal. Three things it solves:
gennia mcp installinstalls the MCP server into every AI client on your machine (Cursor, Claude Code, Claude Desktop) in one go.gennia apiis the escape hatch into every Public API endpoint — useful for scripts, CI, bash automation.gennia knowledge upload,gennia skills upload,gennia hub upload-logocover what the MCP can’t: multipart file uploads.
CLI and MCP complement each other. The MCP is for conversational chat inside your IDE / app; the CLI is for scripts, shell-bound agents, and bulk operations. Same API underneath, same
@gennia/sdk internally.Install
Requires Node 20+.- Global (recommended)
- npx (no install)
Authentication
gsk_...) — you paste it, it shows as ******** while typing (raw-mode masking, doesn’t leak into shell history). The credential is saved at ~/.config/gennia/config.json with 0600 perms.
Generate the key inside Studio: open your workspace, Settings → API Keys.
To confirm:
--api-key flag → GENNIA_API_KEY env → config file.
Install the MCP into your AI clients
SKILL.md in Claude Code’s skills directory so the agent “knows” about Gennia in fresh sessions.
Non-interactive flags for CI / scripts:
Escape hatch: gennia api
Covers every Public API endpoint. The CLI doesn’t need a custom wrapper for each — gennia api METHOD /path handles all of them.
- Relative:
/agents→ resolves tohttps://api.gennia.ai/public/api/v1/agents - Absolute with prefix:
/public/api/v1/agents - Full URL:
https://api.dev.gennia.ai/public/api/v1/agents
File uploads
Three API endpoints takemultipart/form-data instead of JSON. The CLI has dedicated commands:
--json and the standard exit codes (see below).
Output contract
Every CLI command follows the same rules so it’s reliable in scripts and safe for AI agents:-
stdout = data. Stable JSON by default in non-TTY, pretty in TTY. Force JSON with
--json. -
stderr = humans. Banners, progress, hints. Suppress with
--quiet. -
NO_COLOR=1disables ANSI colors on any command. -
Exit codes that mean something:
Code When 0 Success 1 Generic error or 5xx from the server 2 Usage error (bad flag, missing TTY for a prompt) 3 Not found (HTTP 404) 4 Unauthorized (HTTP 401/403, missing credential) 5 Conflict (HTTP 409, existing configuration) -
Errors are always structured. In
--jsonmode: - No interactive hang. Every command that needs input detects non-TTY and fails fast with a hint pointing at the missing flag.
Environment
| Variable | Default | Effect |
|---|---|---|
GENNIA_API_KEY | — | Workspace API key (gsk_...) |
GENNIA_BASE_URL | https://api.gennia.ai | Override for dev / local backend |
GENNIA_CONFIG_DIR | $XDG_CONFIG_HOME/gennia or ~/.config/gennia | Where config.json lives |
NO_COLOR | unset | Disable ANSI colors |
Bundled skill file
Every CLI install ships askill.md (~6 KB) that gennia mcp install copies into ~/.claude/skills/gennia/SKILL.md (and the Cursor equivalent). It’s a markdown file that teaches the AI agent:
- When to reach for MCP tools vs
gennia apiin the shell - Domain → endpoint mapping
- Common workflows (list every agent, bulk update, etc.)
- Caveats (uploads need
file_path, destructive mutations ask for confirmation)
Update
Source
github.com/Gennia-Tech-Group/gennia-cli — MIT, public.Next steps
Install the MCP
The CLI already installs the MCP via
gennia mcp install, but it’s worth reading how the MCP server works and what you gain from it.Full reference
Every endpoint that
gennia api calls is documented here with schemas and try-it-out.
