mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-13 08:15:14 +02:00
* fix(cli): survive ktx.yaml version skew and derive repo ownership from disk Loading ktx.yaml is now tolerant of keys this ktx version does not recognize: they are stripped from the in-memory config (the file on disk is never rewritten) and reported by ktx status as non-blocking warnings, while invalid values on recognized fields still fail hard. Repo ownership is derived from observed state (a .git directory plus a root ktx.yaml) instead of a ktx.managed git-config marker, so projects created by any past or future ktx classify identically. initKtxProject now runs an explicit foreign-repo pre-check and writes ktx.yaml before initializing git, so an interrupted init leaves only recoverable residue instead of a bare .git misread as foreign. * style(cli): trim comment blocks to constraint-only notes * docs(agents): require constraint-only code comments
99 lines
4 KiB
Text
99 lines
4 KiB
Text
---
|
|
title: "ktx status"
|
|
description: "Check ktx setup and project readiness."
|
|
---
|
|
|
|
Run the **ktx** readiness doctor. Inside a **ktx** project, this checks setup,
|
|
project configuration, semantic search, query history, connections, and related
|
|
diagnostics. Outside a project, it checks local CLI setup readiness so you know
|
|
whether `ktx setup` can run.
|
|
|
|
## Command signature
|
|
|
|
```bash
|
|
ktx status [options]
|
|
```
|
|
|
|
## Options
|
|
|
|
| Flag | Description | Default |
|
|
|------|-------------|---------|
|
|
| `--json` | Print JSON output | `false` |
|
|
| `-v`, `--verbose` | Show every check, including passing ones | `false` |
|
|
| `--validate` | Only validate the `ktx.yaml` schema; skip readiness checks | `false` |
|
|
| `--fast` | Skip checks that require external communication (query-history readiness probes, Claude Code auth probe, and Codex auth probe) | `false` |
|
|
| `--no-input` | Disable interactive terminal input | - |
|
|
|
|
## Examples
|
|
|
|
```bash
|
|
# Show project status
|
|
ktx status
|
|
|
|
# Get status as JSON without interactive input
|
|
ktx status --json --no-input
|
|
|
|
# Show all checks, not only warnings and failures
|
|
ktx status --verbose
|
|
|
|
# Validate ktx.yaml without running readiness checks
|
|
ktx status --validate
|
|
|
|
# Skip slow probes (query-history readiness, Claude Code auth, Codex auth)
|
|
ktx status --fast
|
|
|
|
# Check a project from another directory
|
|
ktx status --project-dir ./analytics
|
|
```
|
|
|
|
## Output
|
|
|
|
`ktx status` prints grouped doctor checks. Agents should use
|
|
`ktx status --json --no-input` when they need to branch on readiness state.
|
|
|
|
For `llm.provider.backend: claude-code`, `ktx status` checks that the local
|
|
Claude Code session is usable. If auth fails, run the Claude Code CLI login
|
|
flow, then rerun `ktx status`. Use `--fast` to skip this probe (useful in CI
|
|
or offline contexts); skipped checks render as `-` and carry
|
|
`"status": "skipped"` in JSON output.
|
|
|
|
For `llm.provider.backend: codex`, `ktx status` runs a minimal non-interactive
|
|
Codex request. If the probe fails, authenticate Codex locally with the Codex CLI
|
|
and verify the Codex CLI installation.
|
|
|
|
When `llm.provider.backend: codex` is configured, `ktx status` also prints a
|
|
warning when the installed public Codex SDK and CLI surface cannot prove full
|
|
Claude-Code-style isolation. The warning does not block authenticated Codex
|
|
usage, but it marks the project status as partial so you can make an explicit
|
|
runtime-isolation decision.
|
|
|
|
A `Local data` section summarises what the project has accumulated locally:
|
|
ingest run counts, last completed timestamp per connection, knowledge page
|
|
counts by scope, semantic-layer source and dictionary value counts, and the
|
|
on-disk size of `.ktx/db.sqlite`, `.ktx/cache/`, `raw-sources/`, `wiki/global/`,
|
|
and `semantic-layer/`. These are read from `.ktx/db.sqlite` and local file
|
|
stats, and are always shown (they do not require external communication).
|
|
|
|
```json
|
|
{
|
|
"title": "ktx project doctor",
|
|
"checks": [
|
|
{
|
|
"id": "project-config",
|
|
"label": "Project config",
|
|
"status": "pass",
|
|
"detail": "warehouse"
|
|
}
|
|
]
|
|
}
|
|
```
|
|
|
|
## Common errors
|
|
|
|
| Error | Cause | Recovery |
|
|
|-------|-------|----------|
|
|
| No **ktx** project found | Current directory has no `ktx.yaml` and `KTX_PROJECT_DIR` is unset | `ktx status` runs setup checks; run from a **ktx** project or set `KTX_PROJECT_DIR` for project checks |
|
|
| Project config check fails | The project directory is missing or has an invalid `ktx.yaml` | Run `ktx setup` to resume setup |
|
|
| Schema validation fails | A field **ktx** recognizes has an invalid value. Unrecognized keys are reported as non-blocking warnings (exit `0`), not failures | Run `ktx status --validate --json` for structured issue details, then edit `ktx.yaml` or rerun `ktx setup` |
|
|
| Semantic search check warns | Embeddings are not configured or the provider probe failed | Run `ktx setup` or inspect the check's `fix` field in JSON output |
|
|
| Query history check warns | A database has query history enabled but the warehouse prerequisites are missing | Fix the warehouse extension, grants, or history access, then rerun `ktx status` |
|