2026-05-11 00:45:43 -07:00
---
title: "ktx dev"
2026-05-13 12:00:08 +02:00
description: "Low-level project initialization and runtime management."
2026-05-11 00:45:43 -07:00
---
2026-05-14 01:43:06 +02:00
`ktx dev` contains development-only project initialization and managed runtime commands. Context building lives at the root as [`ktx ingest`](/docs/cli-reference/ktx-ingest).
2026-05-11 00:45:43 -07:00
2026-05-11 16:43:08 -07:00
## Command signature
2026-05-11 00:45:43 -07:00
```bash
ktx dev <subcommand> [options]
```
## Subcommands
| Subcommand | Description |
|-----------|-------------|
| `init [directory]` | Initialize a Git-backed KTX project directory |
2026-05-13 12:28:24 +02:00
| `runtime` | Install, start, stop, and inspect the KTX-managed Python runtime |
2026-05-11 00:45:43 -07:00
2026-05-13 12:00:08 +02:00
## `dev init`
2026-05-11 00:45:43 -07:00
| Flag | Description | Default |
|------|-------------|---------|
| `--name <name>` | Project name written to `ktx.yaml` | — |
| `--force` | Rewrite `ktx.yaml` and scaffold files in an existing project | `false` |
2026-05-13 12:00:08 +02:00
## `dev runtime`
2026-05-13 12:28:24 +02:00
`ktx dev runtime` supports `install`, `start`, `stop`, and `status`.
2026-05-11 00:45:43 -07:00
| Flag | Description | Default |
|------|-------------|---------|
2026-05-13 12:28:24 +02:00
| `--feature <feature>` | Runtime feature level for `install` and `start` (`core` or `local-embeddings`) | `core` |
2026-05-13 12:00:08 +02:00
| `--json` | Print JSON output for `status` | `false` |
2026-05-13 12:28:24 +02:00
| `--yes` | Confirm runtime install actions where supported | `false` |
2026-05-12 23:51:46 +02:00
| `--force` | Reinstall or restart where supported | `false` |
2026-05-11 00:45:43 -07:00
## Examples
```bash
ktx dev init
ktx dev init ./my-project --name "Analytics Context"
ktx dev init --force
2026-05-13 12:00:08 +02:00
ktx dev runtime install --yes
ktx dev runtime status
2026-05-12 23:51:46 +02:00
ktx dev runtime start
2026-05-13 12:00:08 +02:00
ktx dev runtime stop
2026-05-11 00:45:43 -07:00
```
2026-05-11 16:43:08 -07:00
## Common errors
| Error | Cause | Recovery |
|-------|-------|----------|
2026-05-13 12:00:08 +02:00
| Runtime status reports missing pieces | Packages, Python environment, or linked CLI are not ready | Run `pnpm install`, `pnpm run setup:dev`, `uv sync --all-groups`, then `ktx dev runtime status` |
| Runtime daemon does not start | The managed Python runtime is missing or stale | Run `ktx dev runtime install --yes`, then `ktx dev runtime start` |