@orizm/cli
v3.0.0
Published
Orizm CLI
Readme
@orizm/cli
The command-line interface for Orizm. It talks to the Developer API using either
an OAuth2 Bearer token or a Developer Key, covering everything from pushing schema
definitions and generating SDK types to managing projects, keys, users, content,
buckets, and webhooks. Commands follow a noun-first layout: orizm <noun> <verb>.
Installation
npm install -g @orizm/cli
# or as a devDependency
npm install -D @orizm/cliThe bin name is orizm.
Quick start
orizm auth login # Log in via OAuth2 (opens your browser)
orizm link # Pick an organization and project, writing .orizm/project.json
orizm schema push # Push orizm.config.ts to the server
orizm codegen cms # Generate CMS SDK typesAuthentication
OAuth2 login (Authorization Code + PKCE) is the default. Tokens are stored in
~/.config/orizm/auth.json (%APPDATA%/orizm/auth.json on Windows).
orizm auth login
orizm auth status
orizm auth logoutFor CI and automation, use API-key authentication. Automatic .env loading has
been removed in v3. Pass ORIZM_API_KEY explicitly as an environment variable.
- run: orizm schema push --yes
env:
ORIZM_API_KEY: ${{ secrets.ORIZM_API_KEY }}To keep using a .env file locally, wrap the command with dotenv-cli or direnv.
dotenv -e .env -- orizm schema pushWhen both an OAuth2 token and ORIZM_API_KEY are present, the OAuth2 token wins.
Environment variables
| Variable | Purpose | Default |
| ------------------------ | -------------------------------------------------------------------------------------------------- | ------------------------ |
| ORIZM_BASE_URL | Developer API base URL (switch between local / staging / production) | https://app.orizm.com |
| ORIZM_OAUTH_ISSUER_URL | OAuth2 issuer URL. Set this only when the auth server runs on a different host/port (e.g. locally) | same as ORIZM_BASE_URL |
| ORIZM_PROJECT | Project context (lower priority than --project and .orizm/project.json) | (unset) |
| ORIZM_API_KEY | Developer Key auth, used as a fallback when no OAuth2 token is present | (unset) |
| ORIZM_DEBUG | Enables debug logging (same as --debug) | (unset) |
Project context
The target project is resolved in this order:
--project <name>flagORIZM_PROJECTenvironment variableprojectNamein.orizm/project.json(created byorizm link)
orizm link interactively selects an organization and project, writes
.orizm/project.json, and on first use offers to add .orizm/ to .gitignore.
Commands
Commands are noun-first: orizm <noun> <verb>. The available nouns are auth,
link, org, project, schema, codegen, key, project-user, content,
bucket, and webhook.
Global flags available on every command:
--json— emit structured JSON--debug— write debug logs to stderr--no-color— disable colored output (also respectsNO_COLOR)
See the Orizm CLI reference for the full list.
Schema definition (@orizm/cli/config)
Write orizm.config.ts with defineConfig:
import { defineConfig } from "@orizm/cli/config";
export default defineConfig({
tables: {
/* ... */
},
});Migrating from v2
v3 contains breaking changes: the move to OAuth2 authentication, removal of
automatic .env loading, project context via .orizm/project.json, and renamed
commands. See the v2 → v3 migration guide.
For developers
Build the npm package
pnpm run build