arkor CLI is the command surface around an Arkor project. The scaffolder (pnpm create arkor) installs arkor as a local devDependency, so use your package manager’s local-bin runner (e.g. pnpm exec arkor <command>, npx arkor <command>, yarn arkor <command>, or bunx arkor <command>) over a bare arkor invocation unless you have installed the CLI globally. Examples in the rest of these docs use the pnpm form; the others work identically.
Commands
Conventions across commands
--help/-his available on every command;arkor <command> --helpprints the flag list and usage.arkor --version/-Vprints the installed SDK version (the sameSDK_VERSIONthe package exports).- Exit codes. Successful commands exit 0. Most commands exit non-zero on failure (uncaught throws, build errors, etc.).
arkor whoamiis a deliberate exception: it prints the failure to stdout but still exits 0 for ordinary cloud-api errors (Failed to fetch /v1/me (<status>)), and only setsprocess.exitCode = 1when the cloud-api responds with 426 (SDK too old). Wrapper scripts that need to detect awhoamifailure should grep stdout, not rely on the exit code. - Telemetry. Every command runs through a small instrumentation wrapper so usage events can be sent to PostHog. See Environment variables below for the full opt-out / debug knobs.
- Deprecation notices. When the cloud-api response carries
Deprecation: true, the CLI prints a one-line warning at the end of the run with the suggested upgrade command. TheWarningandSunsetheaders (when present) format the message; they do not trigger the warning on their own.
Environment variables
On the roadmap
The CLI does readARKOR_CLOUD_API_URL and uses it as the cloud-api endpoint when set (packages/arkor/src/core/credentials.ts’s defaultArkorCloudApiUrl), but pointing at a non-default endpoint (self-hosted or staging) is not yet a stable user-facing knob: the env var is internal-only and may change without notice, and there are no compatibility guarantees on alternate endpoints. First-class support for self-hosted / staging deployments is on the roadmap.
Programmatic invocation
Thearkor package re-exports runTrainer so you can drive a training run from your own TypeScript code instead of going through arkor start:
runBuild, runStart, runDev, etc.) are intentionally not part of the public surface and may change without notice. If you want to wire training into your own code, prefer runTrainer or call trainer.start() / trainer.wait() directly.
Project versus user state
Two locations matter, and the CLI reads / writes both:.arkor/(per-project, gitignored):state.json(project routing) andbuild/index.mjs(the bundled trainer).~/.arkor/(per-user):credentials.json(auth) andstudio-token(per-launch CSRF token, transient).