PURISTA API / @purista/cli
@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:
bash
npx @purista/cli initOr use the dedicated wrapper:
bash
npm create purista@latestScaffold artifacts inside an existing PURISTA project:
bash
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:
bash
purista add service user --description "User service" --non-interactive
purista init my-app --defaults --non-interactiveProgrammatic usage:
ts
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:
ts
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
Classes
Interfaces
Type Aliases
- AddPuristaQueueInput
- AddPuristaQueueWorkerInput
- BasePromptRequest
- BlueprintId
- ConfirmPromptRequest
- EnqueueOption
- ExampleServiceGeneratorStep
- InputPromptRequest
- Locale
- OutputAdapter
- ProjectBlueprint
- ProjectBlueprintContext
- ProjectBlueprintContribution
- ProjectConfigPatch
- ProjectFileContribution
- ProjectGenerationPlan
- ProjectGeneratorStep
- ProjectSnapshot
- PromptAdapter
- PromptAnswerMap
- PromptChoice
- PromptRequest
- PuristaCliEngineOptions
- PuristaCommandContext
- PuristaCommandId
- PuristaCommandIssue
- PuristaCommandMode
- PuristaCommandResolution
- PuristaCommandResult
- PuristaConfig
- PuristaExecutableCommand
- PuristaFileMutation
- PuristaProjectInfo
- PuristaProjectServices
- QueueProducerOptions
- QueueWorkerOptions
- ResolvedProjectBlueprints
- SelectPromptRequest
- ServiceVersionSnapshot
Variables
Functions
- addPuristaAgent
- addPuristaCommand
- addPuristaQueue
- addPuristaQueueWorker
- addPuristaService
- addPuristaStream
- addPuristaSubscription
- camelCase
- capitalCase
- constantCase
- convertToProjectFileCasing
- createAmqpConfigFile
- createBiomeConfigFile
- createDaprConfigFile
- createEntrypointFile
- createEslintCommonJsConfigFile
- createEslintModuleConfigFile
- createEventBridgeFile
- createGitIgnoreFile
- createHttpConfigFile
- createHttpFile
- createMqttConfigFile
- createNatsConfigFile
- createProjectSnapshot
- createPublicIndexHtml
- createPuristaCliEngine
- createReadmeFile
- createServiceEventEnumFile
- dotCase
- getCommandBuilderFileContent
- getCommandSchemaFileContent
- getCommandTestFileContent
- getCommandTypeFileContent
- getGeneralServiceConfigFileContent
- getQueueBuilderFileContent
- getQueueSchemaFileContent
- getQueueTestFileContent
- getQueueTypeFileContent
- getQueueWorkerBuilderFileContent
- getQueueWorkerTestFileContent
- getServiceBuilderFileContent
- getServiceConfigFileContent
- getServiceFileContent
- getServiceTestFileContent
- getStreamBuilderFileContent
- getStreamSchemaFileContent
- getStreamTestFileContent
- getStreamTypeFileContent
- getSubscriptionBuilderFileContent
- getSubscriptionSchemaFileContent
- getSubscriptionTestFileContent
- getSubscriptionTypeFileContent
- kebabCase
- loadPuristaConfig
- materializeProjectGeneration
- noCase
- pascalCase
- pascalSnakeCase
- pathCase
- planProjectGeneration
- resolveProjectBlueprints
- resolvePuristaCommand
- runPuristaCommand
- scanPuristaProject
- sentenceCase
- snakeCase
- split
- splitSeparateNumbers
- trainCase
