Install#
shell
npm install -g @anjin/cli
Requires Node 18+.
Quick start#
shell
# 1. Mint an API key (dashboard → API Keys), then: anjin auth:login --api-key ik_live_… # 2. See your published templates and their keys: anjin templates:list # 3. Check what a template's slots accept: anjin templates:schema acme_instagram_1080x1350 # 4. Render, wait for it, and save the image: anjin render acme_instagram_1080x1350 \ --set headline="Summer sale" \ --set hero_image="https://example.com/photo.jpg" \ --wait --out summer-sale.png
Commands#
| Field | Type | Description |
|---|---|---|
auth:login --api-key <key> | auth | Validate and store your API key. |
auth:status | auth | Show the active key and base URL, and validate them. |
auth:logout | auth | Remove the stored key. |
templates:list | read | Published templates and their addressing keys. |
templates:schema <template> | read | A template's slot contract. |
render <template> | render | Render with slot values. |
renders:get <id> | read | A render job's status and URL. |
Add --json to any command for machine-readable output.
Render options#
--set name=value— set a slot value (repeatable).--modifications <json>— a raw modifications array; overrides--set.--format png|jpg|webp— output format (defaultpng).--scale 1..4— resolution multiplier; costs scale² credits.--wait— poll until the render finishes and print the URL.--out <file>— download the finished image to a file.
CI and agents#
Non-interactive environments skip auth:login and use environment variables:
shell
export ANJIN_API_KEY=ik_live_… anjin render acme_banner_1200x630 --set headline="Nightly build" --wait --out out.png
Shell-capable agents can drive the CLI directly; native MCP clients should use the hosted MCP server instead — it returns finished URLs with no polling.
