@tacobase/cli
v0.1.4
Published
CLI tool for managing tacobase instances
Maintainers
Readme
npm install -g @tacobase/cliQuick start
taco login # Authenticate
taco init my-app --template next # Scaffold a new project
cd my-app && npm install
taco dev --with-app # Postgres + dev server, one command🌮 Wrapped. You're building.
Table of Contents
- taco login
- taco init
- taco dev
- taco typegen
- taco status
- taco logs
- taco seed
- taco doctor
- taco dashboard
- Configuration
- Framework templates
- Troubleshooting
taco login
Authenticate with tacobase. Opens a browser session to sign in.
taco loginYour auth token is stored in ~/.taco/config.json. Sign in once, taco forever.
taco init
Scaffold a new tacobase project. Creates a cloud instance, generates your API key, and optionally sets up a framework template.
taco init my-project # Interactive template picker
taco init my-app --template next # Next.js + App Router
taco init my-app --template react # React + Vite
taco init my-app --template vue # Vue
taco init my-app --template svelte # SvelteWhat happens:
- Creates a tacobase instance in the dashboard
- Generates an API key (
tbk_...) - Writes
.env.localwithTACOBASE_URLandTACOBASE_API_KEY - Scaffolds your project with the selected framework template
Options:
-t, --template <template>— Framework template (next,react,vue,svelte)
taco dev
Spins up a local Postgres instance via Docker. Your database, local, zero config.
taco dev # Postgres on :5432
taco dev --with-app # Postgres + npm run dev
taco dev --run "vite" # Postgres + custom app command
taco dev -p 9090 --run "vite" # Custom port + custom commandWhat it does:
- Starts a
postgres:16Docker container namedtacobase-dev-postgres - Prints your local
DATABASE_URL - Injects
DATABASE_URLandDATABASE_URL_UNPOOLEDinto your app process - Tears everything down on
Ctrl+C— clean exit, no leftovers
Options:
-p, --port <port>— Postgres port (default:5432)-a, --with-app— Also runnpm run dev-r, --run <command>— Custom command to start your app
Prerequisite: Docker Desktop must be installed and running.
taco typegen
Generate TypeScript types from your live collection schemas. Run once, get autocomplete forever.
taco typegen # → ./src/types/tacobase.ts
taco typegen --output ./types/db.ts # Custom output path
taco typegen --watch # Auto-regenerate on schema changes
taco typegen --watch --interval 10 # 10-second poll intervalExample output:
export interface PostsRecord extends BaseRecord {
title: string;
content: string;
author: string;
published: boolean;
}
export type CollectionName = 'posts' | 'users' | 'comments';Comes with a typed db instance — zero extra setup:
import { db } from './src/types/tacobase'
const posts = await db.collection('posts').getList(1, 20)
// ^-- autocomplete ^-- PostsRecord[]
posts.items[0].title // ✓ typedOptions:
-o, --output <path>— Output file path (default:./src/types/tacobase.ts)-i, --instance <id>— Instance ID (defaults to current project)-w, --watch— Watch for schema changes and regenerate--interval <seconds>— Poll interval in watch mode (default:5)
taco status
Check what's cooking with your current project.
taco status
taco status --instance <instance-id>Options:
-i, --instance <id>— Instance ID (defaults to current project)
taco logs
Tail your project logs. Great for watching things go sideways in real time.
taco logs # Last 100 lines
taco logs --tail 50 # Last 50 lines
taco logs --follow # Stream in real-time
taco logs --instance <id> # Specific projectOptions:
-n, --tail <lines>— Number of lines (default:100)-f, --follow— Stream logs in real-time-i, --instance <id>— Instance ID
taco seed
Seed your collections with data. Point at a file, run it, done.
taco seed # Auto-detects tacobase.seed.{ts,js,json}
taco seed --file ./data/seed.json # Explicit file
taco seed --reset # Wipe existing data first, then seed
taco seed --reset --file seed.tsOptions:
-f, --file <path>— Path to seed file-r, --reset— Clear existing data before seeding-i, --instance <id>— Instance ID
taco doctor
Runs diagnostic checks. Something's not working? Start here.
taco doctor
taco doctor --instance <id>taco dashboard
Open your project dashboard in the browser.
taco dashboard
taco dashboard --instance <instance-id>Configuration
Stored in ~/.taco/config.json:
{
"authToken": "your-auth-token",
"currentInstance": "inst_abc123",
"instances": {
"inst_abc123": {
"id": "inst_abc123",
"name": "my-project",
"url": "https://my-project.tacobase.dev",
"apiKey": "tbk_abc123..."
}
}
}Framework templates
Next.js
App Router, TypeScript, @tacobase/client and @tacobase/react pre-wired.
taco init my-app --template next
cd my-app && npm install && npm run devReact (Vite)
React + Vite + TypeScript, tacobase ready to go.
taco init my-app --template react
cd my-app && npm install && npm run devIncludes @tacobase/client, @tacobase/react, src/tacobase.ts, and .env pre-filled.
Vue, Svelte — coming soon 🌮
Troubleshooting
"You must be logged in" → Run taco login.
"No instance found" → Run taco init or pass --instance <id>.
"Docker not found" / "Docker daemon is not running" → Install Docker Desktop and make sure it's running before taco dev.
Types not updating → Run taco typegen after modifying collection schemas. Or run with --watch so it stays current automatically.
Related packages
| Package | Description |
|---|---|
| @tacobase/client | Core SDK — CRUD, auth, realtime, storage |
| @tacobase/react | React hooks — useAuth, useCollection, useRealtime |
| @tacobase/taco | Drop-in AI context — installs client + writes TACOBASE.md |
| @tacobase/mcp-server | MCP server — let your AI manage schema via natural language |
tacobase.dev · docs · github · issues
License
MIT
