AXIS CLI

packages/cli — install, doctor, Worker setup (D1/OAuth), secrets, deploy, health — CLI-first operator path.

This page

AXIS CLI

Abstract

The AXIS CLI (@hoox-sh/axis-cli under packages/cli) is the CLI-first operator entry for local install, Worker bootstrap, Cloudflare® secrets, deploy, and health checks. It wraps Bun + Wrangler with AXIS-specific paths and defaults (Worker name worker-axis, D1 pynescript, OAuth device flow).

axis --help listing install, doctor, setup, deploy, health

Requires Node ≥ 20 to run the published binary (npm i -g @hoox-sh/axis-cli) and Bun ≥ 1.2 for install/dev/build commands that shell out to Bun. Product version follows root package.json; the CLI package (@hoox-sh/axis-cli) is versioned independently and publishes on v* tags via .github/workflows/release.yml.

Conceptual model

Diagram

Rendering…

Install

# npm
npm install -g @hoox-sh/axis-cli
axis --help

# from monorepo root
bun install
cd packages/cli && bun install && bun run build && cd ../..

bun run axis --help
# Make pass-through
make axis ARGS="--help"
# Optional global link
cd packages/cli && bun link && axis --help

Repo aliases (bun scripts & Make targets)

axis is the primary interface. These aliases exist for working inside the repo checkout without a global install:

AliasRuns
bun run axis -- <args>packages/cli/bin/axis.js
bun run axis:installaxis install
bun run axis:doctoraxis doctor
bun run axis:setupaxis setup
bun run axis:deployaxis deploy (default worker)
bun run axis:healthaxis health
make axis ARGS="doctor --remote"same bin with args
make axis-install · axis-doctor · axis-setup · axis-deploy · axis-healthfixed wrappers

When using bun run axis setup -- --flag, keep the -- so Bun forwards flags to the CLI.

Command surface

CommandRole
axis installbun install root + worker/ + CLI
axis doctor [--remote]Toolchain, CF auth, optional live /health. Missing worker/wrangler.toml is a warning until axis setup (expected on a fresh clone).
axis setupBootstrap: install → ensure toml → local D1
axis setup --prodProduction bootstrap: remote D1 schema + API_KEYS KV
axis setup workerCopy wrangler.toml.examplewrangler.toml if missing
axis setup d1 --local|--remote [--create]Apply worker/schemas/scripts.sql (scripts + version history)
axis setup kv [--usage]Create and bind API_KEYS KV (required when D1 is on)
axis setup oauth --github-client-id …Set public OAuth App id in [vars] (or --secret)
axis keys create [--tier hobby]Mint a pn_… key via POST /api/keys (ADMIN_TOKEN)
axis keys validate --key pn_…Validate a key against the Worker
axis secret put|list|deleteWrangler secrets (ADMIN_TOKEN, EXTERNAL_BACKEND, …)
axis deploy / deploy workerApply remote D1 schema, then deploy Worker worker-axis
axis deploy pagesVite build + Pages project
axis deploy allSchema + Worker + Pages
axis health [--oauth] [--scripts] [--url …]Probe /health, optional OAuth start, optional /api/scripts
axis whoamiCloudflare® account
axis devVite product UI
axis dev workerLocal wrangler Worker
axis dev desktopTauri desktop shell

Global flags: --json, --quiet, -y / --yes.

Installation self-check

Every axis command starts with a lightweight, local-only self-check (skipped for --version / --help, silenced by --quiet / --json). It never blocks a command — it only prints stderr warnings when something is off:

  • Runtime compliance vs engines (Node ≥ 20, Bun ≥ 1.2)
  • Install context — npm install, npx cache, or repo checkout
  • Version drift — a globally installed CLI older than the repo checkout it is operating on (npm i -g @hoox-sh/axis-cli to update)

The same check appears as the optional CLI installation row in axis doctor (and in doctor --json as cli-install).

axis doctor: required toolchain and wrangler checks passed

Production checklist

axis install
axis doctor
axis setup --prod --github-client-id Ov23li…
axis secret put ADMIN_TOKEN   # comments empty [vars] ADMIN_TOKEN, deploys, then sets secret
axis secret put EXTERNAL_BACKEND
axis deploy all
axis keys create              # --admin-token / AXIS_ADMIN_TOKEN / prompt
axis health --scripts --oauth
# Paste Worker URL + pn_… into Settings → Script storage
ItemGuidance
GITHUB_OAUTH_CLIENT_IDPublic OAuth App id; Device Flow enabled on GitHub; env wins over body clientId
GITLAB_OAUTH_CLIENT_IDSame for GitLab when using git storage
ADMIN_TOKEN / EXTERNAL_BACKENDPrefer axis secret put. An empty [vars] stub collides with secrets (Cloudflare 10053)
API_KEYS KVaxis setup kv then axis deploy worker. D1 without KV fails closed (API_KEYS_REQUIRED)
ALLOW_OPEN_KEYS"0" in production
REQUIRE_RUN_AUTH"1" to force Bearer on /api/run even without KV
Worker scriptworker-axis (https://worker.axis.hoox.sh)
Pages projectaxis (https://axis.hoox.sh)

Env overrides

VariableRole
AXIS_ROOTForce monorepo root
AXIS_WORKER_URLDefault health / deploy probe URL
AXIS_ADMIN_TOKENAdmin token for axis keys create
AXIS_API_KEYDefault key for axis keys validate
CLOUDFLARE_API_TOKENNon-interactive Wrangler auth
AXIS_CLI_SRC=1Load src/ instead of dist/

Internals

PathRole
packages/cli/bin/axis.jsBin entry (Bun)
packages/cli/src/commands/*Commander handlers (install, doctor, setup, keys, deploy, secrets, health, dev, whoami)
packages/cli/src/services/wrangler-toml.tsToml vars, D1 id, KV binding upsert
packages/cli/src/services/health.ts/health + OAuth probes
Root package.json axis / axis:* scriptsConvenience wrappers
Root Makefile axis / axis-*Make wrappers

See also: Installation, Cloudflare® deployment, Worker bindings, Worker auth, packages/cli/README.md.