Skip to main content

@krios/cli

Command-line tool for operations + CI integration. A thin shell over the REST management API.

Install

pnpm add -g @krios/cli
krios --help

Configure

krios config set endpoint http://localhost:3000
krios config set api-key krios_mk_… # management key
krios config set default-project demo
krios config show

Or pass --endpoint / --api-key / --project per command. Env vars are read too: KRIOS_ENDPOINT, KRIOS_API_KEY, KRIOS_PROJECT.

Output modes

Every command honors:

  • --json (default) — single JSON document on stdout
  • --human — pretty-printed
  • --quiet — bare minimum (often just an id or count)

Top-level grammar

krios <noun> <verb> [positional...] [--flags]

Commands

Auth + config

krios auth login # interactive: stores endpoint + key
krios config set <key> <value> # endpoint, api-key, default-project
krios config show

Content types (schema)

krios types list
krios types get <apiName>
krios types create --file ./blog-post.json
krios types generate --output ./src/krios.types.ts # emit TS interfaces

Schema (CI/CD)

krios schema pull --dir ./schema/ # dump every type as JSON files
krios schema push --dir ./schema/ # idempotent upsert from local files
krios schema diff --dir ./schema/ # compare local vs remote

schema diff exits non-zero when local files differ from the live project and 0 when they're in sync — git-style (like git diff --exit-code) — so CI can gate a merge directly on the exit code. The emitted output still lists what changed (--json document, or the --quiet change line).

Content snapshot

krios content export --site main --locale en-US --output ./content/
krios content import --dir ./content/ --site main --locale en-US --publish

Entries

krios entries list [--type --site --locale --status --page --limit]
krios entries get <id> [--locale]
krios entries create --type <api> --locale <code> [--site <id>] --file <path>
krios entries update <id> --locale <code> --file <path> [--version N]
krios entries publish <id> --locale <code>
krios entries search <query> [--type --site --locale --status]

Media

krios media upload <filepath>... # [--folder <id>] [--tags a,b]
krios media list # [--folder <id>] [--tags --kind --mimeType]

Sites

krios sites list
krios sites get <slug>

API keys

krios keys create --name <n> --type <delivery|management|preview> \
[--site <id>] [--expires-at <iso>] [--rate-limit N] \
[--permission ...]
krios keys list
krios keys revoke <id>
krios search reindex # full reindex of all entries

Tenant (super-admin)

krios tenant migrate --tenant <slug> --from shared --to dedicated --db-url <url>
# emit migration plan (V3)

Exit codes

  • 0 — success
  • 1 — generic error
  • 2 — input validation failure
  • 3 — conflict (version mismatch, slug collision, etc.)

CI example

# .github/workflows/schema.yml
- run: npx @krios/cli@latest schema diff --dir ./schema --quiet
env:
KRIOS_ENDPOINT: ${{ secrets.KRIOS_ENDPOINT }}
KRIOS_API_KEY: ${{ secrets.KRIOS_MANAGEMENT_KEY }}
KRIOS_PROJECT: demo

The step fails automatically when local schema files drift from the live project — schema diff exits non-zero on any difference. Inspect the emitted --quiet/--json output to see exactly what changed.