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 12:53:55 -04:00
`ktx dev` contains low-level project initialization and managed Python runtime
commands. Context building lives at the root as
[`ktx ingest`](/docs/cli-reference/ktx-ingest). Most users should start with
`ktx setup`; use `ktx dev` when preparing local fixtures, checking the bundled
runtime, or debugging runtime state.
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 |
|-----------|-------------|
2026-05-14 12:53:55 -04:00
| `init [directory]` | Initialize a Git-backed KTX project directory for maintenance scripts |
| `schema` | Print a JSON Schema describing `ktx.yaml` |
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 |
|------|-------------|---------|
| `--force` | Rewrite `ktx.yaml` and scaffold files in an existing project | `false` |
2026-05-14 12:53:55 -04:00
## `dev schema`
2026-05-13 12:00:08 +02:00
2026-05-17 19:15:09 +02:00
`ktx dev schema` does not require a `ktx.yaml` file or a configured project
directory. Use it from any directory to generate editor or agent schema files.
2026-05-14 12:53:55 -04:00
| Flag | Description | Default |
|------|-------------|---------|
| `--output <file>` | Write the schema to a file instead of stdout | — |
## `dev runtime` Subcommands
| Subcommand | Description |
|-----------|-------------|
| `install` | Install the bundled Python runtime wheel into the managed runtime |
| `start` | Start the KTX-managed Python HTTP daemon |
| `stop` | Stop the KTX-managed Python HTTP daemon |
| `status` | Show managed Python runtime status and readiness checks |
## `dev runtime` Options
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-14 12:53:55 -04:00
| `--yes` | Accepted by `install` for scripted install commands | `false` |
| `--force` | Reinstall for `install`, or restart for `start` | `false` |
| `--all` | Stop all recorded or discoverable KTX daemon processes with `stop` | `false` |
2026-05-11 00:45:43 -07:00
## Examples
```bash
ktx dev init
2026-05-14 17:39:31 +02:00
ktx dev init ./my-project
2026-05-11 00:45:43 -07:00
ktx dev init --force
2026-05-14 12:53:55 -04:00
ktx dev schema
ktx dev schema --output ./ktx.schema.json
2026-05-13 12:00:08 +02:00
ktx dev runtime install --yes
2026-05-14 12:53:55 -04:00
ktx dev runtime install --feature local-embeddings --yes
2026-05-13 12:00:08 +02:00
ktx dev runtime status
2026-05-12 23:51:46 +02:00
ktx dev runtime start
2026-05-14 12:53:55 -04:00
ktx dev runtime start --feature local-embeddings
2026-05-13 12:00:08 +02:00
ktx dev runtime stop
2026-05-14 12:53:55 -04:00
ktx dev runtime stop --all
2026-05-11 00:45:43 -07:00
```
2026-05-11 16:43:08 -07:00
2026-05-14 12:53:55 -04:00
## Output
Runtime commands print the runtime root, installed features, daemon URL, daemon
pid, and log paths where relevant. `ktx dev runtime status --json` includes the
runtime status plus readiness checks.
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` |
2026-05-14 12:53:55 -04:00
| Multiple daemon processes remain | Older daemon state files or stray processes exist | Run `ktx dev runtime stop --all`, then start the runtime again |