Skip to main content

Configuration

The pikku.config.json file configures how the Pikku CLI scans your codebase and generates files.

Minimal Configuration

{
"tsconfig": "./tsconfig.json",
"srcDirectories": ["src"],
"outDir": ".pikku"
}

Core Options

OptionTypeRequiredDescription
tsconfigstringPath to TypeScript configuration file
srcDirectoriesstring[]Directories to scan for Pikku functions and wirings
outDirstringWhere generated files are written (default: .pikku)
rootDirstringRoot directory for resolving paths (default: config file directory)
extendsstringPath to another pikku.config.json to inherit from
ignoreFilesstring[]Glob patterns to skip (default: ["**/*.test.ts", "**/*.spec.ts", "**/node_modules/**", "**/dist/**"])
globalHTTPPrefixstringPrefix prepended to all HTTP routes (e.g., /api/v1)
$schemastringJSON schema URL for editor autocomplete

Client Generation

Client files can be specified under a clientFiles object. When set, the corresponding pikku <command> generates a type-safe client at that path.

{
"clientFiles": {
"fetchFile": "sdk/pikku-fetch.gen.ts",
"websocketFile": "sdk/pikku-websocket.gen.ts",
"rpcWiringsFile": "sdk/pikku-rpc.gen.ts",
"queueWiringsFile": "sdk/pikku-queue.gen.ts",
"mcpJsonFile": "sdk/pikku-mcp.gen.json",
"nextBackendFile": "pikku-nextjs.ts",
"nextHTTPFile": "pikku-nextjs-http.ts"
}
}
KeyCLI CommandDescription
fetchFilepikku fetchType-safe HTTP fetch client
websocketFilepikku websocketType-safe WebSocket client
rpcWiringsFilepikku rpcRPC client wrappers
queueWiringsFilepikku queue-serviceQueue service wrapper
mcpJsonFileMCP server JSON manifest
nextBackendFilepikku nextjsNext.js backend integration
nextHTTPFilepikku nextjsNext.js HTTP route handler
Legacy format

You can also specify these at the top level (e.g., "fetchFile": "..." instead of "clientFiles": { "fetchFile": "..." }). The clientFiles object is recommended because paths inside it are resolved relative to the config file directory.

Scaffold

The scaffold section controls where pikku new puts generated files and which features are enabled.

{
"scaffold": {
"pikkuDir": "src/pikku",
"functionDir": "src/functions",
"wiringDir": "src/wirings",
"middlewareDir": "src/middleware",
"permissionDir": "src/permissions",
"addonDir": "packages/addons",
"rpc": "auth",
"console": "no-auth",
"agent": "auth",
"workflow": "auth"
}
}
OptionTypeDescription
pikkuDirstringDirectory for auto-generated scaffold files (RPC endpoints, agent endpoints, console functions, workflow routes)
functionDirstringWhere pikku new function puts files
wiringDirstringWhere pikku new wiring puts files
middlewareDirstringWhere pikku new middleware puts files
permissionDirstringWhere pikku new permission puts files
addonDirstringWhere pikku new addon puts addon packages

Feature flags — set via pikku enable <feature> or directly in config:

OptionValuesDescription
rpc"auth" | "no-auth" | falseGenerate public RPC endpoint
console"auth" | "no-auth" | falseGenerate console functions
agent"auth" | "no-auth" | falseGenerate public agent endpoints
workflow"auth" | "no-auth" | falseGenerate workflow routes

AI Agents

Configure model aliases and defaults for AI agents.

{
"models": {
"fast": "openai/gpt-4o-mini",
"smart": { "model": "anthropic/claude-sonnet-4-20250514", "temperature": 0.7, "maxSteps": 10 }
},
"agentDefaults": {
"temperature": 0.5,
"maxSteps": 5
},
"agentOverrides": {
"my-agent": { "model": "openai/gpt-4o", "temperature": 0.3 }
}
}
OptionTypeDescription
modelsRecord<string, string | object>Named model aliases. Value is either a model string (provider/model) or { model, temperature?, maxSteps? }
agentDefaultsobjectDefault temperature and maxSteps for all agents
agentOverridesRecord<string, object>Per-agent overrides for model, temperature, maxSteps

Workflows

{
"workflows": {
"orchestratorQueue": "pikku-workflow-orchestrator",
"workerQueue": "pikku-workflow-worker"
}
}
OptionTypeDescription
orchestratorQueuestringCustom queue name for workflow orchestration
workerQueuestringCustom queue name for workflow step execution

CLI Entrypoints

Configure CLI tools built with Pikku's CLI wiring.

{
"cli": {
"entrypoints": {
"my-cli": [
{ "type": "local", "path": "src/cli-local.ts" },
{
"type": "channel",
"wirePath": "src/cli-channel.ts",
"name": "cli",
"route": "/cli"
}
],
"simple-cli": "src/simple-cli.ts"
}
}
}

