@gasboost/cli
v0.3.11
Published
Developer tooling for the Gasboost ecosystem
Maintainers
Readme
@gasboost/cli
Developer-facing command entry point for the gasboost ecosystem.
Install:
pnpm add -D @gasboost/cliThe CLI coordinates developer tooling around a gasboost project.
Its responsibilities include:
- command routing
- loading project configuration
- opening the gasboost console
- loading application TypeScript modules
- generating RTDB Security Rules
- filesystem output
- diagnostics
- process exit status
Commands
Project Console
Open the local project console:
gasboost console openGenerated projects normally expose:
{
"scripts": {
"console": "gasboost console open"
}
}so the console can be opened with:
pnpm consoleTo avoid automatically opening the browser:
gasboost console open --no-browserThe browser UI itself is implemented by @gasboost/console.
The CLI is responsible for starting it and connecting it to the current project.
Console operations are registered operations with structured input. The browser is not given an arbitrary local shell endpoint.
RTDB Security Rules
Generate Firebase Realtime Database Security Rules:
gasboost rtdb rulesConfiguration is read from:
gasboost.config.tsCanonical configuration:
import { defineGasboostConfig } from "@gasboost/config";
export default defineGasboostConfig({
firebase: {
realtimeDatabase: {
source: "./src/backend/lib/rtdb.ts",
out: "./database.rules.json",
},
},
});The legacy:
rtdb: {
source: "...",
out: "...",
}shape is normalized for compatibility, but new projects should use:
firebase.realtimeDatabaseProject Configuration
gasboost.config.ts is loaded through @gasboost/config.
It represents the gasboost Project Definition / Desired State rather than CLI-specific preferences.
gasboost.config.ts
↓
@gasboost/config
↓
@gasboost/cliThe canonical config API is:
import { defineGasboostConfig } from "@gasboost/config";@gasboost/cli also re-exports config types for compatibility, but project documentation should use @gasboost/config directly.
RTDB Definition
The module configured by:
firebase.realtimeDatabase.sourcemust export rtdb.
For example:
import { FirebaseRtdb } from "@gasboost/realtime-firebase";
import { itemsTable } from "../../shared/tables";
import { itemsRls } from "./rls";
export const rtdb = FirebaseRtdb.generate({
tables: [itemsTable] as const,
rowLevelSecurity: [itemsRls],
principal: {
userId: "auth.uid",
},
});The CLI loads the module and invokes:
rtdb.rules()The resulting rules are written to the configured output.
For example:
database.rules.jsonTypeScript Module Loading
The CLI uses jiti to load application TypeScript modules.
This allows project modules to use the project's normal TypeScript configuration, including path aliases.
Example:
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}Application code can continue to use:
import { something } from "@/something";The application does not need to rewrite imports just for gasboost CLI execution.
Responsibility Boundaries
@gasboost/cli does not implement Firebase authorization compilation or the console UI itself.
For RTDB rules:
@gasboost/realtime-firebase
├─ RLS projection
├─ authorization layout
├─ runtime path generation
├─ projectability validation
└─ Security Rules generation
@gasboost/cli
├─ config load
├─ TypeScript module load
├─ command routing
├─ filesystem output
├─ diagnostics
└─ exit codeFor the project console:
@gasboost/cli
↓
start / route command
@gasboost/console
↓
gasboost-specific lifecycle UI + operations
@gasboost/console-runtime
↓
generic localhost operation runtimeRequirements
- Node.js 24+
- pnpm
License
MIT
