CLI

[ AxiomCore · Documentation ]

CLI overview

What the Axiom CLI is, how its 38 commands are grouped, and its global options, exit codes, environment variables, files and terminal interfaces.

The Axiom CLI (axiom) is the single command-line tool for AxiomCore. It checks and builds Acore contracts, runs backends, frontends and databases locally, inspects applications, manages extensions and packages, and publishes releases to Axiom Cloud. This reference covers the released CLI 0.149.1: 38 top-level commands and 203 commands in total.

How the CLI reference pages group the commands
How the CLI reference pages group the commands
Diagram source
flowchart TD
  A[axiom] --> P[Setup and project]
  A --> B[Build and run]
  A --> T[Test and mock]
  A --> S[axiom server]
  A --> D[axiom database]
  A --> U[axiom ui]
  A --> C[Contracts, packages, security]
  A --> E[axiom extensions]
  A --> I[axiom inspect]

Most work happens offline on your machine. Setup commands prepare a repository and an account. Build and run commands turn Acore source into contracts and running services. The large namespaces (server, database, ui, extensions, inspect) each have their own page. Only a few commands reach Axiom Cloud; see Cloud access and telemetry.

Command pages

PageCommands
Setup and project commandsinit, onboard, doctor, login, join, project, install, cache, editor, lsp, repl, eval
Build and run commandscheck, build, run, serve, watch, explain, diff, pull, package, release, deploy, migrate, benchmark
Test and mock commandstest, scenario, mock
axiom serverserver and its 22 subcommands
axiom databasedatabase and its 14 subcommands
axiom uiui and its 16 subcommands
Contract, package and security commandscontract, packages, dependencies, domain, security
axiom extensionsextensions and its 19 subcommands
axiom inspectinspect and its 46 subcommands
Secrets commands (source preview)secrets, which is not in CLI 0.149.1

All top-level commands

For the separate Experimental axiom secrets source-preview namespace, use the Secrets CLI reference. Published CLI 0.149.0 does not carry its protected runtime qualification. The Cloud Dashboard workflow is deployed as Alpha.

CommandPurpose
axiom initCreate an axiom.acore source for a FastAPI or Go backend.
axiom onboardDetect a repository's role and print or apply the shortest first path.
axiom doctorInspect local prerequisites without changing files, logging in or pulling.
axiom loginSign in to Axiom Cloud with a device code.
axiom joinJoin the Axiom Cloud waitlist.
axiom projectList, create, link and rotate keys for Cloud projects; resolve or package a local Acore project.
axiom installInstall the language server, an .axiomapp, or an extractor module.
axiom cacheBrowse, read or clear the CLI's local cache.
axiom editorOffline saved-source checks and editor compatibility metadata.
axiom lspRun the Acore language server over stdin and stdout.
axiom replStart the Acore REPL.
axiom evalEvaluate an Acore file and print it as Acore, JSON, YAML or Markdown.
axiom checkCheck a frontend, backend or database contract without writing outputs.
axiom buildBuild a contract under .axiom/contracts, or export it with --out.
axiom runRun a backend, frontend, database SQL console or packaged .axiomapp.
axiom serveStart the real local API; never falls back to mocks or Cloud.
axiom watchWatch for changes and rebuild or pull automatically.
axiom explainPrint expanded backend JSON or the declaration catalog.
axiom diffShow what changed between Acore files or against the build baseline.
axiom pullFetch a contract and generate a typed client.
axiom packageCombine target-specific .axiomapp builds into one artifact.
axiom releaseUpload a backend contract to Axiom Cloud as an immutable version.
axiom deploySave a Cloud mock configuration for the linked project.
axiom migrateConvert a legacy backend contract into a new sibling source.
axiom benchmarkMeasure local build and artifact-load times.
axiom testRun the test suites declared in a contract.
axiom scenarioValidate and replay development scenarios against compiled artifacts.
axiom mockRun server simulation or local or Cloud contract mocks.
axiom serverScaffold, validate, run, package and verify server plans offline.
axiom databaseRun and migrate versioned PostgreSQL and SQLite contracts.
axiom uiAdvanced frontend tooling: hosts, packaging, tests and inspection.
axiom contractResolve and verify signed contract dependencies for an Acore UI app.
axiom packagesBuild, resolve, verify, inspect and diff frontend .axiom packages.
axiom dependenciesResolve and audit third-party packages used by authored extensions.
axiom domainValidate or bootstrap the optional Domain Model layer.
axiom securityAnalyze the opt-in security model without building.
axiom extensionsBuild, sign, verify, inspect and review sandboxed extensions.
axiom inspectInspect an application workspace, contract or packaged application.

Global options

axiom

The root command. It only dispatches to a subcommand.

Usage
axiom <COMMAND>
OptionValueDefaultMeaning
-h, --helpflagoffPrint help. Every command and subcommand accepts it.
-V, --versionflagoffPrint the CLI version.

axiom help [COMMAND]... prints the same help as --help, for example axiom help database migrate. There are no other global options: each command takes its own options after its name. A few commands with long help, such as axiom ui inspect, print a summary with -h and the full text with --help.

Terminal
axiom --version
Expected output
axiom 0.149.1

Exit codes

CodeMeaning
0The command succeeded.
1The command failed. The CLI prints Error: and the cause on stderr. Failed checks also exit 1, for example check, doctor --strict, database status --check, a failing test, or security check with errors in strict mode.
2The command line is invalid: an unknown command or option, or a missing required argument. Nothing ran.

