Skip to content

vk dev

Terminal window
vk dev [options]
OptionDescriptionDefault
-s, --stage <stage>Stage namedev
-p, --port <port>Server port3000
--no-watchDisable file watching / hot reloadwatch enabled

Starts a fully local development server. No AWS credentials or cloud resources required.

  • Discovers routes from your routesDir and serves them via HTTP
  • Starts Docker Compose services for infrastructure (Postgres, Redis, MinIO)
  • Converts HTTP requests to Lambda-compatible APIGatewayProxyEventV2 events
  • Loads TypeScript handlers at runtime (no build step needed)
Terminal window
# Start with defaults (port 3000)
vk dev
# Custom port
vk dev --port 8080
# Custom stage
vk dev --stage my-feature
  • Docker running (for database, cache, and storage services)
  • VentureKit project with vk.config.ts
  • Dependencies installed (npm install)

No AWS credentials are needed for local development.

  1. Loads vk.config.ts using runtime TypeScript transpilation (via jiti)
  2. Registers your project’s infrastructure intents in the shared registry (~/.vk/projects.json)
  3. Generates a shared docker-compose.yml at ~/.vk/ (one Postgres, one Redis, one MinIO for all projects)
  4. Starts Docker services automatically if not already running
  5. Discovers routes, functions, queues, and crons from your project
  6. Starts a local queue processor and cron scheduler
  7. Serves requests locally, converting them to Lambda event format
  8. Route handlers are loaded on-demand — edit a file and the next request uses the new code

All services run at standard ports. Multiple projects share the same containers — databases and buckets are isolated by project-prefixed names.

Infrastructure IntentLocal ServicePort
databases (postgres)PostgreSQL 165432
cachesRedis 76379
queuesRedis 7 (shared with caches)6379
storageMinIO9000 (API), 9001 (Console)
ToolPortCommand
Database viewer8081vk open db
Storage browser9001vk open storage
Queue & cache monitor5540vk open queues
Cron statusvk open crons

invoke() from @venturekit/runtime works locally out of the box. When VENTURE_LOCAL=true, invoke calls are routed to the local dev server via HTTP instead of AWS Lambda.

  • Route invocation: invoke('users/list') calls GET http://localhost:3000/users
  • Function invocation: invoke({ function: 'process-orders' }) calls POST http://localhost:3000/_dev/invoke/process-orders

Queue handlers in src/queues/ are discovered and processed automatically. The local queue processor:

  • Polls for new messages every 500ms
  • Retries failed messages up to 3 times with exponential backoff
  • Moves failed messages to a local dead-letter queue
  • Delivers messages in SQS-compatible event format

Enqueue messages via HTTP: POST /_dev/queue/{name} with a JSON body.

View queue stats: GET /_dev/queues

Cron handlers in src/crons/ run on a timer during local development. By default, each cron runs every 60 seconds. The cron scheduler delivers EventBridge-compatible scheduled events.

View cron status: GET /_dev/crons

EndpointMethodDescription
/_dev/invoke/{name}POSTInvoke a standalone function
/_dev/invoke/queue/{name}POSTInvoke a queue handler directly
/_dev/invoke/cron/{name}POSTInvoke a cron handler directly
/_dev/queue/{name}POSTEnqueue a message
/_dev/queuesGETQueue stats and DLQ
/_dev/cronsGETCron job status
/_dev/functionsGETList all discovered handlers