@saas-maker/cli
v0.1.1
Published
API-first CLI for SaaS Maker.
Readme
@saas-maker/cli
API-first CLI for SaaS Maker.
The CLI is intentionally minimal: a few core utility commands plus a universal saasmaker api executor so new backend features do not require new CLI code.
Install
npm install -g @saas-maker/cli
# or use directly:
npx @saas-maker/cliQuick Start
saasmaker login
saasmaker init
saasmaker doctorCore Commands
saasmaker login— browser OAuth loginsaasmaker init— link current directory to a projectsaasmaker whoami— show token + linked project contextsaasmaker keys— show session token + linked project keysaasmaker projects list|create— project managementsaasmaker status— feature health/count snapshotsaasmaker doctor— configuration + auth diagnosticssaasmaker examples— copy-paste command recipessaasmaker completions [bash|zsh|fish]— shell completion scriptsaasmaker api <method> <path>— universal API access
Universal API Command
saasmaker api <method> <path> [options]Auth Modes
--auth sessionusesAuthorization: Bearer <token>fromlogin--auth projectusesX-Project-Keyfrom linked.saasmaker.json--auth auto(default) attaches whichever auth context is available--auth nonesends no auth
Output / Scripting
--output json|table--select field1,field2(supports dotted paths)--quiet(suppresses request/status logs)--raw(compact JSON for scripts)
Request Options
--body '{...json...}'--body-file ./payload.json--query key=value(repeatable)--header key=value(repeatable)--token <token>/--project-key <key>override stored credentials
OpenAPI Enforcement
saasmaker api validates method/path against OpenAPI by default.
- Bypass for experimental routes:
--no-validate - Spec source used by CLI:
packages/cli/src/openapi.json - Published docs artifact:
apps/docs/public/openapi.json - Regenerate from route files:
pnpm generate:openapiThis also updates docs/openapi/openapi.json.
API-First Recipes
# Health
saasmaker api GET /health --auth none
# Session-auth route: projects
saasmaker api GET /v1/projects --auth session --output table
# Project-auth route: list feedback
saasmaker api GET /v1/feedback --auth project --query type=feature --output table
# Create feedback
saasmaker api POST /v1/feedback --auth project \
--body '{"title":"Bug","description":"Broken CTA","submitter_email":"[email protected]","type":"bug"}'
# Create short link
saasmaker api POST /v1/links --auth project \
--body '{"destination":"https://example.com","title":"Homepage"}'
# Dashboard forms (session route)
saasmaker api GET /v1/forms/dashboard/<projectId> --auth session --output table
# Approve testimonial (session route)
saasmaker api PATCH /v1/testimonials/<testimonialId> --auth session \
--query project_id=<projectId> --body '{"status":"approved"}'Configuration
Global config: ~/.saasmaker/config.json
{
"apiKey": "sm_...",
"apiBaseUrl": "https://api.saasmaker.dev"
}Project config: .saasmaker.json
{
"slug": "my-app",
"projectId": "uuid-project-id",
"projectKey": "pk_..."
}Backward compatibility: older .saasmaker.json files that stored only projectId as a pk_... key are still supported.
Environment variable
SAASMAKER_API_URL— override API base URL
