Entrypoints@notation/factory-cli

@notation/factory-cli

@notation/factory-cli provides the factory executable. It runs on Bun:

 add -g @notation/factory-cli
Command groupPurpose
factory infra *Reconcile factory.infra.ts and inspect deliveries
factory repo *Subscribe repositories and inspect FACTORY_STATUS
factory container *Attach to remote outpost containers (resume, ssh)

See CLI Reference for all commands and flags.

Credentials

The CLI has two kinds of credential, with separate jobs:

CredentialUsed for
Local provider credentials (Wrangler login or CLOUDFLARE_API_TOKEN; RAILWAY_API_TOKEN; gh; account secrets such as CLAUDE_CODE_OAUTH_TOKEN)The hub's lifecycle: factory infra up and factory infra down create, update and delete it, and write secrets to its vault
Operator auth (github.OperatorAuth or cloudflare.OperatorAuth)Everything that talks to the running hub: factory infra status, factory infra replay, and the router calls up and down make

The CLI keeps each hub's admin session in ~/.config/notation-factory/sessions.json until it expires, after 4 hours. The CLI never reads a hub secret back. Deploy writes each secret's value from a credential: a source, such as an environment variable, or the resource that issued it, such as a GitHub App. See Secrets.

factory.config.ts

Load local credentials for every command:

factory.config.ts
export default {
  loadEnv: "./with-env.sh",
  router: "https://acme--prod--router-1a2b3c4d.acme.workers.dev",
};

Read from the infrastructure repository root before any factory command runs:

FieldBehavior
loadEnvCommand prefix run once at startup; factory adopts the environment it sets before pre-flight checks
routerThe URL of the hub's router, which factory infra status and factory infra replay call. factory infra up prints it when it creates the router

.factory/config.ts

Name the hub that an outpost subscribes to:

.factory/config.ts
export default {
  hub: { app: "acme", stage: "prod" },
  repo: "acme/webapp",
};

Read by the factory repo commands, beside .factory/infra.ts. The deployer doesn't read it:

FieldBehavior
hubThe hub's Notation app and stage, which name its GitHub Apps. factory repo install needs it
repoThe outpost's repo, as owner/name, when the origin remote doesn't name it