Each entrypoint can be:

  • A string — path to the wiring file
  • { type: "local", path } — direct command-line execution
  • { type: "channel", wirePath, name?, route?, path? } — remote execution via WebSocket
  • An array of the above for multiple execution modes

Deploy

Configure deployment providers and settings.

{
"deploy": {
"providers": {
"cloudflare": "@pikku/deploy-cloudflare",
"aws": "@pikku/deploy-serverless"
},
"defaultProvider": "cloudflare",
"serverlessIncompatible": ["heavy-compute-function"]
}
}
OptionTypeDescription
deploy.providersRecord<string, string>Map of provider names to adapter packages
deploy.defaultProviderstringDefault provider for pikku deploy commands
deploy.serverlessIncompatiblestring[]Function names that can't run in serverless (routed to server fallback)

Addon Mode

When building a reusable addon package, set addon to enable addon-specific codegen.

{
"addon": true
}

Or with metadata for the addon registry:

{
"addon": {
"displayName": "Slack Integration",
"description": "Slack API functions for Pikku",
"categories": ["Communication"],
"icon": "slack-icon.svg"
}
}

OpenAPI Generation

{
"openAPI": {
"outputFile": "openapi.yml",
"additionalInfo": {
"info": {
"title": "My API",
"version": "1.0.0",
"description": "API documentation"
},
"servers": [
{ "url": "https://api.example.com", "description": "Production" }
],
"securitySchemes": {},
"security": []
}
}
}

Schema Options

{
"schema": {
"additionalProperties": false,
"supportsImportAttributes": true
}
}
OptionTypeDefaultDescription
additionalPropertiesbooleanfalseAllow extra properties in generated JSON schemas
supportsImportAttributesbooleantrueUse import attributes for schema imports (TypeScript 5.3+)

Monorepo Support

{
"packageMappings": {
"packages/sdk": "@my-app/sdk",
"packages/functions": "@my-app/functions"
}
}

Maps local directory paths to published package names so generated imports use the package name instead of relative paths.

Filtering

Permanently filter which functions are included in codegen output. These are the config-file equivalent of the CLI --tags, --types, etc. flags.

{
"filters": {
"tags": ["api", "public"],
"types": ["http", "rpc"],
"directories": ["src/api"]
}
}

Linting

Configure lint rules for the inspector:

{
"lint": {
"servicesNotDestructured": "warn",
"wiresNotDestructured": "error"
}
}
RuleValuesDescription
servicesNotDestructured"off" | "warn" | "error"Warn when functions don't destructure services
wiresNotDestructured"off" | "warn" | "error"Warn when functions don't destructure wires

Advanced Options

OptionTypeDescription
forceRequiredServicesstring[]Service names that must always be available, even if not detected
schemasFromTypesstring[]Additional type names to generate schemas for
verboseMetabooleanInclude extra metadata in generated JSON files

Example Configurations

{
"tsconfig": "./tsconfig.json",
"srcDirectories": ["src"],
"outDir": ".pikku",
"globalHTTPPrefix": "/api",
"clientFiles": {
"fetchFile": "sdk/pikku-fetch.gen.ts",
"websocketFile": "sdk/pikku-websocket.gen.ts"
},
"scaffold": {
"pikkuDir": "src/pikku",
"rpc": "auth",
"agent": "auth",
"workflow": "auth"
},
"models": {
"fast": "openai/gpt-4o-mini",
"smart": "anthropic/claude-sonnet-4-20250514"
},
"deploy": {
"providers": {
"cloudflare": "@pikku/deploy-cloudflare"
},
"defaultProvider": "cloudflare"
}
}

Next.js Application

{
"tsconfig": "./tsconfig.json",
"srcDirectories": ["./backend"],
"outDir": "./backend/.pikku",
"clientFiles": {
"nextBackendFile": "./pikku-nextjs.ts"
}
}

Monorepo with Shared SDK

{
"tsconfig": "./tsconfig.json",
"srcDirectories": ["packages/functions/src"],
"outDir": "packages/functions/.pikku",
"clientFiles": {
"fetchFile": "packages/sdk/pikku-fetch.gen.ts",
"websocketFile": "packages/sdk/pikku-websocket.gen.ts"
},
"packageMappings": {
"packages/sdk": "@my-app/sdk",
"packages/functions": "@my-app/functions"
}
}

Config Inheritance

Base config (pikku.config.base.json):

{
"tsconfig": "./tsconfig.json",
"srcDirectories": ["src"],
"outDir": ".pikku"
}

Extended config (pikku.config.json):

{
"extends": "./pikku.config.base.json",
"filters": {
"tags": ["public"],
"types": ["http"]
}
}

Next Steps