topchester-ai 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +133 -46
- package/dist/cli.mjs +1369 -198
- package/dist/cli.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,86 +2,173 @@
|
|
|
2
2
|
|
|
3
3
|
Website: https://topchester.com
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Topchester is a terminal coding agent that learns a project before it starts making changes. It builds a local project knowledge base, uses that knowledge while chatting and editing, and helps keep the knowledge current as the code changes.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
If you have used tools like Codex, Claude Code, or OpenCode, the shape should feel familiar: install a CLI, `cd` into a repo, run a command, chat in your terminal, review changes, and keep working. The difference is that Topchester treats project knowledge as part of the agent, not as an optional side index.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Quick Start
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Requirements:
|
|
12
12
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
- Queues L1 work at `.agents/topchester-kb-cache/l1-queue.json`.
|
|
16
|
-
- Processes queued files with the configured `kb.summarize` model, or the `default` model when `kb.summarize` is not configured.
|
|
17
|
-
- Writes the manifest at `topchester-kb/manifest.json`.
|
|
18
|
-
- Writes current L1 file entries under `topchester-kb/l1-files/`.
|
|
19
|
-
- Exits successfully only when every in-scope file has a current L1 entry.
|
|
13
|
+
- Node.js `>=24`
|
|
14
|
+
- A model provider key. The example below uses OpenRouter.
|
|
20
15
|
|
|
21
|
-
|
|
16
|
+
Install the CLI:
|
|
22
17
|
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
|
|
18
|
+
```sh
|
|
19
|
+
npm install -g topchester-ai
|
|
20
|
+
```
|
|
26
21
|
|
|
27
|
-
|
|
22
|
+
From the project you want Topchester to work on, create `topchester.jsonc`:
|
|
28
23
|
|
|
29
|
-
```
|
|
30
|
-
|
|
24
|
+
```jsonc
|
|
25
|
+
{
|
|
26
|
+
"$schema": "https://topchester.com/schemas/config.v1.json",
|
|
27
|
+
"models": {
|
|
28
|
+
"default": "openrouter/google/gemini-3.1-flash-lite",
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
Set your API key:
|
|
34
34
|
|
|
35
35
|
```sh
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
pnpm typecheck
|
|
39
|
-
pnpm lint
|
|
40
|
-
pnpm format-check
|
|
36
|
+
export OPENROUTER_API_KEY=...
|
|
37
|
+
```
|
|
41
38
|
|
|
39
|
+
Build the project knowledge base:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
42
|
topchester kb init
|
|
43
43
|
topchester kb compile
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Start the agent:
|
|
46
47
|
|
|
48
|
+
```sh
|
|
47
49
|
topchester
|
|
48
|
-
topchester --resume latest
|
|
49
|
-
topchester --resume <session-id>
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
For the short setup guide, see [onboarding.md](onboarding.md).
|
|
53
|
+
|
|
54
|
+
## What Topchester Creates
|
|
55
|
+
|
|
56
|
+
Topchester keeps project knowledge and local runtime data in separate places:
|
|
57
|
+
|
|
58
|
+
- `topchester-kb/` — compiled project knowledge. This is the canonical knowledge base for the repo.
|
|
59
|
+
- `.agents/topchester-kb-cache/` — local generated cache and queue files.
|
|
60
|
+
- `.agents/topchester/sessions/` — local chat sessions, metadata, and event logs.
|
|
61
|
+
- `.agents/topchester/logs/` — local debug logs when logging is enabled.
|
|
62
|
+
|
|
63
|
+
Session folders, caches, and logs are local machine state and should not be committed.
|
|
64
|
+
|
|
65
|
+
## Everyday Commands
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
topchester
|
|
69
|
+
topchester --resume latest
|
|
70
|
+
topchester run "Summarize this project."
|
|
71
|
+
|
|
72
|
+
topchester kb status
|
|
73
|
+
topchester kb sync
|
|
74
|
+
topchester kb compile
|
|
75
|
+
topchester kb search "status bar"
|
|
76
|
+
topchester kb reset
|
|
77
|
+
```
|
|
53
78
|
|
|
54
|
-
|
|
79
|
+
Useful TUI slash commands:
|
|
55
80
|
|
|
56
|
-
|
|
81
|
+
```text
|
|
82
|
+
/kb status
|
|
83
|
+
/kb sync
|
|
84
|
+
/kb compile
|
|
85
|
+
/new
|
|
86
|
+
```
|
|
57
87
|
|
|
58
|
-
|
|
88
|
+
`topchester kb status` is the cheap check. It shows files that are not current in the knowledge base. `topchester kb sync` updates only those non-clean files.
|
|
59
89
|
|
|
60
90
|
## Configuration
|
|
61
91
|
|
|
62
|
-
|
|
92
|
+
The smallest config uses one OpenRouter model for all Topchester work:
|
|
93
|
+
|
|
94
|
+
```jsonc
|
|
95
|
+
{
|
|
96
|
+
"$schema": "https://topchester.com/schemas/config.v1.json",
|
|
97
|
+
"models": {
|
|
98
|
+
"default": "openrouter/google/gemini-3.1-flash-lite",
|
|
99
|
+
},
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
You can also use a stronger model for chat and a cheaper model for KB summaries:
|
|
104
|
+
|
|
105
|
+
```jsonc
|
|
106
|
+
{
|
|
107
|
+
"$schema": "https://topchester.com/schemas/config.v1.json",
|
|
108
|
+
"models": {
|
|
109
|
+
"default": "openrouter/anthropic/claude-sonnet-4.5",
|
|
110
|
+
"kb.summarize": "openrouter/google/gemini-3.1-flash-lite",
|
|
111
|
+
},
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Do not commit API keys. Put keys in environment variables, a user config file, or an uncommitted local config.
|
|
116
|
+
|
|
117
|
+
Topchester reads config in this order, with later entries overriding earlier ones:
|
|
63
118
|
|
|
64
119
|
1. `~/.config/topchester/config.yaml`
|
|
65
|
-
2.
|
|
66
|
-
3.
|
|
67
|
-
4. `
|
|
68
|
-
5.
|
|
120
|
+
2. `~/.config/topchester/config.jsonc`
|
|
121
|
+
3. `topchester.yaml`
|
|
122
|
+
4. `topchester.jsonc`
|
|
123
|
+
5. `.topchester/config.local.yaml`
|
|
124
|
+
6. `.topchester/config.local.jsonc`
|
|
125
|
+
7. `TOPCHESTER_CONFIG`
|
|
126
|
+
8. `--config <path>`
|
|
127
|
+
|
|
128
|
+
Prefer `topchester.jsonc` for new project config. YAML paths are kept for compatibility.
|
|
129
|
+
|
|
130
|
+
## How The Knowledge Base Works
|
|
131
|
+
|
|
132
|
+
`topchester kb compile` scans the workspace, respects `.gitignore`, skips generated/cache folders, and writes one L1 knowledge entry per in-scope file under `topchester-kb/l1-files/`.
|
|
133
|
+
|
|
134
|
+
The compiler uses `models["kb.summarize"]` when it is configured. If it is not configured, it uses `models.default`.
|
|
135
|
+
|
|
136
|
+
Common KB states:
|
|
137
|
+
|
|
138
|
+
- `kb: ready` — the KB exists and has compiled content.
|
|
139
|
+
- `kb: empty` — the KB folder exists but has no compiled content yet.
|
|
140
|
+
- `kb: missing` — run `topchester kb init`, then `topchester kb compile`.
|
|
141
|
+
- `N dirty` — run `topchester kb sync`.
|
|
142
|
+
|
|
143
|
+
## Working From Source
|
|
144
|
+
|
|
145
|
+
This section is for contributors working in this repository.
|
|
69
146
|
|
|
70
|
-
|
|
147
|
+
```sh
|
|
148
|
+
pnpm install
|
|
149
|
+
pnpm build
|
|
150
|
+
node dist/cli.mjs --help
|
|
151
|
+
```
|
|
71
152
|
|
|
72
|
-
|
|
153
|
+
Common repo checks:
|
|
73
154
|
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
|
|
155
|
+
```sh
|
|
156
|
+
pnpm check
|
|
157
|
+
pnpm test
|
|
158
|
+
pnpm typecheck
|
|
159
|
+
pnpm lint
|
|
160
|
+
pnpm format-check
|
|
77
161
|
```
|
|
78
162
|
|
|
79
|
-
|
|
163
|
+
The package name is `topchester-ai`; the installed command is `topchester`.
|
|
80
164
|
|
|
81
|
-
|
|
82
|
-
|
|
165
|
+
## Read More
|
|
166
|
+
|
|
167
|
+
- [Onboarding](onboarding.md)
|
|
83
168
|
- [CLI Commands](docs/cli.md)
|
|
84
|
-
- [Configuration](docs/config.md)
|
|
85
169
|
- [TUI Guide](docs/tui.md)
|
|
170
|
+
- [Configuration](docs/config.md)
|
|
86
171
|
- [Model Configuration](docs/MODEL_CONFIG.md)
|
|
172
|
+
- [Knowledge System](docs/KNOWLEDGE.md)
|
|
173
|
+
- [Architecture](docs/ARCHITECTURE.md)
|
|
87
174
|
- [Sessions](docs/SESSIONS.md)
|