CLI Reference
Complete command reference for the Neutrino CLI (`nno`).
CLI Reference
The Neutrino CLI (nno) provides namespaced commands for platform management and feature development.
nno <namespace> <command> [options]Installation
pnpm add -g @neutrino-io/clinno --versionAuthentication
Core commands — not namespaced.
nno login
Authenticate with the Neutrino platform.
nno login
nno login --token <api-token>| Flag | Alias | Type | Description |
|---|---|---|---|
--token | -t | string | Neutrino API token for CI/non-interactive use |
Notes:
--tokenstores credentials immediately and is intended for CI pipelines.- Interactive login is being rolled out as an OAuth 2.0 device-authorization flow against the NNO IAM service. On the current build it prints guidance and exits cleanly; see
nno loginfor the planned device-flow walkthrough.
Credentials are written atomically to ~/.nno/credentials.json (mode 0600). Use nno whoami to confirm and nno logout to clear.
Examples:
# CI / non-interactive
nno login --token $NNO_API_TOKENnno logout
Sign out from the Neutrino platform by clearing the stored credentials file.
nno logoutNo flags.
nno whoami
Display the currently authenticated user, platform, and role.
nno whoamiNo flags.
Example output:
i Authenticated as developer@acme.com
i Platform: r4xk9m2zt5
i Role: platform-adminWarns if no credentials are stored or if the token has expired.
Project Management
Commands for local development, building, validation, and deployment of a Neutrino platform project. These commands operate locally against Wrangler and Vite — no Neutrino auth required.
nno project check
Validate project config for the target environment.
nno project check
nno project check --env stg| Flag | Alias | Type | Default | Description |
|---|---|---|---|---|
--env | -e | string | local | Target environment: local, dev, stg, or prod |
Checks performed:
| ID | Check | Severity |
|---|---|---|
| P01 | wrangler.toml exists for each service | Error |
| P02 | [env.<target>] section defined in wrangler.toml (non-local) | Error |
| P03 | No placeholder D1 IDs (local-dev-db, REPLACE_WITH_REAL_ID) in non-local env | Error |
| P04 | PLATFORM_ID and TENANT_ID are valid 10-char [a-z0-9] NanoIDs | Error |
| P05 | VITE_AUTH_API_URL present in env file | Warning |
| P06 | Wrangler CLI available; prompts to verify secrets | Warning/Info |
Exit codes: 0 success, 2 errors found.
Example:
nno project check --env stg
✓ P01 wrangler.toml found (auth, billing)
✓ P02 [env.stg] defined in all service configs
✓ P03 D1 IDs populated (no placeholders)
✓ P04 PLATFORM_ID=r4xk9m2zt5, TENANT_ID=n7wp3fy8q1
⚠ P05 VITE_AUTH_API_URL not set in .env.stg
0 errors, 1 warning(s) — project is deployable with caveatsnno project dev
Start all Neutrino services for local development using concurrently.
nno project devNo flags.
Starts the following services in parallel:
| Service | Command |
|---|---|
iam | NODE_ENV=development wrangler dev |
registry | NODE_ENV=development wrangler dev |
billing | NODE_ENV=development wrangler dev |
provisioning | NODE_ENV=development wrangler dev |
stack-registry | NODE_ENV=development wrangler dev |
cli-svc | NODE_ENV=development wrangler dev |
gateway | NODE_ENV=development wrangler dev |
console | pnpm dev |
All services are killed if any one exits (success or failure).
nno project build
Build the console shell for the target environment.
nno project build
nno project build --env prod| Flag | Alias | Type | Default | Description |
|---|---|---|---|---|
--env | -e | string | stg | Target environment: stg or prod |
Runs pnpm --filter console build --mode <env>. Output goes to apps/console/dist/.
Example:
nno project build --env prod
# → Building console for env: prod
# ✓ Build complete → apps/console/dist/nno project deploy
Deploy the platform console to Cloudflare Pages via the Neutrino CLI Service.
nno project deploy <platform-id>
nno project deploy <platform-id> --env prod| Argument | Type | Required | Description |
|---|---|---|---|
platform-id | positional | Yes | Platform ID to deploy |
| Flag | Type | Default | Description |
|---|---|---|---|
--env | string | dev | Target environment: dev, stg, or prod |
Calls POST /api/v1/platforms/<platform-id>/deploy on the Neutrino CLI Service and polls for deployment completion (up to 5 minutes). Reads NNO_CLI_SERVICE_URL and NNO_CLI_API_KEY from environment variables.
Example:
nno project deploy r4xk9m2zt5 --env stg
# Triggering deployment for platform r4xk9m2zt5 (stg)...
# Deployment started: dep_9x2m4k7p1q
# URL: https://r4xk9m2zt5-stg.pages.dev
# Polling for completion...
# Status: deploy — success
# Deployment completeFeature Development
Commands for scaffolding, developing, testing, validating, and submitting feature packages.
nno feature init
Scaffold a new feature package.
nno feature init <name>
nno feature init analytics --no-service
nno feature init crm --dir ./packages/crm| Argument | Type | Required | Description |
|---|---|---|---|
name | positional | Yes | Feature name in kebab-case |
| Flag | Type | Default | Description |
|---|---|---|---|
--no-service | boolean | false | Skip Hono service scaffold |
--dir | string | ./<name> | Target output directory |
Generates the full feature scaffold:
<name>/
├── src/
│ ├── feature.ts ← FeatureDefinition
│ ├── routes/index.tsx ← Page component
│ └── index.tsx ← Package entry
├── nno.config.ts
├── package.json
├── tsconfig.json
├── README.md
└── service/ ← Hono Worker (omitted with --no-service)
├── src/index.ts
└── wrangler.toml.templateExample:
nno feature init analytics
# cd analytics
# pnpm install
# nno feature devnno feature dev
Start the local feature development environment.
nno feature dev
nno feature dev --no-service
nno feature dev --platform r4xk9m2zt5 --env stg| Flag | Type | Default | Description |
|---|---|---|---|
--no-service | boolean | false | Skip starting the Wrangler service |
--platform | string | — | Connect to a real Neutrino platform by ID |
--env | string | dev | Target environment when using --platform: dev or stg |
Default mode starts the Neutrino Mock Shell at localhost:5100 and the feature Vite dev server at localhost:5180. With --platform, the mock shell connects to the real Neutrino auth service.
Port assignments:
| Process | Default Port |
|---|---|
| Neutrino Mock Shell | 5100 |
| Feature Vite dev | 5180 |
| Feature Wrangler service | 8790 |
nno feature test
Run feature tests with Vitest.
nno feature test
nno feature test --watch
nno feature test --coverage
nno feature test --service-only
nno feature test --ui-only| Flag | Type | Default | Description |
|---|---|---|---|
--watch | boolean | false | Watch mode |
--coverage | boolean | false | Generate coverage report |
--service-only | boolean | false | Run service tests only |
--ui-only | boolean | false | Run UI tests only |
nno feature build
Build the feature package for distribution using tsup.
nno feature build
nno feature build --analyze| Flag | Type | Default | Description |
|---|---|---|---|
--analyze | boolean | false | Analyze bundle size (passes --metafile to tsup) |
Output goes to dist/.
nno feature validate
Validate a feature package for Neutrino compatibility. Must pass before nno feature submit.
nno feature validate
nno feature validate ./packages/analytics| Argument | Type | Required | Description |
|---|---|---|---|
path | positional | No | Path to feature package (default: .) |
Validation checks:
| ID | Rule | Severity |
|---|---|---|
| V01 | package.json exists | Error |
| V02 | package.json has "neutrino": {"type": "feature"} | Error |
| V03 | featureManifest is exported from src/index.ts | Error |
| V04 | TypeScript compiles without errors | Error |
| V05 | Permission keys follow {featureId}:{action} format | Error |
Exit codes: 0 all checks passed, 1 one or more checks failed.
Example:
nno feature validate
# Validating feature at /projects/analytics...
#
# ✓ package.json exists
# ✓ package.json has "neutrino": {"type": "feature"}
# ✓ exports featureManifest
# ✓ TypeScript compiles without errors
# ✓ Permission keys follow {featureId}:{action} format
#
# Result: 5 passed, 0 failednno feature submit
Authorship policy (current): feature authorship is restricted to Neutrino. Per ADR-006, the Neutrino platform does not accept client-submitted feature packages today; the
nno featurecommands are intended for Neutrino contributors. External users should activate the Neutrino-authored feature catalogue via stack templates instead.
Submit the feature package for distribution.
nno feature submit
nno feature submit --message "Initial submission"
nno feature submit --private
nno feature submit --dry-run| Flag | Alias | Type | Default | Description |
|---|---|---|---|---|
--message | -m | string | — | Submission message |
--private | — | boolean | false | Private submission (not listed publicly) |
--dry-run | — | boolean | false | Prepare bundle without uploading |
Requires authentication (nno login) and a passing nno feature validate.
nno feature status
Authorship policy (current): restricted to Neutrino contributors per ADR-006. The submission pipeline is internal to Neutrino.
Check submission status.
nno feature status
nno feature status <submission-id>| Argument | Type | Required | Description |
|---|---|---|---|
id | positional | No | Submission ID to query (omit to list all pending) |
Statuses: PENDING → IN_REVIEW → APPROVED | REJECTED
Plugin System
The Neutrino CLI uses a plugin-based namespace registry. Each domain (project, feature) is a self-contained NnoPlugin registered at startup.
NnoPlugin interface (packages/cli/src/types.ts):
import type { SubCommandsDef } from "citty";
export interface NnoPlugin {
/** Namespace name — becomes the top-level subcommand (e.g. 'project'). */
name: string;
/** Short description shown in `nno --help`. */
description?: string;
/** Citty subcommands for this namespace. */
commands: SubCommandsDef;
}Authoring an external plugin:
import { definePlugin, registerPlugin } from "@neutrino-io/cli/plugin";
import { defineCommand } from "citty";
export const analyticsPlugin = definePlugin({
name: "analytics",
description: "Analytics management commands",
commands: {
report: defineCommand({
meta: { name: "report", description: "Generate analytics report" },
async run() {
// ...
},
}),
},
});
// Register before runMain in your entry point
registerPlugin(analyticsPlugin);Built-in namespaces: project, feature, doctor, platform, setup.
Exit Codes
| Code | Meaning |
|---|---|
0 | Success |
1 | General error (network, auth, unexpected) |
2 | Validation / check failure |
3 | Build failure |
4 | Submission rejected by server |
Environment Variables
| Variable | Used by | Description |
|---|---|---|
NNO_CLI_SERVICE_URL | nno project deploy | Neutrino CLI Service base URL (default: http://localhost:8787) |
NNO_CLI_API_KEY | nno project deploy | API key for the Neutrino CLI Service |
Credentials are stored in ~/.nno/credentials.json after nno login.