nextsheet-cli
v0.5.0
Published
NextSheet CLI — build, dev, and deploy spreadsheet apps.
Downloads
1,901
Readme
@nextsheet/cli
CLI for the NextSheet framework — build, preview, and deploy spreadsheets as code.
npm install -g @nextsheet/cli
# or use without installing
npx nextsheet <command>Commands
nextsheet build
Compile one or more .sheet.tsx files into a spreadsheet output.
nextsheet build <files...> [options]
Options:
-t, --target <target> csv | xlsx | supersheet (default: csv)
-o, --out <path> Output file path
-n, --name <name> Workbook name (default: Workbook)Examples:
# Single sheet → CSV
nextsheet build sheets/Report.sheet.tsx --target csv --out dist/report.csv
# Single sheet → Excel
nextsheet build sheets/Report.sheet.tsx --target xlsx --out dist/report.xlsx
# Multiple sheets → one workbook
nextsheet build sheets/Invoices.sheet.tsx sheets/Expenses.sheet.tsx \
--target xlsx --name "Finance 2026" --out dist/finance.xlsx
# For SuperSheet hosting
nextsheet build sheets/*.sheet.tsx --target supersheet
# → creates nextsheet.output.json at project rootnextsheet dev
Start a live browser preview (default localhost:3000). Watches for file changes and hot-reloads the page automatically.
nextsheet dev <files...> [options]
Options:
-p, --port <port> Port (default: $PORT from the environment or `.env.local`, then 3000)
-n, --name <name> Workbook namenextsheet dev sheets/Report.sheet.tsx
nextsheet dev sheets/*.sheet.tsx --name "Finance 2026" --port 4000
# or set PORT=4000 in .env.local (loaded before the server starts)The preview renders a fully formatted spreadsheet in the browser — sheet tabs, column headers, cell formatting, section titles — and reloads instantly on every save. Build errors appear as a toast without losing the last good preview.
nextsheet deploy
Deploy a workbook directly to SuperSheet via the Supabase REST API.
nextsheet deploy <files...> [options]
Options:
-t, --target <target> supersheet (default)
-n, --name <name> Workbook name
--supabase-url <url> Supabase project URL
--anon-key <key> Supabase anon key
--jwt <token> Your session JWT
--workbook-id <id> Update an existing workbookUsing environment variables (recommended):
export SUPABASE_URL=https://xxxx.supabase.co
export SUPABASE_ANON_KEY=eyJhbGci...
export SUPABASE_JWT=eyJhbGci...
nextsheet deploy sheets/*.sheet.tsx --name "Finance 2026"
# → Deployed → workbook ID: abc123
# Update an existing workbook
nextsheet deploy sheets/*.sheet.tsx --workbook-id abc123Getting your JWT from the browser:
// Open DevTools → Console on your SuperSheet tab
JSON.parse(
localStorage.getItem(
Object.keys(localStorage).find(k => k.endsWith('-auth-token'))
)
).access_tokenHow it works
The CLI uses esbuild to transpile .sheet.tsx files at runtime — no separate build step, no ts-node or tsx required. Each file is bundled with the nextsheet core, written to a temp file, and dynamic-imported. This means you can run nextsheet build directly against TypeScript source.
Related
License
MIT