A few commands report findings but still exit 0 by design, for example axiom diff and security check in audit mode. Use the gate the command offers, such as inspect diff --fail-on or security check --fail-on-warning. A non-zero exit is the command's result, not a guarantee that no remote state was written before a later stage failed.

Environment variables

VariableRead byEffect
DATABASE_URLrun, databaseDefault PostgreSQL or SQLite URL when no endpoint option is given. See connection options.
PGPASSWORD, PGUSER, PGDATABASErun, databasePostgreSQL password, user and database when you use connection fields. USER is the last fallback for the user name.
CIinteractive commandsWhen set, prompts are skipped and commands that need an answer fail with the option to pass instead.
AXIOM_REFERRAL_CODECloud commandsReferral code for the one-time Cloud access check. In CI without it, a Cloud command exits 1.
AXIOM_TELEMETRYCloud commandsExactly 0, false, FALSE, off or OFF disables usage telemetry.
AXIOM_CLOUD_URLCloud commandsReserved for local control-plane development. Accepts only localhost or a loopback IP, and selects a separate local profile. Leave it unset.
AXIOM_FASTAPI_EXTRACTOR, AXIOM_GO_EXTRACTORbackend buildsPath to the FastAPI or Go extractor. Default: ~/.acore/bin/.
AXIOM_DATABASE_TRUSTED_KEYdatabase migrate, runWhen set, the migration release signer must match this key.
AI_GATEWAY_API_KEYinspect ask, inspect serveKey for the opt-in remote Jev question planner.
AXIOM_UI_WEB_PORT, AXIOM_UI_WEB_NO_OPEN, AXIOM_UI_ANDROID_DEVICE_SERIAL, AXIOM_UI_NODE, AXIOM_UI_CACHE_ROOT, AXIOM_UI_DEBUGui, runWeb port, browser opening, Android device, Node.js executable, UI cache location and debug output. See axiom ui.

serve, run and server run also read the provider values that your deployment files name, such as AXIOM_REDIS_URL or AXIOM_JWT_PUBLIC_KEY. See axiom server.

Cloud access and telemetry

Commands that use Axiom Cloud need network access. Most also need axiom login and, for project operations, membership in the project.

Needs Axiom CloudCommands
Sign-in (axiom login first)project list, project create, project link, project rotate-key, release, build --release, deploy mock-server, mock --cloud
Networklogin, join, pull of a remote contract, watch without --build, onboard --contract, install NAME --module, project resolve, dependencies resolve, ui host install (downloads a signed host)
Nothing remoteEverything else, including check, build, serve, inspect, database, server and doctor. axiom run of a frontend offers to download a missing UI Host, and the opt-in Jev planner of inspect ask and inspect serve is remote.

One-time access check. Axiom Cloud is in private alpha. The first time you run a command that is not on the local list (for example login, project, release, pull of a remote contract, cache, or install NAME --module), the CLI asks once for a referral code, or reads AXIOM_REFERRAL_CODE, and registers the machine. Without a code, use axiom join to join the waitlist. Local commands never ask.

Telemetry. After a command that passed the access check, the CLI sends one usage record: a random machine ID, the command name, duration, success, an error category, the OS and the CLI version. It never sends arguments, file paths, URLs, credentials or contract and project names. Set AXIOM_TELEMETRY=0 to turn it off; only 0, false, FALSE, off and OFF are recognized. Local commands send nothing.

Files and directories

LocationContents
CLI profile directory: axiom inside the OS configuration directory (for example ~/Library/Application Support/axiom on macOS, ~/.config/axiom on Linux)auth.json (Cloud session and directory-to-project links), access.json (access registration and machine ID), cache/ (the axiom cache store). Owner-only permissions on Unix.
~/.axiom/bin/acore-lsp from axiom install lsp-server.
~/.acore/bin/Backend extractors.
.axiom/ in each project rootGenerated, CLI-owned state: contracts/ (build output), baselines/ (diff baselines), dev/ (development locks), database/ (version catalog, default SQLite data, development key), inspector/ (snapshots and runtime sessions).

A project root is the nearest directory with an AxiomDeps.toml. Do not edit .axiom/ by hand; commit the source files and the locks your workflow reviews.

Terminal interfaces

Some commands draw a keyboard interface when attached to a terminal. In CI, use their headless or JSON alternatives.

CommandInterfaceKeys
axiom inspect FILE.axiom (backend contract)Single-contract inspector with endpoint and model views.Tab switches views, j/k or arrows move, q or Esc exits.
axiom watch --buildRebuild state, last sync time and semantic changes.r refreshes, q or Esc stops.
axiom watchContract changes after a pull.q stops.
axiom cache lsCache explorer.j/k or arrows move, x deletes the entry, q or Esc exits.
axiom initSetup wizard.Arrows and Enter; Esc or Ctrl+C leaves.
axiom loginDevice code and approval status.Waits for the browser flow.
axiom project link, releaseProject picker and version prompt.Pass --project-id, --project or --version in automation.

The contract inspector needs a terminal: without one it fails. For scripts, use axiom inspect overview or another axiom inspect subcommand with --format json. Its search field is not part of the keyboard contract. For a whole application, use the browser-based axiom inspect serve dashboard, which binds to loopback with a per-session token.

Automation rules

  • Use --json or --format json only where a command offers it, and do not parse human or styled output.
  • Use non-interactive options (--non-interactive, --project, --version, --project-id) and pinned inputs and locks in CI.
  • Gate on the exit code, then read the machine output.
  • Keep the private files that commands write (plans, deployments, keys, development credentials) out of source control.