akashic-kb 0.1.0__tar.gz

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.
Files changed (79) hide show
  1. akashic_kb-0.1.0/.akashic/config.yaml +11 -0
  2. akashic_kb-0.1.0/.gitignore +11 -0
  3. akashic_kb-0.1.0/LICENSE +21 -0
  4. akashic_kb-0.1.0/PKG-INFO +223 -0
  5. akashic_kb-0.1.0/README.md +169 -0
  6. akashic_kb-0.1.0/docs/README.md +33 -0
  7. akashic_kb-0.1.0/docs/commands.md +124 -0
  8. akashic_kb-0.1.0/docs/configuration.md +72 -0
  9. akashic_kb-0.1.0/docs/generation.md +87 -0
  10. akashic_kb-0.1.0/docs/installation.md +53 -0
  11. akashic_kb-0.1.0/docs/quickstart.md +74 -0
  12. akashic_kb-0.1.0/docs/site.md +53 -0
  13. akashic_kb-0.1.0/docs/troubleshooting.md +54 -0
  14. akashic_kb-0.1.0/frontend/.gitignore +15 -0
  15. akashic_kb-0.1.0/frontend/index.html +12 -0
  16. akashic_kb-0.1.0/frontend/package-lock.json +5346 -0
  17. akashic_kb-0.1.0/frontend/package.json +38 -0
  18. akashic_kb-0.1.0/frontend/postcss.config.mjs +7 -0
  19. akashic_kb-0.1.0/frontend/public/file.svg +1 -0
  20. akashic_kb-0.1.0/frontend/public/globe.svg +1 -0
  21. akashic_kb-0.1.0/frontend/src/components/DocViewer.tsx +38 -0
  22. akashic_kb-0.1.0/frontend/src/components/Editor.tsx +21 -0
  23. akashic_kb-0.1.0/frontend/src/components/Layout.tsx +28 -0
  24. akashic_kb-0.1.0/frontend/src/components/MermaidChart.tsx +32 -0
  25. akashic_kb-0.1.0/frontend/src/components/SearchBar.tsx +47 -0
  26. akashic_kb-0.1.0/frontend/src/components/Sidebar.tsx +49 -0
  27. akashic_kb-0.1.0/frontend/src/components/Toolbar.tsx +64 -0
  28. akashic_kb-0.1.0/frontend/src/hooks/useDoc.ts +45 -0
  29. akashic_kb-0.1.0/frontend/src/hooks/useMeta.ts +21 -0
  30. akashic_kb-0.1.0/frontend/src/hooks/useNav.ts +20 -0
  31. akashic_kb-0.1.0/frontend/src/index.css +2 -0
  32. akashic_kb-0.1.0/frontend/src/lib/dataSource.ts +109 -0
  33. akashic_kb-0.1.0/frontend/src/lib/frontmatter.ts +14 -0
  34. akashic_kb-0.1.0/frontend/src/lib/search.ts +36 -0
  35. akashic_kb-0.1.0/frontend/src/lib/types.ts +62 -0
  36. akashic_kb-0.1.0/frontend/src/main.tsx +15 -0
  37. akashic_kb-0.1.0/frontend/src/monacoWorkers.ts +15 -0
  38. akashic_kb-0.1.0/frontend/src/pages/DocPage.tsx +65 -0
  39. akashic_kb-0.1.0/frontend/src/pages/HomePage.tsx +8 -0
  40. akashic_kb-0.1.0/frontend/src/pages/NotFound.tsx +8 -0
  41. akashic_kb-0.1.0/frontend/src/router.tsx +19 -0
  42. akashic_kb-0.1.0/frontend/src/vite-env.d.ts +6 -0
  43. akashic_kb-0.1.0/frontend/tsconfig.json +24 -0
  44. akashic_kb-0.1.0/frontend/vite-plugin-akashic.ts +391 -0
  45. akashic_kb-0.1.0/frontend/vite.config.ts +27 -0
  46. akashic_kb-0.1.0/pyproject.toml +72 -0
  47. akashic_kb-0.1.0/src/akashic/__init__.py +4 -0
  48. akashic_kb-0.1.0/src/akashic/cli/__init__.py +259 -0
  49. akashic_kb-0.1.0/src/akashic/engine/__init__.py +2 -0
  50. akashic_kb-0.1.0/src/akashic/engine/agent.py +153 -0
  51. akashic_kb-0.1.0/src/akashic/engine/config.py +108 -0
  52. akashic_kb-0.1.0/src/akashic/engine/doctor.py +152 -0
  53. akashic_kb-0.1.0/src/akashic/engine/generate.py +143 -0
  54. akashic_kb-0.1.0/src/akashic/engine/init.py +85 -0
  55. akashic_kb-0.1.0/src/akashic/engine/prompt_builder.py +113 -0
  56. akashic_kb-0.1.0/src/akashic/engine/repositories.py +118 -0
  57. akashic_kb-0.1.0/src/akashic/engine/status.py +57 -0
  58. akashic_kb-0.1.0/src/akashic/engine/workspace.py +54 -0
  59. akashic_kb-0.1.0/src/akashic/frontend/.gitkeep +1 -0
  60. akashic_kb-0.1.0/src/akashic/prompts/__init__.py +2 -0
  61. akashic_kb-0.1.0/src/akashic/prompts/generate_adr.md +4 -0
  62. akashic_kb-0.1.0/src/akashic/prompts/generate_entity.md +4 -0
  63. akashic_kb-0.1.0/src/akashic/prompts/generate_flow.md +4 -0
  64. akashic_kb-0.1.0/src/akashic/prompts/generate_service.md +4 -0
  65. akashic_kb-0.1.0/src/akashic/prompts/generate_system.md +4 -0
  66. akashic_kb-0.1.0/src/akashic/prompts/master.md +23 -0
  67. akashic_kb-0.1.0/src/akashic/server/__init__.py +2 -0
  68. akashic_kb-0.1.0/src/akashic/server/site.py +178 -0
  69. akashic_kb-0.1.0/tests/conftest.py +23 -0
  70. akashic_kb-0.1.0/tests/test_agent.py +152 -0
  71. akashic_kb-0.1.0/tests/test_cli.py +104 -0
  72. akashic_kb-0.1.0/tests/test_doctor.py +142 -0
  73. akashic_kb-0.1.0/tests/test_generate.py +164 -0
  74. akashic_kb-0.1.0/tests/test_init.py +104 -0
  75. akashic_kb-0.1.0/tests/test_prompt_builder.py +56 -0
  76. akashic_kb-0.1.0/tests/test_repositories.py +149 -0
  77. akashic_kb-0.1.0/tests/test_site.py +138 -0
  78. akashic_kb-0.1.0/tests/test_status.py +78 -0
  79. akashic_kb-0.1.0/uv.lock +928 -0
