CLI cheat sheet
This page lists the netscript commands you use most, grouped by task, in their everyday form.
Together with the command reference, which has every flag, subcommand,
and extended verb, it covers every public command group and direct subcommand. The
@netscript/cli package page documents the embeddable TypeScript API.
Every command here uses the public netscript <cmd> form from the published JSR package. The
vendored packages/cli/... path you may see in a local-source checkout is for contributors only.
Install
The CLI is published to JSR as @netscript/cli. Install it globally to get a netscript command
on your PATH, or run it without installing.
# Installs a `netscript` command on your PATH
deno install --global --allow-all --name netscript jsr:@netscript/cli@0.0.9
netscript --help# Run the same CLI without installing anything
deno x jsr:@netscript/cli@0.0.9 --help# Re-run the install with --force to pull the latest published version
deno install --global --allow-all --force --name netscript jsr:@netscript/cli@0.0.9netscript --version prints the installed CLI version. netscript --help and
netscript <group> --help, for example netscript db --help, show the exact flags your installed
version ships.
The everyday flow
Most sessions follow the same order. Aspire (step 2) must be up before any db command (step 3).
- Scaffold.
netscript initlays down the whole workspace: contracts, an example service, plugins, and the Aspire layer. - Orchestrate.
cd aspire && aspire startbrings up your database and Redis and opens the dashboard at the URL Aspire prints. - Prepare the database. Run
netscript db init,generate,migrate, orseed. - Extend. Run
netscript plugin install, thennetscript generate pluginsto wire the registry.
Mutation and regeneration map
Check this map before you run a command that writes. “Source of truth” is the declaration the
command owns. You can delete generated artifacts and rebuild them from it, unless the row says the
command creates workspace-owned source. Don't assume every mutating command accepts --dry-run;
the “Preview” column says which ones do.
| Command | Source of truth mutated | Generated artifacts | Runtime consumers | Preview |
|---|---|---|---|---|
netscript init |
New workspace choices and root configuration | Entire workspace, app/service/plugin/database skeletons, Aspire graph | Deno tasks, Fresh app, services, plugin runtimes, Aspire | --dry-run |
netscript tokens init |
App-owned DTCG sources, semantic override and tokens.config.json |
None until build | Token builder | No; existing files require --force |
netscript tokens build |
None | Five core web assets under assets/ and 24 optional stylesheets under static/presets/ |
Fresh root, CSS and design routes | No; validates before writes |
netscript tokens clean |
None | Removes the generated token assets and preview stylesheets, keeping theme-preset.json |
Rebuild before running the app | No |
netscript config set |
Generated aspire/appsettings.json value |
None beyond the configuration write | AppHost generator and resources reading the setting | No |
netscript contract add / netscript contract add-route |
Workspace-owned versioned contract source | Version aggregate exports | Service handlers, SDK clients, OpenAPI/RPC routers | No |
netscript contract version add / netscript contract remove |
Versioned contract source | Version and root aggregate exports | Service and SDK imports | No |
netscript service add / netscript service set / netscript service remove |
Service workspace plus aspire/appsettings.json |
Contract aggregates, optional apps/<app>/lib/<service>.ts via --with-client, and Aspire helper files |
AppHost resource graph, typed callers | No |
netscript service ref add / netscript service ref remove |
Caller ServiceReferences in aspire/appsettings.json |
Aspire helper files | AppHost environment/reference injection | No |
netscript db add / netscript db remove |
Database target configuration and workspace membership | Aspire configuration and AppHost helpers | Prisma tasks, services, Aspire resources | No |
netscript db init / netscript db migrate |
Prisma schema and migration history | Migration directories and generated client inputs | Prisma engine and application repositories | No; database operation |
netscript db generate |
Prisma schema, including plugin contributions | Prisma client and Zod output | Services, plugins, repositories | No |
netscript plugin install / netscript plugin update / netscript plugin remove |
Plugin dependency and host registration | Workspace glue, plugin registries, Aspire helpers | AppHost and plugin service/runtime discovery | install --dry-run; others no |
netscript generate plugins |
Installed plugin manifests and project source | .netscript/generated plugin registries |
Plugin host and generated imports | --dry-run |
netscript generate runtime-schemas |
Runtime topic declarations | Runtime-config JSON Schema files | Editors, validators, runtime override tooling | --dry-run |
netscript generate aspire |
None; reads authored root appsettings.json and project config |
AppHost helper files and .netscript/aspire-cli.ts |
Aspire AppHost and telemetry tasks | --check --format json (read-only parity) |
netscript ui:init / netscript ui:add |
Registry selection | Workspace-owned components, pages, islands, styles, and tokens | Fresh app and its Vite build | No |
netscript ui:remove page <path> |
Unchanged ui:add page (formatting accepted) and its generated router registration | Removed page/loader/island; refreshed route manifest and routes | Fresh app and route consumers | --dry-run |
netscript ui:migrate variants |
App-owned 0.0.8 UI component and style copies | Formatted component and CSS edits using data attributes | Fresh app | --dry-run |
netscript ui:update / netscript ui:remove |
Installed registry inventory and unmodified copied files | Updated or removed copy-source UI files | Fresh app and its Vite build | No |
netscript deploy build / target plan |
Deployment manifest plus project entrypoints | Target deployment artifacts or an emitted plan | Target runtime or service manager | plan is non-deploying |
netscript deploy up / deploy install / lifecycle verbs |
Deployment target or service-manager state | Provider/service-manager state; target-dependent local artifacts | Deployed services | Target-dependent; check --help |
Read commands (list, get, inspect, status, logs, doctor) are omitted because they don't
change project or provider state. Commands that call an external database or cloud provider say so
in the last column, because a filesystem-only --dry-run can't model those effects safely.
Scaffold a workspace
| Name · Type | Description |
|---|---|
Create a workspacenetscript init my-app |
Scaffold everything — contracts, plugin registry, Fresh app, a default Redis cache, and the Aspire layer. On a terminal it prompts for whatever you omit (name, database, service, cache). |
Preview firstnetscript init my-app --dry-run |
Print every file and directory the scaffold would create, and write nothing. |
Fully specified, no promptsnetscript init my-app --db postgres --service --service-name users --yes |
Postgres database support, an example oRPC users service on its assigned port, defaults for the rest. --yes accepts defaults, --ci is non-interactive; both engage automatically when stdin is not a terminal. |
Pick a database enginenetscript init my-app --db postgres |
postgres (recommended), mysql, mssql, sqlite, or none — the default is no database unless you pass --db. |
Skip Aspirenetscript init my-app --no-aspire |
Scaffold without the Aspire footprint; start the Fresh app directly with deno task --cwd apps/dashboard dev. |
Tune the rest--cache-backend garnet · --model-name Product · --path ./apps · --editor zed |
Cache backend (redis default, garnet, or app-level deno-kv; --cache=false for none), the Prisma model name for the scaffolded CRUD surface, the target directory, and editor settings. |
Every init flag — including --app-name, --no-git, --force, --json, and
--from <preset> and --preset <code-or-url> — is spelled out in the command reference.
Aspire orchestration CLI
Run these Aspire CLI (13.5.3) commands from inside the aspire/ folder:
| Name · Type | Description |
|---|---|
Restore SDKaspire restore |
Download and restore the AppHost SDK modules (run once per workspace and after SDK bumps). |
Start resource graphaspire start |
Boot the database, cache, services, and dashboard. Flags: --isolated (random ports/secrets), --format Json (structured output). |
List running AppHostsaspire ps --format Json |
List running AppHost instances, their dashboard URLs (which may carry an auth token), and their log paths as machine-readable JSON. |
Describe resourcesaspire describe (alias: aspire resources) |
Show detailed status, health, and endpoints for all registered AppHost resources. |
Stop AppHostaspire stop [--force] |
Gracefully shut down the AppHost; pass --force to stop the AppHost and clean up persistent resources. |
Search Aspire docsaspire docs api search <query> --language typescript |
Query the Aspire documentation CLI for TypeScript and AppHost API references. |
Select a pinned Aspire executable
Set NETSCRIPT_ASPIRE_CLI to the executable name or path of your pinned Aspire toolchain. When it
is unset or empty, NetScript uses aspire. The generated aspire:otel and aspire:export tasks use
it for the primary command and for the aspire ps dashboard fallback. NetScript's database
operation executor and netscript agent init use the same variable.
The value is one executable, not a shell command with arguments. To go through a version manager, create an executable wrapper:
#!/bin/sh
exec mise exec -- aspire "$@"Make it executable with chmod +x tools/aspire-pinned, then run from the workspace root:
export NETSCRIPT_ASPIRE_CLI="$PWD/tools/aspire-pinned"
deno task aspire:otel -- traces users
An absolute path also works in non-interactive shells that don't activate the version manager.
Direct aspire commands and the aspire:start tasks still use your shell's PATH.
netscript generate aspire refreshes the generated helper; don't hand-edit
.netscript/aspire-cli.ts. The command also regenerates the AppHost helpers from the root
appsettings.json. It doesn't rewrite the root deno.json, and it refuses a workspace scaffolded
with --no-aspire. Plugin install, update, and remove, and service add and remove, regenerate this
helper too.
Existing workspace tasks with --allow-run=aspire --allow-read keep using aspire after
regeneration, even in non-interactive runs: the helper reads the override only when env permission
is already granted, and otherwise defaults to aspire without prompting. Update an existing
workspace's two telemetry task grants only when you adopt the override:
{
"aspire:otel": "deno run --allow-run --allow-env=NETSCRIPT_ASPIRE_CLI --allow-read .netscript/aspire-cli.ts otel",
"aspire:export": "deno run --allow-run --allow-env=NETSCRIPT_ASPIRE_CLI --allow-read .netscript/aspire-cli.ts export"
}
These two tasks may run any executable, so that they can run the override. Their environment
access is limited to NETSCRIPT_ASPIRE_CLI.
Run & iterate
These are workspace deno task commands, not netscript subcommands. They make up the daily loop
once the scaffold exists.
| Name · Type | Description |
|---|---|
Orchestrate everythingcd aspire && aspire start |
Bring up the database, Redis, services, and plugin processors, with the dashboard at the URL Aspire prints. |
Run the dashboard alonedeno task --cwd apps/dashboard dev |
Start the Fresh frontend directly (or let aspire start orchestrate it). |
Run a service alonedeno task --cwd services/users dev |
Start the example users oRPC service on its assigned port. |
Check, lint, testdeno task check · deno task lint · deno task fmt · deno task test |
Type-check, lint, format, and test the whole workspace. |
Services & contracts
A NetScript workspace is contract-first: you define an oRPC contract, then a service implements it.
| Name · Type | Description |
|---|---|
Add a servicenetscript service add --name orders --port 3002 --with-client |
Add a service workspace member, its v1 contract, the Aspire registration, and apps/ |
Add a contractnetscript contract add catalog-items |
Create contracts/versions/v1/catalog-items.contract.ts from the oRPC contract template and regenerate the v1 aggregate exports. |
Add a route + handlernetscript contract add-route · netscript service add-handler |
Append a typed procedure to a contract, then bind it with a compiling service handler stub. |
See what existsnetscript service list · netscript contract list · netscript contract inspect <name> |
List services, list contract modules per version (and whether each has a services/<name>/ directory, a filesystem check that does not prove a handler is registered), and inspect a contract's procedures and schemas. |
Regenerate Aspire helpersnetscript service generate |
Regenerate the Aspire helper files from your service configuration. |
The full groups — service set / remove / ref add, contract remove /
version add, and every flag — are in the command reference.
Plugins
Plugins add capabilities such as background workers, durable sagas, webhook triggers, durable streams, and authentication. A public install adds the plugin package as a dependency, emits workspace-owned glue that imports it, and registers its contributions. The plugin's internals stay in the installed dependency.
| Name · Type | Description |
|---|---|
Install an official pluginnetscript plugin install workers --name workers |
Bare aliases (workers, auth, …), scoped specs (@netscript/plugin-workers), and jsr: specs all work. After auth, pick the runtime backend with NETSCRIPT_AUTH_BACKEND — see add authentication. |
Wire the registrynetscript generate plugins |
Regenerate the plugin registries from project source. Run this after every plugin install. |
Check healthnetscript plugin list · netscript plugin doctor · netscript plugin info workers |
List registered plugins, run the wiring sanity check, and show a single plugin's details. |
Author your ownnetscript plugin new billing |
Scaffold a new two-tier plugin: a JSR-publishable core package plus a thin connector. See author a plugin. |
Discover & maintainnetscript marketplace search <query> · netscript plugin update <name> · netscript plugin remove <name> |
Search the plugin marketplace, re-pin and regenerate an installed plugin, or remove one and update workspace registration. |
Configure the AI pluginnetscript plugin ai <verb> [...args] |
Configure AI tools, agents, models, providers, and MCP servers. A pass-through: every argument after the verb is forwarded verbatim to the installed @netscript/plugin-ai CLI, so its verbs are documented by that plugin, not here. Only --project-root is consumed by NetScript. |
The extended verbs — plugin sync, enable / disable / setup, item-add, and the
plugin auth backend/provider/session subcommands — are in the
command reference.
App-owned browser authentication
Auth installation defaults to the generated BFF topology. If an app already owns its backend,
session routes, and authentication bridge, set this in appsettings.json before you install auth or
regenerate helpers:
{
"NetScript": {
"Apps": {
"web": { "Auth": { "BrowserTopology": "authored" } }
}
}
}
BrowserTopology accepts scaffold, the default when omitted, or authored. With authored,
plugin installation and lifecycle reconciliation skip that app's /auth action route and
service-session example routes, and neither create nor replace its browser helpers. A plain
netscript generate aspire run also preserves the authored files, including when they are absent.
netscript plugin doctor reports the app as using an authored browser topology. That report states
ownership; it doesn't verify your authentication implementation.
Only browser apps (Type: "app", including an omitted Type) select browser topology. Task, Tauri,
and desktop entries do not cause shared helpers to be created alongside an authored browser app.
Workspaces with no browser apps retain the legacy helper generation behavior.
In a multi-app workspace, browser apps using scaffold still receive the shared auth/bff.ts and
auth/service.ts helpers. A scaffold-owned service policy still receives its bearer verifier and
auth/service.ts; an authored service policy remains authoritative independently of the app
setting. Switching to authored preserves existing generated files; remove unwanted files only
after your own topology replaces their callers. See the
0.0.8 cookie migration.
Database
The database workflow uses Prisma with the Deno runtime. Every command below needs Aspire running
first, except with the file-backed sqlite engine. The same generate and migrate pass picks up
plugin schemas (workers, sagas, triggers, and auth with the better-auth backend). The
database & migration how-to walks through the workflow.
| Name · Type | Description |
|---|---|
Initialize + first migrationnetscript db init --name init |
Initialize database tooling and create the named migration. |
Generate the clientnetscript db generate |
Generate the Deno-runtime Prisma client (and zod) — including plugin schemas such as auth.prisma when the auth backend is better-auth. |
Migrate & seednetscript db migrate · netscript db seed |
Apply migrations (including each plugin's contributed schema), then run the workspace seed scripts. |
Inspectnetscript db status · netscript db studio |
Show migration/tooling status, or open the database studio for browsing data. |
Recovernetscript db introspect · netscript db reset |
Introspect the configured database, or reset it back to a clean state. |
Multiple databasesnetscript db add <engine> · netscript db list |
Add a second database workspace to an existing project and list registered targets. |
The scaffolded workspace also defines deno task db:* tasks (db:generate, db:migrate,
db:seed, db:studio, …) inside database/<engine>/. They run Prisma directly, without Aspire;
use them in Deno-only or CI jobs. The target-management and migration-history verbs (db deploy,
validate, resolve, remove) are in the command reference.
Generate
After you add or change plugins or configuration, regenerate the artifacts the project consumes.
| Name · Type | Description |
|---|---|
Fresh routesnetscript generate routes |
Rebuild .generated/manifest.ts and .generated/routes.ts from route files without a Vite build. Select with --app or an explicit app --project-root. |
Plugin registriesnetscript generate plugins |
Regenerate the plugin registries from project source — the post-install step. |
Runtime config schemasnetscript generate runtime-schemas |
Generate JSON Schema files for runtime configuration topics. |
Aspire helpersnetscript generate aspire |
Regenerate the Aspire AppHost helpers from appsettings.json without re-scaffolding. |
netscript config inspect, get, and set read and write the resolved project configuration,
and netscript config override manages versioned runtime overrides. The
command reference has the full subcommand table.
Fresh UI
The frontend is copy-source: the CLI copies components into your repository under
apps/dashboard, and you own and edit that code. See
customize Fresh UI.
| Name · Type | Description |
|---|---|
Initialize the design systemnetscript ui:init --project-root apps/dashboard |
Copy the fresh-ui components and tokens into the dashboard app. |
Add a componentnetscript ui:add <item> --project-root apps/dashboard |
Copy an additional registry item — you own the copied source from that point. |
Remove pagenetscript ui:remove page <path> |
Validate unchanged page/loader/island output (formatting accepted), remove its router entry and rebuild derived routes. Preview with --dry-run; select --app or --project-root and --client when needed. Authored files are preserved; customized scaffolds are refused. |
Migrate older UI copiesnetscript ui:migrate variants --project-root apps/dashboard --dry-run |
Preview the 0.0.8 modifier migration. Omit --dry-run to apply it, then run the app check. Run netscript ui:migrate to see available migrations. |
List & maintainnetscript ui:list · netscript ui:update · netscript ui:remove <name> |
List registry items, update only files you have not modified, or remove a copied item. |
Deploy
Deploy covers several paths: the Deno Deploy cloud target, the OS service (Servy) path,
the container and cloud targets routed through Aspire, and two packaging verbs for shipping a
binary. Start with netscript deploy list, which prints every registered target and the operations
it advertises. Deploy explains portability.
| Name · Type | Description |
|---|---|
Discover targetsnetscript deploy list [--json] |
List every registered deploy target with its label and advertised operations. --json emits machine-readable descriptors. |
Deno Deploy: preflightnetscript deploy deno-deploy plan |
Run the unstable-API guard (scans for Deno.openKv, Deno.cron, BroadcastChannel, Temporal) without pushing. The same guard blocks up --prod on a violation; a preview push warns but proceeds. |
Deno Deploy: lifecyclenetscript deploy deno-deploy up [--prod] · down · status · logs |
Push, delete, and inspect the deployment. A thin router over the native deno deploy CLI — it must be on your PATH and handles authentication. |
OS service: buildnetscript deploy build |
Compile services and generate the deployment artifacts from a deployment manifest via Servy. |
OS service: lifecyclenetscript deploy install · start · stop · status · logs · upgrade · uninstall |
Register, run, inspect, upgrade, and remove OS services from the manifest. |
Containers: Docker & Composenetscript deploy docker <verb> · netscript deploy compose <verb> |
Aspire-backed container targets. Both expose plan · up · down · status · logs — the bare group prints help, as every command group does, but the verbs run against a real adapter. |
Cloud targetsnetscript deploy kubernetes · azure-aca · azure-app-service · azure-aks · cloud-run |
Aspire-backed cloud targets, each exposing plan · up · down. See the command reference for why their verb list is shorter. |
Package a desktop appnetscript deploy desktop package · netscript deploy desktop release |
Package an enabled desktop app into native Deno Desktop formats for the host OS/arch by default (or an explicit target), and prepare, sign, and serve a native release. |
Package the CLInetscript deploy package-cli |
Compile the NetScript CLI into a self-shippable Windows .exe. Flags: -o, --output-dir <dir> (default ./.deploy/windows), --target <triple> (default x86_64-pc-windows-msvc), --no-bundle, -v, --verbose. |
The shared flags (--org, --app, --entrypoint, --env-file, --project-root), the
per-target verb flags, and the artifact-copy verbs are in the
command reference.
Agent tooling
These commands install and run the NetScript tooling for coding agents.
| Name · Type | Description |
|---|---|
Install agent toolingnetscript agent init |
Install NetScript MCP, consumer tools, and skills. Use --editor none|zed|vscode to apply editor-native setup to a new or existing project; one existing editor directory is detected by default. Use --host claude|vscode|opencode|all for agent hosts (detected from project markers, then the invoking environment, when omitted) and --with-docs for the exact-version offline corpus. |
Run the MCP servernetscript agent mcp |
Start the NetScript MCP server over standard input/output. |
Record driftnetscript agent drift record --resource <name> --summary <text> |
Record an evidence-gated drift note after a fresh successful diagnostic pass. The record is rejected unless the evidence for --resource is present on disk, so it cannot be written from memory. --details <text> is optional. |
See Agent tooling for the mental model.
Install a Figma theme
Use a downloaded Figma theme item hosted as JSON to configure an existing app with
netscript ui:apply --preset https://raw.githubusercontent.com/owner/themes/main/themes/studio-utility.json,
or scaffold and apply it with
netscript init my-app --preset https://raw.githubusercontent.com/owner/themes/main/themes/studio-utility.json --yes.
The source files and fresh-ui.lock.json stay in the app; later token builds keep the imported
values. The complete command reference defines URL validation, preset
JSON, source ownership and local-edit refusal.