Quickstart
From nothing to a running NetScript workspace you can watch boot — in about five
minutes. Three commands: install the CLI, scaffold a project, then bring it
up under Aspire, which starts Postgres and a shared cache (redis by default, or garnet / deno-kv via --cache-backend) for you before anything else
and hands you a real dashboard, distributed traces, and a handful of example routes
on the very first run.
1. Install the CLI
The CLI is published to JSR as @netscript/cli. Install it globally for a tidy
netscript command, or run it ad-hoc with no install at all.
# Installs a `netscript` command on your PATH
deno install --global --allow-all --name netscript jsr:@netscript/cli@0.0.1-alpha.12
netscript --help
# Run the same CLI without installing anything
deno x jsr:@netscript/cli@0.0.1-alpha.12 --help
2. Scaffold a workspace
One command lays down the whole opinionated workspace — a Fresh 2 app, shared oRPC contracts, a plugin registry, and the Aspire orchestration layer:
netscript init my-app --db postgres
You'll see a banner, a creating step, and a success summary with numbered next steps. It looks like this:
╔═════════════════════════════════════════════════════════════╗
║ NetScript — Scaffold New Project ║
╚═════════════════════════════════════════════════════════════╝
📁 Creating project "my-app"...
✅ Project scaffolded successfully in 1.4s
Created: 47 files, 12 directories
Next steps:
1. cd my-app
2. cd aspire # TS AppHost lives here, isolated from the Deno workspace
3. aspire restore # download TypeScript AppHost SDK modules (run once)
4. aspire start # start TypeScript AppHost
If you see that success line and the numbered steps, the scaffold worked. The exact file count and the next steps adapt to the options you chose (a database, an example service, and so on) — on the strict happy path above, the four steps are sufficient.
3. Start it
Follow the next steps the CLI just printed. The Aspire TypeScript AppHost lives in
its own aspire/ folder, isolated from the Deno workspace; restore its modules once,
then run it. This is the step that actually starts your stack — Postgres, Redis,
and every wired service come up together:
cd my-app/aspire
aspire restore # one-time: downloads the AppHost SDK modules
aspire start # boots Postgres + Redis + services, opens the dashboard
See the framework code
The scaffold is more than bash and URLs — it generates real, typed framework code
for you. Here's the kind of code the scaffold writes: a single defineService call
wires the cross-cutting concerns so you don't have to. Your RPC procedures are then
served under /api/rpc/*.
import { defineService } from '@netscript/service';
import { router } from './router.ts';
// One call wires CORS, request logging, OpenAPI, RPC (/api/rpc/*), and health.
const service = await defineService(router, { name: 'users', port: 3001 });
# oRPC procedures are served under /api/rpc/*
curl http://localhost:3001/api/rpc/users/list
# Health and OpenAPI come for free
curl http://localhost:3001/health
What you see
Once aspire start settles, you have a live workspace to poke at:
- The Aspire dashboard at http://localhost:18888 — every resource (Postgres, Redis, your services), its health, logs, and distributed traces in one place.
- The Fresh app at http://localhost:8000 — your
frontend, served by the
dashboardapp. - The
/designroute — a living token-and-component showcase: the--ns-*design tokens, the fresh-ui components copied into your repo, and composition examples. Click a token to copy it. - The
/examplesroutes — runnable end-to-end paths:/examples/crud,/examples/service, and/examples/telemetry, plus a/healthcheck.
You now have
A complete, type-checked workspace — not a starter you have to assemble:
A Fresh 2 frontend and the Aspire dashboard, wired together with health, logs, and traces from line one.
Aspire stands up the database (Postgres by default; or mysql / mssql / sqlite via --db) and cache for you — no docker-compose to babysit, no connection strings to copy.
Shared, versioned oRPC contracts and a plugin registry ready for workers, sagas, triggers, auth, and streams.
fresh-ui components copied into your repo under apps/dashboard — the code is yours to change.