@printago/cli
v0.2.0
Published
Zero-dependency command-line client for the Printago 3D print management API
Maintainers
Readme
printago CLI
A zero-dependency command-line client for the Printago API,
covering all 379 endpoints across 38 resource groups. Pure Node (>= 18, uses the
built-in fetch) — no extra dependencies.
Install
# Homebrew (macOS / Linux)
brew install printago/tap/printago
# npm (macOS / Linux / Windows)
npm install -g @printago/cli
# curl (macOS / Linux)
curl -fsSL https://printago.io/cli-install.sh | sh
# PowerShell (Windows)
irm https://printago.io/cli-install.ps1 | iexAll channels install the same printago command and require Node.js 18+.
Working inside this monorepo? You can also run it directly without installing:
node packages/tools/cli/bin/printago.mjs <group> <action>.
Setup
printago auth login # store your API key (hidden) and store idClaude Code skill
The CLI ships as a Claude Code skill so an AI agent can drive it. Install it into your personal skills, then ask Claude to manage your farm:
printago skill install # -> ~/.claude/skills/printago (all projects)
printago skill install --project # or just this repoStart a new Claude Code session (or run /reload-plugins). You can also install it as a
plugin: /plugin marketplace add printago/printago-skill then /plugin install printago-skill@printago-skill.
Credentials (the key is never echoed or stored in the repo)
auth login writes ~/.config/printago/credentials.json with mode 0600. The API key
is read from a hidden prompt (or piped via stdin) and never appears on a command line.
printago auth login # interactive: prompts store id + hidden API key
printago auth status # shows masked key + which source it came from
printago auth set-base-url http://localhost:3001 # point at local dev
printago auth logout # delete the stored credentials
# non-interactive (CI): key on stdin, store id as a flag
echo "$PRINTAGO_API_KEY" | printago auth login --store f72bcpe7ockwx6zlh4iukgulResolution order at request time: environment variables
(PRINTAGO_API_KEY, PRINTAGO_STORE_ID, PRINTAGO_BASE_URL) override the stored file.
Headers sent: authorization: ApiKey <key> and x-printago-storeid: <store id>.
Usage
printago <group> <action> [path-args] [flags]
printago # list all groups
printago <group> # list a group's commands
printago <group> <action> --help # method, path, and every request-body field (name, type, required)
printago upload <file> # upload bytes to storage, prints the fileUri for `parts create`--help resolves the request-body schema and lists its fields, so you rarely
need the OpenAPI spec to build a --data payload. For nested types, use
printago hints schema-types-get <TypeName>.
Examples
printago printers list
printago printers get <printerId>
printago printers list --limit 5 --sort -createdAt
printago print-jobs list --filter '{"status":{"eq":"printing"}}' # filter on list, not search
printago print-jobs list -q status.in=printing,paused # operators: eq ne gt gte lt lte contains startsWith endsWith in notIn isNull between
printago print-jobs cancel --data '{"printJobIds":["..."]}'
printago orders list --all # auto-paginate every page
printago parts create --data @part.json # body from a file
echo '{"name":"X"}' | printago materials create --data - # body from stdinAction hints (AI discovery)
The API self-describes the meaningful actions per object via /v1/hints. The CLI
surfaces them and maps each to a ready-to-run command. These are public (no auth).
printago hints # objects that have hints + their CLI group
printago hints printer # actions for an object (accepts printer/printers/printJob/print-jobs)
printago printers list --hints # attach hints to a normal response (under a `hints` array)
printago hints schema-types-get Printer # JSON schema for a data typeFlags
| Flag | Meaning |
|------|---------|
| --data <json\|@file\|-> | request body (POST/PATCH/PUT/DELETE) |
| --filter <json> | {field:{op:value}} filter. On list it becomes query params the API honors; filtering via search is ignored by the API (the CLI warns) |
| -q, --query key=value | query-string param (repeatable) |
| --limit --offset --sort --fields --include | common list/search params |
| --meta / --no-meta | {data,meta} envelope with totals; on by default for list/search endpoints |
| --hints | ask the API to attach AI action hints to the response |
| --all | auto-paginate a list/search and return all rows |
| --json | force the JSON envelope even on a TTY |
| --raw | print only the response body (no envelope) |
| --base-url <url> | override the API base for one call |
| -v, --verbose | log each request to stderr |
Output modes
- Human (TTY): the response body is printed as indented JSON.
- Agent (piped): every result is a single-line envelope
{ ok, command, method, path, status, meta?, result, next_actions? }; errors are{ ok:false, command, error:{message,code,status}, fix, details }.
Regenerating
The command catalog is generated from the committed OpenAPI spec
(packages/web/static/printago-api-swagger.json, itself produced by pnpm sdk /
nestia). After API changes, regenerate:
node packages/tools/cli/scripts/generate-catalog.mjsThis rewrites lib/catalog.json and reports any new command-name collisions.
