2026-05-11 00:45:43 -07:00
---
title: "ktx wiki"
2026-05-14 01:43:06 +02:00
description: "List or search wiki pages."
2026-05-11 00:45:43 -07:00
---
2026-05-14 09:20:37 -07:00
List and search wiki pages in your KTX project. Wiki pages are Markdown
documents that capture business definitions, rules, and gotchas. Agents search
them for context when answering questions about your data.
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 wiki <subcommand> [options]
```
## Subcommands
| Subcommand | Description |
|-----------|-------------|
| `list` | List local wiki pages |
| `search <query>` | Search local wiki pages |
2026-05-14 09:20:37 -07:00
The current public CLI lists and searches wiki pages. Edit the Markdown files
under `wiki/` directly, or ingest source content with `ktx ingest`, when you
need to add or update wiki knowledge.
2026-05-11 00:45:43 -07:00
## Options
### `wiki list`
| Flag | Description | Default |
|------|-------------|---------|
| `--user-id <id>` | Local user id | `local` |
2026-05-14 09:45:00 -07:00
| `--output <mode>` | Output mode: `pretty` (default in TTY), `plain` (TSV), or `json` | `pretty` |
| `--json` | Shortcut for `--output=json` (overrides `--output`) | `false` |
2026-05-11 00:45:43 -07:00
### `wiki search`
| Flag | Description | Default |
|------|-------------|---------|
| `--user-id <id>` | Local user id | `local` |
2026-05-14 12:43:14 -04:00
| `--limit <number>` | Maximum search results | - |
2026-05-14 09:45:00 -07:00
| `--output <mode>` | Output mode: `pretty` (default in TTY), `plain` (TSV), or `json` | `pretty` |
| `--json` | Shortcut for `--output=json` (overrides `--output`) | `false` |
2026-05-11 00:45:43 -07:00
## Examples
```bash
# List all wiki pages
ktx wiki list
2026-05-13 13:01:56 +02:00
# List all wiki pages as JSON
ktx wiki list --json
2026-05-11 00:45:43 -07:00
# Search wiki pages
ktx wiki search "monthly recurring revenue"
2026-05-13 13:01:56 +02:00
# Search wiki pages as JSON
ktx wiki search "monthly recurring revenue" --json --limit 10
2026-05-14 09:45:00 -07:00
# Print search results as TSV
ktx wiki search "monthly recurring revenue" --output plain
2026-05-11 00:45:43 -07:00
```
2026-05-11 16:43:08 -07:00
## Output
2026-05-14 09:45:00 -07:00
Wiki commands print clack-style pretty output in a TTY and TSV-style plain
output when requested. JSON output wraps the items with a command metadata
envelope. Open the matching Markdown files directly when you need the full page
contents.
2026-05-11 16:43:08 -07:00
```json
{
2026-05-13 13:01:56 +02:00
"kind": "list",
"data": {
"items": [
{
"key": "revenue-definitions",
"summary": "Canonical revenue metric definitions",
"score": 0.92
}
]
}
2026-05-11 16:43:08 -07:00
}
```
## Common errors
| Error | Cause | Recovery |
|-------|-------|----------|
2026-05-13 16:05:58 +02:00
| Search returns no results | The query terms do not match summaries, tags, or content | Retry with business synonyms, then create a page if the knowledge is missing |
2026-05-14 01:43:06 +02:00
| A page is missing | No Markdown file exists for that business context | Add a file under `wiki/` or run `ktx ingest <connectionId>` |