@@ -0,0 +1,11 @@
1
+ version: 1
2
+ knowledge:
3
+ path: .
4
+ repositories: []
5
+ agent:
6
+ provider: codex
7
+ command: null
8
+ site:
9
+ port: 6969
10
+ generation:
11
+ model: null
@@ -0,0 +1,11 @@
1
+ .scratch
2
+ .env
3
+ .venv
4
+ __pycache__/
5
+ .pytest_cache/
6
+ .akashic/cache/
7
+ .akashic/logs/
8
+ .akashic/config.local.yaml
9
+ node_modules/
10
+ dist/
11
+ node_modules
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Akashic contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,223 @@
1
+ Metadata-Version: 2.4
2
+ Name: akashic-kb
3
+ Version: 0.1.0
4
+ Summary: CLI for Git-backed knowledge repositories.
5
+ Project-URL: Homepage, https://github.com/kanakOS01/akashic
6
+ Project-URL: Repository, https://github.com/kanakOS01/akashic
7
+ Project-URL: Issues, https://github.com/kanakOS01/akashic/issues
8
+ Project-URL: Documentation, https://github.com/kanakOS01/akashic/tree/main/docs
9
+ Author: Akashic contributors
10
+ License: MIT License
11
+
12
+ Copyright (c) 2026 Akashic contributors
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+ License-File: LICENSE
32
+ Keywords: cli,documentation,git,knowledge-base,markdown
33
+ Classifier: Development Status :: 3 - Alpha
34
+ Classifier: Environment :: Console
35
+ Classifier: Intended Audience :: Developers
36
+ Classifier: License :: OSI Approved :: MIT License
37
+ Classifier: Operating System :: OS Independent
38
+ Classifier: Programming Language :: Python :: 3
39
+ Classifier: Programming Language :: Python :: 3.10
40
+ Classifier: Programming Language :: Python :: 3.11
41
+ Classifier: Programming Language :: Python :: 3.12
42
+ Classifier: Programming Language :: Python :: 3.13
43
+ Classifier: Programming Language :: Python :: 3.14
44
+ Classifier: Topic :: Documentation
45
+ Classifier: Topic :: Software Development :: Documentation
46
+ Requires-Python: >=3.10
47
+ Requires-Dist: pydantic>=2
48
+ Requires-Dist: pyyaml>=6
49
+ Requires-Dist: typer>=0.12
50
+ Provides-Extra: dev
51
+ Requires-Dist: pytest>=8; extra == 'dev'
52
+ Requires-Dist: twine>=5; extra == 'dev'
53
+ Description-Content-Type: text/markdown
54
+
55
+ # Akashic
56
+
57
+ Akashic is a local-first CLI for Git-backed knowledge repositories. It helps
58
+ teams keep structured Markdown documentation beside real source repositories,
59
+ then browse that documentation through a local web UI.
60
+
61
+ Akashic does not analyze code by itself. It manages the knowledge repo,
62
+ discovers attached source repos, builds generation prompts, and hands those
63
+ prompts to an agent provider such as Codex or Claude.
64
+
65
+ ## Features
66
+
67
+ - Initialize a Git-backed knowledge repository.
68
+ - Attach one or more local Git source repositories.
69
+ - Generate structured docs for services, flows, system notes, ADRs, entities,
70
+ and glossary entries.
71
+ - Preserve hand-written content through `<!-- HUMAN:START -->` sections.
72
+ - Serve docs through a local React/Vite site.
73
+ - Build a static read-only docs site.
74
+ - Validate setup with `doctor` and inspect repo state with `status`.
75
+
76
+ ## Installation
77
+
78
+ Akashic is a Python package targeting Python 3.10+.
79
+
80
+ Install the released CLI:
81
+
82
+ ```bash
83
+ uv tool install akashic-kb
84
+ # or
85
+ pipx install akashic-kb
86
+ ```
87
+
88
+ The installed command is still `akashic`:
89
+
90
+ ```bash
91
+ akashic --version
92
+ ```
93
+
94
+ For local development:
95
+
96
+ ```bash
97
+ uv sync
98
+ uv run akashic --version
99
+ ```
100
+
101
+ If installing from a checkout:
102
+
103
+ ```bash
104
+ pip install .
105
+ akashic --version
106
+ ```
107
+
108
+ The documentation site commands also require Node.js and npm.
109
+
110
+ ## Quickstart
111
+
112
+ Create a knowledge repository:
113
+
114
+ ```bash
115
+ mkdir knowledge
116
+ cd knowledge
117
+ akashic init
118
+ ```
119
+
120
+ Attach source repositories:
121
+
122
+ ```bash
123
+ akashic attach /path/to/source-repo
124
+ akashic attach /path/to/another-repo --name billing
125
+ akashic list
126
+ ```
127
+
128
+ Generate docs:
129
+
130
+ ```bash
131
+ akashic generate
132
+ ```
133
+
134
+ Review changes, then commit them yourself:
135
+
136
+ ```bash
137
+ git status
138
+ git add -A
139
+ git commit -m "Generate knowledge docs"
140
+ ```
141
+
142
+ Browse docs locally:
143
+
144
+ ```bash
145
+ akashic serve
146
+ ```
147
+
148
+ Build a static site:
149
+
150
+ ```bash
151
+ akashic build-site
152
+ ```
153
+
154
+ ## Commands
155
+
156
+ | Command | Purpose |
157
+ | --- | --- |
158
+ | `akashic init [PATH]` | Initialize a knowledge repo. |
159
+ | `akashic root` | Print discovered knowledge repo root. |
160
+ | `akashic attach [PATH] [--name NAME]` | Register a source Git repo. |
161
+ | `akashic detach NAME` | Remove an attached source repo. |
162
+ | `akashic list` | List attached source repos. |
163
+ | `akashic generate` | Compose prompts and run configured provider. |
164
+ | `akashic serve` | Start local docs site. |
165
+ | `akashic build-site` | Build static docs site. |
166
+ | `akashic doctor` | Validate config, Git, repos, provider, and runtime. |
167
+ | `akashic status` | Show attached repos, generation state, and doc counts. |
168
+
169
+ Global options:
170
+
171
+ - `--version`: print package version.
172
+ - `--knowledge <dir>`: use a specific knowledge repo instead of discovering one.
173
+
174
+ ## Configuration
175
+
176
+ Akashic stores shared repo configuration in `.akashic/config.yaml` and
177
+ machine-local absolute paths in `.akashic/config.local.yaml`. The local config
178
+ is gitignored so the knowledge repo can be shared across machines.
179
+
180
+ Workspace discovery order:
181
+
182
+ 1. `--knowledge <dir>`
183
+ 2. `AKASHIC_HOME`
184
+ 3. Parent directory walk from the current working directory
185
+
186
+ ## Documentation
187
+
188
+ Full docs live in [`docs/README.md`](docs/README.md):
189
+
190
+ - [`docs/installation.md`](docs/installation.md)
191
+ - [`docs/quickstart.md`](docs/quickstart.md)
192
+ - [`docs/commands.md`](docs/commands.md)
193
+ - [`docs/configuration.md`](docs/configuration.md)
194
+ - [`docs/generation.md`](docs/generation.md)
195
+ - [`docs/site.md`](docs/site.md)
196
+ - [`docs/troubleshooting.md`](docs/troubleshooting.md)
197
+
198
+ ## Development
199
+
200
+ Run tests:
201
+
202
+ ```bash
203
+ uv run pytest
204
+ ```
205
+
206
+ Run focused CLI commands from the checkout:
207
+
208
+ ```bash
209
+ uv run akashic doctor --knowledge /path/to/knowledge
210
+ ```
211
+
212
+ Frontend sources live under `frontend/` and are packaged into the Python wheel.
213
+
214
+ ## Current status
215
+
216
+ The built-in `fake` provider writes files and is useful for exercising the full
217
+ pipeline. Real providers (`codex`, `claude`) are documented in
218
+ [`docs/generation.md`](docs/generation.md), including current execution
219
+ behavior and limitations.
220
+
221
+ ## License
222
+
223
+ MIT. See [`LICENSE`](LICENSE).
@@ -0,0 +1,169 @@
1
+ # Akashic
2
+
3
+ Akashic is a local-first CLI for Git-backed knowledge repositories. It helps
4
+ teams keep structured Markdown documentation beside real source repositories,
5
+ then browse that documentation through a local web UI.
6
+
7
+ Akashic does not analyze code by itself. It manages the knowledge repo,
8
+ discovers attached source repos, builds generation prompts, and hands those
9
+ prompts to an agent provider such as Codex or Claude.
10
+
11
+ ## Features
12
+
13
+ - Initialize a Git-backed knowledge repository.
14
+ - Attach one or more local Git source repositories.
15
+ - Generate structured docs for services, flows, system notes, ADRs, entities,
16
+ and glossary entries.
17
+ - Preserve hand-written content through `<!-- HUMAN:START -->` sections.
18
+ - Serve docs through a local React/Vite site.
19
+ - Build a static read-only docs site.
20
+ - Validate setup with `doctor` and inspect repo state with `status`.
21
+
22
+ ## Installation
23
+
24
+ Akashic is a Python package targeting Python 3.10+.
25
+
26
+ Install the released CLI:
27
+
28
+ ```bash
29
+ uv tool install akashic-kb
30
+ # or
31
+ pipx install akashic-kb
32
+ ```
33
+
34
+ The installed command is still `akashic`:
35
+
36
+ ```bash
37
+ akashic --version
38
+ ```
39
+
40
+ For local development:
41
+
42
+ ```bash
43
+ uv sync
44
+ uv run akashic --version
45
+ ```
46
+
47
+ If installing from a checkout:
48
+
49
+ ```bash
50
+ pip install .
51
+ akashic --version
52
+ ```
53
+
54
+ The documentation site commands also require Node.js and npm.
55
+
56
+ ## Quickstart
57
+
58
+ Create a knowledge repository:
59
+
60
+ ```bash
61
+ mkdir knowledge
62
+ cd knowledge
63
+ akashic init
64
+ ```
65
+
66
+ Attach source repositories:
67
+
68
+ ```bash
69
+ akashic attach /path/to/source-repo
70
+ akashic attach /path/to/another-repo --name billing
71
+ akashic list
72
+ ```
73
+
74
+ Generate docs:
75
+
76
+ ```bash
77
+ akashic generate
78
+ ```
79
+
80
+ Review changes, then commit them yourself:
81
+
82
+ ```bash
83
+ git status
84
+ git add -A
85
+ git commit -m "Generate knowledge docs"
86
+ ```
87
+
88
+ Browse docs locally:
89
+
90
+ ```bash
91
+ akashic serve
92
+ ```
93
+
94
+ Build a static site:
95
+
96
+ ```bash
97
+ akashic build-site
98
+ ```
99
+
100
+ ## Commands
101
+
102
+ | Command | Purpose |
103
+ | --- | --- |
104
+ | `akashic init [PATH]` | Initialize a knowledge repo. |
105
+ | `akashic root` | Print discovered knowledge repo root. |
106
+ | `akashic attach [PATH] [--name NAME]` | Register a source Git repo. |
107
+ | `akashic detach NAME` | Remove an attached source repo. |
108
+ | `akashic list` | List attached source repos. |
109
+ | `akashic generate` | Compose prompts and run configured provider. |
110
+ | `akashic serve` | Start local docs site. |
111
+ | `akashic build-site` | Build static docs site. |
112
+ | `akashic doctor` | Validate config, Git, repos, provider, and runtime. |
113
+ | `akashic status` | Show attached repos, generation state, and doc counts. |
114
+
115
+ Global options:
116
+
117
+ - `--version`: print package version.
118
+ - `--knowledge <dir>`: use a specific knowledge repo instead of discovering one.
119
+
120
+ ## Configuration
121
+
122
+ Akashic stores shared repo configuration in `.akashic/config.yaml` and
123
+ machine-local absolute paths in `.akashic/config.local.yaml`. The local config
124
+ is gitignored so the knowledge repo can be shared across machines.
125
+
126
+ Workspace discovery order:
127
+
128
+ 1. `--knowledge <dir>`
129
+ 2. `AKASHIC_HOME`
130
+ 3. Parent directory walk from the current working directory
131
+
132
+ ## Documentation
133
+
134
+ Full docs live in [`docs/README.md`](docs/README.md):
135
+
136
+ - [`docs/installation.md`](docs/installation.md)
137
+ - [`docs/quickstart.md`](docs/quickstart.md)
138
+ - [`docs/commands.md`](docs/commands.md)
139
+ - [`docs/configuration.md`](docs/configuration.md)
140
+ - [`docs/generation.md`](docs/generation.md)
141
+ - [`docs/site.md`](docs/site.md)
142
+ - [`docs/troubleshooting.md`](docs/troubleshooting.md)
143
+
144
+ ## Development
145
+
146
+ Run tests:
147
+
148
+ ```bash
149
+ uv run pytest
150
+ ```
151
+
152
+ Run focused CLI commands from the checkout:
153
+
154
+ ```bash
155
+ uv run akashic doctor --knowledge /path/to/knowledge
156
+ ```
157
+
158
+ Frontend sources live under `frontend/` and are packaged into the Python wheel.
159
+
160
+ ## Current status
161
+
162
+ The built-in `fake` provider writes files and is useful for exercising the full
163
+ pipeline. Real providers (`codex`, `claude`) are documented in
164
+ [`docs/generation.md`](docs/generation.md), including current execution
165
+ behavior and limitations.
166
+
167
+ ## License
168
+
169
+ MIT. See [`LICENSE`](LICENSE).
@@ -0,0 +1,33 @@
1
+ # Akashic Usage Documentation
2
+
3
+ Akashic is a local-first CLI that builds a **Git-backed knowledge repository** of structured Markdown for a set of source repositories. It does not understand code itself — it composes a prompt and hands generation off to a coding agent (Claude Code or Codex).
4
+
5
+ This directory documents how to install, configure, and operate the CLI as it is built today.
6
+
7
+ ## Documentation map
8
+
9
+ | Page | Contents |
10
+ |------|----------|
11
+ | [installation.md](installation.md) | Requirements, install, verifying the CLI |
12
+ | [quickstart.md](quickstart.md) | End-to-end: init → attach → generate → serve |
13
+ | [commands.md](commands.md) | Every command, arguments, options, output |
14
+ | [configuration.md](configuration.md) | `config.yaml`, `config.local.yaml`, every field + default |
15
+ | [generation.md](generation.md) | Prompt system, providers, HUMAN sections, frontmatter, current limitation |
16
+ | [site.md](site.md) | `serve` and `build-site` (MkDocs) |
17
+ | [troubleshooting.md](troubleshooting.md) | `doctor`, common errors |
18
+
19
+ ## Mental model
20
+
21
+ ```
22
+ akashic init -> scaffold a Git knowledge repo (services/ flows/ system/ adr/ entities/ glossary/)
23
+ akashic attach -> register a source repo (path stored per-machine, name committed)
24
+ akashic generate -> compose a master prompt + run the configured agent, which writes docs
25
+ akashic serve -> browse the docs locally via MkDocs
26
+ akashic build-site-> compile the docs to dist/
27
+ akashic doctor -> validate setup
28
+ akashic status -> show repos, last generation, pending changes, doc counts
29
+ ```
30
+
31
+ ## Current limitation (read before generating)
32
+
33
+ The real agent providers (`claude`, `codex`) currently **build the invocation command but do not execute it** — live agent execution is pending verification (issue 07). Only the built-in `fake` provider actually writes files today. See [generation.md](generation.md#execution-status) for details and how to exercise the full pipeline with the fake provider.
@@ -0,0 +1,124 @@
1
+ # Command Reference
2
+
3
+ Every command as implemented. Global options come **before** the subcommand.
4
+
5
+ ## Global options
6
+
7
+ | Option | Description |
8
+ |--------|-------------|
9
+ | `--version` | Print the package version and exit. |
10
+ | `--knowledge <dir>` | Use this directory as the knowledge repo instead of discovering one by walking up from the current directory. Resolved to an absolute path. |
11
+
12
+ Workspace discovery order (for every command except `init`):
13
+
14
+ 1. `--knowledge <dir>` if given.
15
+ 2. `AKASHIC_HOME` environment variable if set.
16
+ 3. Walk up from the current working directory looking for `.akashic/config.yaml`.
17
+
18
+ If none resolve, the command fails with: `No Akashic knowledge repo found from <dir>. Run 'akashic init' first or pass --knowledge.`
19
+
20
+ ---
21
+
22
+ ## `akashic init [PATH]`
23
+
24
+ Initialize (or top up) a knowledge repository at `PATH` (default: current directory).
25
+
26
+ Creates: `services/ flows/ system/ adr/ entities/ glossary/`, `.akashic/cache/`, `.akashic/logs/`, `README.md`, `.akashic/config.yaml`, `.gitignore`. Runs `git init` if not already a repo, and makes an empty initial commit if there is no `HEAD` yet.
27
+
28
+ - **Idempotent:** existing directories, README, and config are left untouched; `.gitignore` lines are merged, not duplicated.
29
+ - The initial commit is authored as `Akashic <akashic@example.invalid>` via `-c` overrides, so it does not depend on your global Git identity.
30
+
31
+ `.gitignore` always contains: `.akashic/cache/`, `.akashic/logs/`, `.akashic/config.local.yaml`.
32
+
33
+ Output: `Initialized Akashic repository at <root>`
34
+
35
+ ---
36
+
37
+ ## `akashic root`
38
+
39
+ Print the discovered knowledge repository root. Useful for scripting and for confirming discovery works from a subdirectory.
40
+
41
+ ---
42
+
43
+ ## `akashic attach [PATH] [--name NAME]`
44
+
45
+ Register a source Git repository. `PATH` defaults to the current directory.
46
+
47
+ - Validates `PATH` is inside a Git work tree (`git rev-parse --is-inside-work-tree`); otherwise errors `<path> is not a Git repository.`
48
+ - Name defaults to the resolved directory's basename; override with `--name`.
49
+ - **Dedupe by resolved path:** re-attaching the same path updates the entry in place (and renames it if `--name` differs).
50
+ - **Unique names:** attaching a *different* path under an already-used name errors `Repository name '<name>' is already attached.`
51
+ - Writes the name to `config.yaml` (`repositories`) and the absolute path to `config.local.yaml`.
52
+
53
+ Output: `Attached <name>`
54
+
55
+ ---
56
+
57
+ ## `akashic detach NAME`
58
+
59
+ Remove a repository from both `config.yaml` and `config.local.yaml`. Deletes no files.
60
+
61
+ - Unknown name errors `Repository '<name>' is not attached.`
62
+
63
+ Output:
64
+ ```
65
+ Detached <name>
66
+ Generated docs remain; remove them with git rm when ready.
67
+ ```
68
+
69
+ ---
70
+
71
+ ## `akashic list`
72
+
73
+ List attached repositories, sorted by name.
74
+
75
+ - `No repositories attached.` when empty.
76
+ - Each row is tab-separated:
77
+ - `<name>\t<path>` — path present and exists.
78
+ - `<name>\t[missing local path]` — no entry in `config.local.yaml` (e.g. after cloning the knowledge repo on a new machine).
79
+ - `<name>\t<path>\t[missing target]` — path recorded but the directory no longer exists.
80
+
81
+ ---
82
+
83
+ ## `akashic generate`
84
+
85
+ Compose the master prompt and run the configured agent provider.
86
+
87
+ Steps:
88
+ 1. Merge `config.yaml` repos with `config.local.yaml` paths. Repos with a missing/nonexistent path are **skipped with a warning**.
89
+ 2. If no valid repo remains, error `No valid attached repositories found.`
90
+ 3. Build the master prompt from bundled + custom templates (see [generation.md](generation.md)).
91
+ 4. Invoke the provider (`agent.provider`). Detect changes via `git status --porcelain` (ignoring `.akashic/`).
92
+ 5. Write `.akashic/cache/state.json` (timestamp, provider, repos, duration).
93
+
94
+ - **No Git commit or staging is performed** — changes are left in the working tree.
95
+ - Success = agent exit code 0 **and** at least one changed file. A clean exit with no changes warns: `Agent exited cleanly but produced no knowledge changes.`
96
+ - Real providers (`claude`, `codex`) run with inherited stdio, so the interactive session takes over the terminal; Akashic waits for it to exit and reads its real exit code. See [generation.md](generation.md#execution-status).
97
+
98
+ Output: warnings (to stderr), a `Changed files:` list (or `Changed files: none`), and `State written: <path>`.
99
+
100
+ ---
101
+
102
+ ## `akashic serve`
103
+
104
+ Start the local React documentation site (Vite dev server) reading directly from the knowledge repo. Binds `127.0.0.1:<site.port>` (default `6969`). Blocks until the server exits (Ctrl-C). Installs frontend dependencies if missing, then runs `npm run dev`. Supports in-browser editing (Save writes back to the knowledge repo; Commit stages and commits via Git). See [site.md](site.md).
105
+
106
+ Errors `… Node.js not found on PATH. …` / `… npm not found on PATH. …` if Node/npm is missing.
107
+
108
+ ---
109
+
110
+ ## `akashic build-site`
111
+
112
+ Compile the docs into a static `dist/` (via the Vite build). Output: `Built site at <root>/dist`. In this static mode the site is read-only (no in-browser editing).
113
+
114
+ ---
115
+
116
+ ## `akashic doctor`
117
+
118
+ Run six checks and print pass/fail for each: configuration schema, Git presence, attached repositories, agent provider, writability, and Node runtime. Exits with code `1` if any check fails. See [troubleshooting.md](troubleshooting.md).
119
+
120
+ ---
121
+
122
+ ## `akashic status`
123
+
124
+ Print: attached repositories (with paths or `missing local path`), last generation (from `state.json`, or `None`), pending Git changes (porcelain), and per-section document counts (`*.md` under each section directory).
@@ -0,0 +1,72 @@
1
+ # Configuration
2
+
3
+ Akashic uses **two** config files under `.akashic/`:
4
+
5
+ | File | Committed? | Purpose |
6
+ |------|-----------|---------|
7
+ | `config.yaml` | Yes | Portable settings: repo names, agent, site, generation. |
8
+ | `config.local.yaml` | No (gitignored) | Per-machine `name → absolute path` mapping for attached repos. |
9
+
10
+ This split keeps machine-specific absolute paths out of Git, so a teammate can clone the knowledge repo and set their own paths (via `akashic attach`) without breaking the committed config.
11
+
12
+ Both files are validated on load with `extra="forbid"` — unknown keys raise a clear error.
13
+
14
+ ---
15
+
16
+ ## `config.yaml`
17
+
18
+ Written by `init` with defaults. Full shape and defaults:
19
+
20
+ ```yaml
21
+ version: 1
22
+
23
+ knowledge:
24
+ path: "." # knowledge root, relative to the repo; used in the prompt's layout section
25
+
26
+ repositories: [] # list of { name: <str>, settings: {} }; managed by attach/detach
27
+
28
+ agent:
29
+ provider: codex # one of: codex | claude | fake
30
+ command: null # optional path/name of the agent binary, overriding the default
31
+
32
+ site:
33
+ port: 6969 # port used by `serve`
34
+
35
+ generation:
36
+ model: null # optional model hint (reserved; not yet wired into invocation)
37
+ ```
38
+
39
+ ### Field reference
40
+
41
+ - **`version`** (int, default `1`) — config contract version.
42
+ - **`knowledge.path`** (str, default `"."`) — knowledge root, surfaced in the prompt's Knowledge Layout section.
43
+ - **`repositories`** (list) — each entry `{ name, settings }`. Managed by `attach`/`detach`; edit by hand only if you know what you're doing. `settings` is reserved and currently unused.
44
+ - **`agent.provider`** (str, default `codex`) — selects the provider. `codex` and `claude` construct real agent commands (but do not execute yet — see [generation.md](generation.md#execution-status)); `fake` runs the full pipeline and writes a placeholder doc. An unknown value errors `Unknown agent provider '<x>'.`
45
+ - **`agent.command`** (str | null) — override the binary looked up on `PATH` (default `claude` or `codex`). Useful for non-standard installs.
46
+ - **`site.port`** (int, default `6969`) — bind port for `serve`.
47
+ - **`generation.model`** (str | null) — reserved model hint; not yet passed to the agent.
48
+
49
+ ---
50
+
51
+ ## `config.local.yaml`
52
+
53
+ Created/updated by `attach` and `detach`; gitignored. Shape:
54
+
55
+ ```yaml
56
+ repositories:
57
+ bookings: /Users/alice/code/bookings
58
+ billing: /Users/alice/code/payments
59
+ ```
60
+
61
+ If the file is absent, an empty mapping is assumed. A repo listed in `config.yaml` but missing here shows as `[missing local path]` in `list` and is skipped by `generate`.
62
+
63
+ ---
64
+
65
+ ## Setting up on a new machine
66
+
67
+ After cloning a knowledge repo:
68
+
69
+ ```bash
70
+ akashic list # shows attached repos as [missing local path]
71
+ akashic attach /new/machine/path/to/bookings # re-record the local path (name preserved)
72
+ ```