@purista/cli
v3.0.1
Published
cli helper for PURISTA backend framework
Readme
@purista/cli
@purista/cli is the canonical PURISTA CLI engine. It supports:
- interactive human usage
- non-interactive shell and CI execution
- programmatic access for scripts and agents
- local blueprint-driven project generation without cloning
starter
Create a new project:
npx @purista/cli initOr use the dedicated wrapper:
npm create purista@latestScaffold artifacts inside an existing PURISTA project:
purista add service user --description "User service"
purista add command sign-up --service user --service-version 1 --description "Register a user"
purista add queue process-jobs --service user --service-version 1 --description "Background jobs"
purista add agent triage --service user --service-version 1 --description "Review tickets"Generated agents use the core-native PURISTA agent builders from @purista/core. Live model providers stay app-level dependencies; add provider packages such as @purista/harness-openai only when the generated application binds real models at runtime.
Non-interactive mode fails fast when a required value has no declared default:
purista add service user --description "User service" --non-interactive
purista init my-app --defaults --non-interactiveProgrammatic usage:
import { runPuristaCommand } from '@purista/cli'
await runPuristaCommand(
'add-service',
{ name: 'user', description: 'User service' },
{ cwd: process.cwd(), mode: 'programmatic' },
)Project creation can also be planned and materialized directly:
import { planProjectGeneration, materializeProjectGeneration } from '@purista/cli'
const plan = planProjectGeneration({
target: 'my-app',
projectName: 'my-app',
runtime: 'node',
eventBridge: 'default',
useWebserver: true,
fileConvention: 'camel',
eventConvention: 'dotCase',
linter: 'biome',
formatter: 'biome',
type: 'module',
packageManager: 'npm',
installDependencies: false,
})
await materializeProjectGeneration(plan)Generated tests import the public testing helpers from @purista/core:
createCommandContextMock(...)for command handler testscreateSubscriptionContextMock(...)for subscription handler testscreateStreamTestHarness(...)for runtime stream testscreateQueueWorkerTestHarness(...)for runtime queue worker testscreateAgentTestHarness(...)andcreateScriptedHarnessModel(...)for agent runtime tests
Visit purista.dev
Follow on Twitter @purista_js
Join the Discord Chat
