Anjin Design
Docs navigation

Docs

CLI

Everything the REST API does, from a shell: discover templates, check slot contracts, render and download — with a --json flag on every command for scripts.

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#

FieldTypeDescription
auth:login --api-key <key>authValidate and store your API key.
auth:statusauthShow the active key and base URL, and validate them.
auth:logoutauthRemove the stored key.
templates:listreadPublished templates and their addressing keys.
templates:schema <template>readA template's slot contract.
render <template>renderRender with slot values.
renders:get <id>readA 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 (default png).
  • --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.