archidocs 1.2.0 → 1.3.1
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 +62 -13
- package/dist/cli/commands.d.ts +231 -10
- package/dist/cli/commands.js +134 -9
- package/dist/cli/dev.d.ts +5 -6
- package/dist/cli/dev.js +12 -14
- package/dist/cli/diff-format.d.ts +1 -5
- package/dist/cli/init.d.ts +1 -1
- package/dist/cli/init.js +2 -2
- package/dist/cli/main.js +2 -329
- package/dist/cli/run.d.ts +18 -0
- package/dist/cli/run.js +283 -0
- package/dist/commands/build.d.ts +51 -0
- package/dist/commands/build.js +39 -0
- package/dist/commands/check.d.ts +8 -0
- package/dist/commands/check.js +5 -0
- package/dist/commands/diff.d.ts +29 -0
- package/dist/commands/diff.js +25 -0
- package/dist/commands/export.d.ts +41 -0
- package/dist/commands/export.js +47 -0
- package/dist/commands/history.d.ts +18 -0
- package/dist/commands/history.js +9 -0
- package/dist/commands/index.d.ts +11 -0
- package/dist/commands/index.js +11 -0
- package/dist/core/compare.d.ts +2 -13
- package/dist/core/compare.js +2 -35
- package/dist/core/index.d.ts +3 -6
- package/dist/core/index.js +3 -6
- package/dist/core/load.d.ts +0 -2
- package/dist/core/load.js +5 -6
- package/dist/core/rules.d.ts +10 -0
- package/dist/core/rules.js +186 -7
- package/dist/core/views/compare.d.ts +12 -0
- package/dist/core/views/compare.js +37 -0
- package/dist/core/{deployment-views.d.ts → views/deployment.d.ts} +4 -5
- package/dist/core/{deployment-views.js → views/deployment.js} +5 -7
- package/dist/core/{dynamic-views.d.ts → views/dynamic.d.ts} +1 -3
- package/dist/core/{dynamic-views.js → views/dynamic.js} +4 -8
- package/dist/core/views/generated.d.ts +18 -0
- package/dist/core/views/generated.js +92 -0
- package/dist/core/views/ids.d.ts +36 -0
- package/dist/core/views/ids.js +51 -0
- package/dist/core/views/index.d.ts +13 -0
- package/dist/core/views/index.js +12 -0
- package/dist/core/views/lens.d.ts +27 -0
- package/dist/core/views/lens.js +112 -0
- package/dist/core/views/model.d.ts +21 -0
- package/dist/core/views/model.js +69 -0
- package/dist/core/views/resolve.d.ts +42 -0
- package/dist/core/views/resolve.js +81 -0
- package/dist/core/{save-as-view.d.ts → views/save-as-view.d.ts} +2 -2
- package/dist/core/{save-as-view.js → views/save-as-view.js} +13 -10
- package/dist/core/{saved-views.d.ts → views/saved.d.ts} +4 -18
- package/dist/core/{saved-views.js → views/saved.js} +8 -103
- package/dist/core/views/types.d.ts +91 -0
- package/dist/core/views/types.js +2 -0
- package/dist/core/workspace-files.d.ts +13 -0
- package/dist/core/workspace-files.js +20 -0
- package/dist/git.d.ts +2 -0
- package/dist/git.js +14 -4
- package/dist/history/git.d.ts +0 -10
- package/dist/history/git.js +1 -30
- package/dist/history/index.d.ts +15 -31
- package/dist/history/index.js +47 -43
- package/dist/history/points.d.ts +23 -0
- package/dist/history/points.js +28 -0
- package/dist/history/site.d.ts +30 -0
- package/dist/history/site.js +37 -0
- package/dist/mcp/errors.d.ts +37 -0
- package/dist/mcp/errors.js +35 -0
- package/dist/mcp/history.d.ts +4 -4
- package/dist/mcp/history.js +56 -116
- package/dist/mcp/index.d.ts +2 -1
- package/dist/mcp/index.js +1 -0
- package/dist/mcp/server.d.ts +1 -2
- package/dist/mcp/server.js +30 -29
- package/dist/mcp/site.d.ts +12 -0
- package/dist/mcp/site.js +46 -0
- package/dist/mcp/source.d.ts +14 -7
- package/dist/mcp/source.js +25 -99
- package/dist/render/layout.d.ts +20 -3
- package/dist/render/layout.js +49 -12
- package/dist/render/sequence-svg.d.ts +1 -1
- package/dist/render/sequence.d.ts +1 -1
- package/dist/render/svg.d.ts +1 -1
- package/dist/render/svg.js +4 -4
- package/dist/revisions/find.d.ts +64 -0
- package/dist/revisions/find.js +85 -0
- package/dist/revisions/index.d.ts +57 -0
- package/dist/revisions/index.js +24 -0
- package/dist/revisions/site.d.ts +82 -0
- package/dist/revisions/site.js +157 -0
- package/dist/revisions/text.d.ts +8 -0
- package/dist/revisions/text.js +17 -0
- package/dist/revisions/touching.d.ts +7 -0
- package/dist/revisions/touching.js +7 -0
- package/dist/schema/adr.js +18 -13
- package/dist/schema/workspace.js +226 -130
- package/dist/viewer/assets/index-C0lIIm8V.js +138 -0
- package/dist/viewer/assets/index-YFA-pYjQ.css +1 -0
- package/dist/viewer/assets/{layout.worker-Bg-OaLVN.js → layout.worker-BRHAGJrD.js} +1 -1
- package/dist/viewer/assets/{png-BDKIXtm5.js → png-DMwnpRCt.js} +1 -1
- package/dist/viewer/assets/{svg-Bulv5YWn.js → svg-DN6lMeZo.js} +2 -2
- package/dist/viewer/index.html +2 -2
- package/dist/workspace/index.d.ts +37 -0
- package/dist/workspace/index.js +52 -0
- package/guide/SKILL.md +1 -1
- package/guide/topics/bootstrap.md +1 -1
- package/guide/topics/relationships.md +1 -1
- package/package.json +4 -3
- package/schemas/adr.schema.json +18 -15
- package/schemas/model.schema.json +637 -1144
- package/schemas/project.schema.json +8 -4
- package/schemas/workspace.schema.json +39 -20
- package/dist/core/views.d.ts +0 -126
- package/dist/core/views.js +0 -217
- package/dist/viewer/assets/index-DvKgCpBr.css +0 -1
- package/dist/viewer/assets/index-gucix3xm.js +0 -113
- /package/dist/{history → revisions}/migrate.d.ts +0 -0
- /package/dist/{history → revisions}/migrate.js +0 -0
package/README.md
CHANGED
|
@@ -32,29 +32,85 @@ The questions it's built to answer:
|
|
|
32
32
|
|
|
33
33
|
## Quick start
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
From an empty repo to your first System in the viewer, in about five minutes. Archidocs needs Node.js 22.18 or later.
|
|
36
|
+
|
|
37
|
+
**1. Install the CLI.** With pnpm, use `pnpm add --global archidocs`. To install nothing, put `npx` before each command, as in `npx archidocs check`.
|
|
36
38
|
|
|
37
39
|
```bash
|
|
38
40
|
npm install --global archidocs
|
|
39
41
|
```
|
|
40
42
|
|
|
41
|
-
In the repo that will hold
|
|
43
|
+
**2. Create a Workspace.** In the repo that will hold it (a new, empty one is fine):
|
|
42
44
|
|
|
43
45
|
```bash
|
|
44
46
|
archidocs init
|
|
45
47
|
```
|
|
46
48
|
|
|
47
|
-
This writes `archidocs/workspace.yaml`, adds the `.archidocs/` cache to `.gitignore`, and installs an authoring skill for coding agents.
|
|
49
|
+
This writes a starter `archidocs/workspace.yaml`, adds the `.archidocs/` cache to `.gitignore`, and installs an authoring skill for coding agents.
|
|
50
|
+
|
|
51
|
+
**3. Add three files.** Replace `archidocs/workspace.yaml`, which defines Teams and Environments, with:
|
|
52
|
+
|
|
53
|
+
```yaml
|
|
54
|
+
teams:
|
|
55
|
+
storefront:
|
|
56
|
+
name: Storefront
|
|
57
|
+
environments:
|
|
58
|
+
prod:
|
|
59
|
+
name: Production
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Give the Team a Project folder, marked by `archidocs/shop/project.yaml`:
|
|
63
|
+
|
|
64
|
+
```yaml
|
|
65
|
+
id: shop
|
|
66
|
+
name: Shop
|
|
67
|
+
owner: storefront
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Declare a Person, and a System that holds two Services, in `archidocs/shop/model.yaml`:
|
|
71
|
+
|
|
72
|
+
```yaml
|
|
73
|
+
people:
|
|
74
|
+
shopper:
|
|
75
|
+
name: Shopper
|
|
76
|
+
relationships:
|
|
77
|
+
- to: web
|
|
78
|
+
description: Browses and buys using
|
|
79
|
+
systems:
|
|
80
|
+
online-shop:
|
|
81
|
+
name: Online Shop
|
|
82
|
+
services:
|
|
83
|
+
web:
|
|
84
|
+
name: Web
|
|
85
|
+
technology: TypeScript, React
|
|
86
|
+
relationships:
|
|
87
|
+
- to: api
|
|
88
|
+
description: Places orders through
|
|
89
|
+
technology: JSON/HTTPS
|
|
90
|
+
api:
|
|
91
|
+
name: API
|
|
92
|
+
technology: Node.js
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
**4. Check it.**
|
|
48
96
|
|
|
49
97
|
```bash
|
|
50
98
|
archidocs check
|
|
51
99
|
```
|
|
52
100
|
|
|
101
|
+
```text
|
|
102
|
+
0 errors, 0 warnings
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**5. Open the viewer.**
|
|
106
|
+
|
|
53
107
|
```bash
|
|
54
108
|
archidocs dev
|
|
55
109
|
```
|
|
56
110
|
|
|
57
|
-
|
|
111
|
+
Open <http://localhost:4321>. The viewer starts on the C2 Landscape, which shows the Shopper and the Online Shop; select the arrow button on the Online Shop box to see the two Services inside it. The viewer reloads as you edit the files.
|
|
112
|
+
|
|
113
|
+
The finished Workspace is in [examples/quick-start](examples/quick-start).
|
|
58
114
|
|
|
59
115
|
## The Model
|
|
60
116
|
|
|
@@ -167,15 +223,8 @@ archidocs mcp --workspace ./archidocs
|
|
|
167
223
|
|
|
168
224
|
## Development
|
|
169
225
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
pnpm dev
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
`pnpm test` runs the unit tests, `pnpm test:e2e` the Playwright tests, and `pnpm typecheck` and `pnpm lint` the static checks. Design and product notes are in [PRODUCT.md](PRODUCT.md) and [DESIGN.md](DESIGN.md).
|
|
226
|
+
Run `pnpm install`, then `pnpm dev` to serve the viewer and `pnpm test` to run the tests.
|
|
227
|
+
To run the other checks, work on the docs site or open a pull request, see [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
179
228
|
|
|
180
229
|
## License
|
|
181
230
|
|
package/dist/cli/commands.d.ts
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The CLI's commands and flags, described once. The CLI parses each
|
|
3
3
|
* command's arguments with these flags and prints its usage text from them;
|
|
4
|
-
* the docs site generates its CLI reference from them and
|
|
5
|
-
* `archidocs …` line in a page with
|
|
6
|
-
* module has no side effects and pulls in
|
|
4
|
+
* the docs site generates its CLI reference from them, examples and exit
|
|
5
|
+
* codes included, and checks every `archidocs …` line in a page with
|
|
6
|
+
* `parseCommandLine`. Importing this module has no side effects and pulls in
|
|
7
|
+
* nothing but `node:util`.
|
|
7
8
|
*/
|
|
8
9
|
import { parseArgs } from "node:util";
|
|
10
|
+
/** The CLI's exit codes: 0 no errors, 1 errors found (or any warning with `check --strict`), 2 could not run. */
|
|
11
|
+
export declare const EXIT: {
|
|
12
|
+
readonly ok: 0;
|
|
13
|
+
readonly foundErrors: 1;
|
|
14
|
+
readonly couldNotRun: 2;
|
|
15
|
+
};
|
|
16
|
+
/** What a command that needs a Workspace says, exiting 2, when the search for one finds none. */
|
|
17
|
+
export declare const NO_WORKSPACE = "No workspace.yaml found in this folder, its archidocs/ folder, or any folder above.";
|
|
9
18
|
/** One flag. Its key in `flags` is its name, without the leading `--`. */
|
|
10
19
|
export interface FlagDefinition {
|
|
11
20
|
readonly type: "string" | "boolean";
|
|
@@ -22,6 +31,19 @@ export interface ArgumentDefinition {
|
|
|
22
31
|
readonly name: string;
|
|
23
32
|
readonly description: string;
|
|
24
33
|
}
|
|
34
|
+
/** One real command line for the reference, checked like any other with `parseCommandLine`. */
|
|
35
|
+
export interface ExampleDefinition {
|
|
36
|
+
/** The whole line as typed, starting with `archidocs`. */
|
|
37
|
+
readonly command: string;
|
|
38
|
+
/** One line on what it does. */
|
|
39
|
+
readonly description: string;
|
|
40
|
+
}
|
|
41
|
+
/** One exit code a command can end with. */
|
|
42
|
+
export interface ExitCodeDefinition {
|
|
43
|
+
readonly code: (typeof EXIT)[keyof typeof EXIT];
|
|
44
|
+
/** When the command ends with it. */
|
|
45
|
+
readonly meaning: string;
|
|
46
|
+
}
|
|
25
47
|
export interface CommandDefinition {
|
|
26
48
|
/** The words after `archidocs`: `check`, or `history build` for a subcommand. */
|
|
27
49
|
readonly name: string;
|
|
@@ -31,6 +53,12 @@ export interface CommandDefinition {
|
|
|
31
53
|
readonly description: string;
|
|
32
54
|
readonly arguments: readonly ArgumentDefinition[];
|
|
33
55
|
readonly flags: Readonly<Record<string, FlagDefinition>>;
|
|
56
|
+
/** At least one, the plainest first. */
|
|
57
|
+
readonly examples: readonly [ExampleDefinition, ...ExampleDefinition[]];
|
|
58
|
+
/** Every exit code the command itself ends with, lowest first. */
|
|
59
|
+
readonly exitCodes: readonly [ExitCodeDefinition, ...ExitCodeDefinition[]];
|
|
60
|
+
/** For a command that serves until it is stopped: how it ends, when no exit code is its own. */
|
|
61
|
+
readonly exitNote?: string;
|
|
34
62
|
}
|
|
35
63
|
export declare const commands: {
|
|
36
64
|
readonly version: {
|
|
@@ -46,6 +74,20 @@ export declare const commands: {
|
|
|
46
74
|
readonly description: "Print a line of text, or a JSON object with `version` and `schemaVersion`.";
|
|
47
75
|
};
|
|
48
76
|
};
|
|
77
|
+
readonly examples: readonly [{
|
|
78
|
+
readonly command: "archidocs version";
|
|
79
|
+
readonly description: "Print both versions as one line of text.";
|
|
80
|
+
}, {
|
|
81
|
+
readonly command: "archidocs version --format json";
|
|
82
|
+
readonly description: "Print them as JSON, for a CI cache key that changes when the Bundle schemaVersion does.";
|
|
83
|
+
}];
|
|
84
|
+
readonly exitCodes: readonly [{
|
|
85
|
+
readonly code: 0;
|
|
86
|
+
readonly meaning: "The version was printed.";
|
|
87
|
+
}, {
|
|
88
|
+
readonly code: 2;
|
|
89
|
+
readonly meaning: "It could not run: an unknown flag, a flag missing its value, or an unknown format.";
|
|
90
|
+
}];
|
|
49
91
|
};
|
|
50
92
|
readonly init: {
|
|
51
93
|
readonly name: "init";
|
|
@@ -64,6 +106,20 @@ export declare const commands: {
|
|
|
64
106
|
readonly description: "With `--skill`: the Workspace checkout that the printed MCP command points at.";
|
|
65
107
|
};
|
|
66
108
|
};
|
|
109
|
+
readonly examples: readonly [{
|
|
110
|
+
readonly command: "archidocs init";
|
|
111
|
+
readonly description: "Write `archidocs/workspace.yaml` if the repo has no Workspace yet, and install the agent skill.";
|
|
112
|
+
}, {
|
|
113
|
+
readonly command: "archidocs init --skill --workspace ../architecture/archidocs";
|
|
114
|
+
readonly description: "In a code repo, install only the agent skill, and print the MCP command for the Workspace checked out beside it.";
|
|
115
|
+
}];
|
|
116
|
+
readonly exitCodes: readonly [{
|
|
117
|
+
readonly code: 0;
|
|
118
|
+
readonly meaning: "The Workspace and the agent skill are set up, or already were. Each file written or updated is printed.";
|
|
119
|
+
}, {
|
|
120
|
+
readonly code: 2;
|
|
121
|
+
readonly meaning: "It could not run: an unknown flag, a flag missing its value, `--workspace` without `--skill`, or a file it could not write.";
|
|
122
|
+
}];
|
|
67
123
|
};
|
|
68
124
|
readonly guide: {
|
|
69
125
|
readonly name: "guide";
|
|
@@ -74,11 +130,25 @@ export declare const commands: {
|
|
|
74
130
|
readonly description: "A task topic; with none, the guide and the list of topics.";
|
|
75
131
|
}];
|
|
76
132
|
readonly flags: {};
|
|
133
|
+
readonly examples: readonly [{
|
|
134
|
+
readonly command: "archidocs guide";
|
|
135
|
+
readonly description: "Print the guide: the Model in brief, the edit loop and the list of task topics.";
|
|
136
|
+
}, {
|
|
137
|
+
readonly command: "archidocs guide add-service";
|
|
138
|
+
readonly description: "Print one task topic, here how to add a Service.";
|
|
139
|
+
}];
|
|
140
|
+
readonly exitCodes: readonly [{
|
|
141
|
+
readonly code: 0;
|
|
142
|
+
readonly meaning: "The guide or the topic was printed.";
|
|
143
|
+
}, {
|
|
144
|
+
readonly code: 2;
|
|
145
|
+
readonly meaning: "It could not run: an unknown topic (the message lists the topics there are), more than one topic, or any flag, since it takes none.";
|
|
146
|
+
}];
|
|
77
147
|
};
|
|
78
148
|
readonly check: {
|
|
79
149
|
readonly name: "check";
|
|
80
150
|
readonly synopsis: readonly ["check [--format text|json|github] [--strict]"];
|
|
81
|
-
readonly description: "Validate the Workspace found from the current folder
|
|
151
|
+
readonly description: "Validate the Workspace found from the current folder and print each issue with its file, line and rule.";
|
|
82
152
|
readonly arguments: readonly [];
|
|
83
153
|
readonly flags: {
|
|
84
154
|
readonly format: {
|
|
@@ -93,6 +163,29 @@ export declare const commands: {
|
|
|
93
163
|
readonly description: "Exit 1 on warnings too, not only on errors.";
|
|
94
164
|
};
|
|
95
165
|
};
|
|
166
|
+
readonly examples: readonly [{
|
|
167
|
+
readonly command: "archidocs check";
|
|
168
|
+
readonly description: "Validate the Workspace and print its issues grouped by file, then a count and a link to each rule's page.";
|
|
169
|
+
}, {
|
|
170
|
+
readonly command: "archidocs check --strict";
|
|
171
|
+
readonly description: "Fail on warnings as well as errors, for a CI job that keeps the Workspace clean.";
|
|
172
|
+
}, {
|
|
173
|
+
readonly command: "archidocs check --format github";
|
|
174
|
+
readonly description: "Print each issue as a GitHub Actions annotation, which a pull request shows on the line the issue is about.";
|
|
175
|
+
}, {
|
|
176
|
+
readonly command: "archidocs check --format json";
|
|
177
|
+
readonly description: "Print the issues and a count of errors and warnings as JSON, for a script.";
|
|
178
|
+
}];
|
|
179
|
+
readonly exitCodes: readonly [{
|
|
180
|
+
readonly code: 0;
|
|
181
|
+
readonly meaning: "No errors. Warnings are printed and still exit 0, unless `--strict` is given.";
|
|
182
|
+
}, {
|
|
183
|
+
readonly code: 1;
|
|
184
|
+
readonly meaning: "The Workspace has at least one error; with `--strict`, at least one error or warning.";
|
|
185
|
+
}, {
|
|
186
|
+
readonly code: 2;
|
|
187
|
+
readonly meaning: "It could not run: an unknown flag, a flag missing its value, an unknown format, or no Workspace found.";
|
|
188
|
+
}];
|
|
96
189
|
};
|
|
97
190
|
readonly build: {
|
|
98
191
|
readonly name: "build";
|
|
@@ -129,11 +222,34 @@ export declare const commands: {
|
|
|
129
222
|
readonly description: "With `--preview`: the base branch, read from `origin/<branch>` without fetching.";
|
|
130
223
|
};
|
|
131
224
|
};
|
|
225
|
+
readonly examples: readonly [{
|
|
226
|
+
readonly command: "archidocs build --out site";
|
|
227
|
+
readonly description: "Write the viewer, the latest Bundle and the past Revisions' Bundles into `site/`, ready for any static host.";
|
|
228
|
+
}, {
|
|
229
|
+
readonly command: "archidocs build --out site --keep 50";
|
|
230
|
+
readonly description: "Keep Bundles for the latest 50 past Revisions only, and for every tagged one.";
|
|
231
|
+
}, {
|
|
232
|
+
readonly command: "archidocs build --bundle-only --out public";
|
|
233
|
+
readonly description: "Write only `public/workspace.bundle.json`, for `mcp --bundle` or a script to read.";
|
|
234
|
+
}, {
|
|
235
|
+
readonly command: "archidocs build --preview --base main --out preview";
|
|
236
|
+
readonly description: "Write a PR preview site that opens on Compare, from `origin/main` to the pull request checked out.";
|
|
237
|
+
}];
|
|
238
|
+
readonly exitCodes: readonly [{
|
|
239
|
+
readonly code: 0;
|
|
240
|
+
readonly meaning: "The site, the Bundle or the preview site was written.";
|
|
241
|
+
}, {
|
|
242
|
+
readonly code: 1;
|
|
243
|
+
readonly meaning: "The Workspace has errors. They are printed as `check` prints them, and nothing is written.";
|
|
244
|
+
}, {
|
|
245
|
+
readonly code: 2;
|
|
246
|
+
readonly meaning: "It could not run: an unknown flag, a flag missing its value, flags that don't go together, a `--keep` that is not a count or `all`, no Workspace found, or with `--preview` a Workspace outside git or a base branch that is not in the checkout.";
|
|
247
|
+
}];
|
|
132
248
|
};
|
|
133
249
|
readonly dev: {
|
|
134
250
|
readonly name: "dev";
|
|
135
251
|
readonly synopsis: readonly ["dev [--workspace <dir>] [--port <n>] [--host <host>]"];
|
|
136
|
-
readonly description: "Serve the viewer locally and reload it
|
|
252
|
+
readonly description: "Serve the viewer locally and reload it when a `.yaml` or `.md` file in the Workspace changes.";
|
|
137
253
|
readonly arguments: readonly [];
|
|
138
254
|
readonly flags: {
|
|
139
255
|
readonly workspace: {
|
|
@@ -155,6 +271,24 @@ export declare const commands: {
|
|
|
155
271
|
readonly description: "The address to listen on.";
|
|
156
272
|
};
|
|
157
273
|
};
|
|
274
|
+
readonly examples: readonly [{
|
|
275
|
+
readonly command: "archidocs dev";
|
|
276
|
+
readonly description: "Serve the viewer for the Workspace found from the current folder, and print its address.";
|
|
277
|
+
}, {
|
|
278
|
+
readonly command: "archidocs dev --port 4000";
|
|
279
|
+
readonly description: "Serve on another port, for when the default one is in use.";
|
|
280
|
+
}, {
|
|
281
|
+
readonly command: "archidocs dev --workspace ../architecture";
|
|
282
|
+
readonly description: "Serve the Workspace found from another folder, such as a checkout of the Workspace repo beside a code repo.";
|
|
283
|
+
}, {
|
|
284
|
+
readonly command: "archidocs dev --host 0.0.0.0";
|
|
285
|
+
readonly description: "Listen on every network interface, so that other machines can open the viewer.";
|
|
286
|
+
}];
|
|
287
|
+
readonly exitCodes: readonly [{
|
|
288
|
+
readonly code: 2;
|
|
289
|
+
readonly meaning: "It could not start: an unknown flag, a flag missing its value, a `--port` that is not a port or is in use, or no Workspace found.";
|
|
290
|
+
}];
|
|
291
|
+
readonly exitNote: "Once it is serving, `dev` runs until you stop it with Ctrl+C. A Workspace with errors does not stop it: it prints them and keeps serving. The interrupt ends the process, so the exit status is the shell's for an interrupted command (130 in most shells), not a code of its own.";
|
|
158
292
|
};
|
|
159
293
|
readonly export: {
|
|
160
294
|
readonly name: "export";
|
|
@@ -201,6 +335,32 @@ export declare const commands: {
|
|
|
201
335
|
readonly description: "The line under the title, such as `Big Bank · v1.2.0`, in place of the source line.";
|
|
202
336
|
};
|
|
203
337
|
};
|
|
338
|
+
readonly examples: readonly [{
|
|
339
|
+
readonly command: "archidocs export c2";
|
|
340
|
+
readonly description: "Write the C2 Generated View, every System and Service, to `c2.svg` in the current folder.";
|
|
341
|
+
}, {
|
|
342
|
+
readonly command: "archidocs export c2/digital:internet-banking --direction TB --theme dark";
|
|
343
|
+
readonly description: "Write one System's Services, the System named by its Qualified id, laid out top to bottom in the dark palette.";
|
|
344
|
+
}, {
|
|
345
|
+
readonly command: "archidocs export payments:make-a-payment --format png --out make-a-payment.png";
|
|
346
|
+
readonly description: "Write a Saved View, here a Dynamic View, as a PNG.";
|
|
347
|
+
}, {
|
|
348
|
+
readonly command: "archidocs export --all-saved --out views";
|
|
349
|
+
readonly description: "Write every Saved View into `views/`, one picture each, named by its id.";
|
|
350
|
+
}, {
|
|
351
|
+
readonly command: "archidocs export deployment/prod --label \"Big Bank · v1.2.0\"";
|
|
352
|
+
readonly description: "Write an Environment's Deployment View with a line of your own under the title, in place of the commit and date.";
|
|
353
|
+
}];
|
|
354
|
+
readonly exitCodes: readonly [{
|
|
355
|
+
readonly code: 0;
|
|
356
|
+
readonly meaning: "Each picture was written, and its path printed.";
|
|
357
|
+
}, {
|
|
358
|
+
readonly code: 1;
|
|
359
|
+
readonly meaning: "The Workspace has errors. They are printed as `check` prints them, and nothing is exported.";
|
|
360
|
+
}, {
|
|
361
|
+
readonly code: 2;
|
|
362
|
+
readonly meaning: "It could not run: an unknown flag, a flag missing its value, an unknown format, direction or theme, an unknown View, a View together with `--all-saved` or neither of them, `--all-saved` without `--out`, or no Workspace found.";
|
|
363
|
+
}];
|
|
204
364
|
};
|
|
205
365
|
readonly diff: {
|
|
206
366
|
readonly name: "diff";
|
|
@@ -208,10 +368,10 @@ export declare const commands: {
|
|
|
208
368
|
readonly description: "Show what changed in the Model between two points in the Workspace's history.";
|
|
209
369
|
readonly arguments: readonly [{
|
|
210
370
|
readonly name: "<from>";
|
|
211
|
-
readonly description: "A git ref, or a date, which
|
|
371
|
+
readonly description: "A git ref, or a date or time, which names the last Revision at or before it.";
|
|
212
372
|
}, {
|
|
213
373
|
readonly name: "[<to>]";
|
|
214
|
-
readonly description: "A ref or
|
|
374
|
+
readonly description: "A ref, date or time like `<from>`; with none, the working tree.";
|
|
215
375
|
}];
|
|
216
376
|
readonly flags: {
|
|
217
377
|
readonly format: {
|
|
@@ -221,20 +381,57 @@ export declare const commands: {
|
|
|
221
381
|
readonly description: "Print the changes as text, JSON, or Markdown for a PR comment.";
|
|
222
382
|
};
|
|
223
383
|
};
|
|
384
|
+
readonly examples: readonly [{
|
|
385
|
+
readonly command: "archidocs diff HEAD";
|
|
386
|
+
readonly description: "Show what your uncommitted edits change, against the last commit.";
|
|
387
|
+
}, {
|
|
388
|
+
readonly command: "archidocs diff origin/main HEAD";
|
|
389
|
+
readonly description: "Show what a branch changes against the default branch, as a reviewer of its pull request will see it.";
|
|
390
|
+
}, {
|
|
391
|
+
readonly command: "archidocs diff 2026-01-01 2026-06-30";
|
|
392
|
+
readonly description: "Show the Changes between two dates; each date names the last Revision at or before it.";
|
|
393
|
+
}, {
|
|
394
|
+
readonly command: "archidocs diff origin/main HEAD --format markdown";
|
|
395
|
+
readonly description: "Write the Changes as Markdown, to post as a pull request comment.";
|
|
396
|
+
}];
|
|
397
|
+
readonly exitCodes: readonly [{
|
|
398
|
+
readonly code: 0;
|
|
399
|
+
readonly meaning: "The Changes were printed. It exits 0 whether or not anything changed, so a script that asks whether the Model changed must read the output, not the exit code.";
|
|
400
|
+
}, {
|
|
401
|
+
readonly code: 2;
|
|
402
|
+
readonly meaning: "It could not run: an unknown flag, a flag missing its value, an unknown format, no point or more than two, an unknown ref or date, a date before the first Revision, a sha prefix of several Revisions, no Workspace found, or a Workspace outside git.";
|
|
403
|
+
}];
|
|
224
404
|
};
|
|
225
405
|
readonly "history build": {
|
|
226
406
|
readonly name: "history build";
|
|
227
|
-
readonly synopsis: readonly ["history build [--since <ref|date>]"];
|
|
407
|
+
readonly synopsis: readonly ["history build [--since <ref|date|time>]"];
|
|
228
408
|
readonly description: "Build and cache the Bundle of every past Revision, so later builds and diffs don't have to. Safe to re-run.";
|
|
229
409
|
readonly arguments: readonly [];
|
|
230
410
|
readonly flags: {
|
|
231
411
|
readonly since: {
|
|
232
412
|
readonly type: "string";
|
|
233
|
-
readonly value: "<ref|date>";
|
|
413
|
+
readonly value: "<ref|date|time>";
|
|
234
414
|
readonly defaultText: "every Revision";
|
|
235
|
-
readonly description: "Only build Revisions at or after this ref's commit time
|
|
415
|
+
readonly description: "Only build Revisions at or after this ref's commit time, the start of this date, or this time (UTC unless it gives a zone).";
|
|
236
416
|
};
|
|
237
417
|
};
|
|
418
|
+
readonly examples: readonly [{
|
|
419
|
+
readonly command: "archidocs history build";
|
|
420
|
+
readonly description: "Build and cache the Bundle of every past Revision, so the next `build` or `diff` reads them from the cache.";
|
|
421
|
+
}, {
|
|
422
|
+
readonly command: "archidocs history build --since 2026-01-01";
|
|
423
|
+
readonly description: "Only build the Revisions from the start of that date on.";
|
|
424
|
+
}, {
|
|
425
|
+
readonly command: "archidocs history build --since v1.0.0";
|
|
426
|
+
readonly description: "Only build the Revisions at or after a tag's commit.";
|
|
427
|
+
}];
|
|
428
|
+
readonly exitCodes: readonly [{
|
|
429
|
+
readonly code: 0;
|
|
430
|
+
readonly meaning: "Every Revision asked for is in the cache. It prints how many it built and how many were already built.";
|
|
431
|
+
}, {
|
|
432
|
+
readonly code: 2;
|
|
433
|
+
readonly meaning: "It could not run: an unknown flag, a flag missing its value, an unknown `--since` ref or date, no Workspace found, or a Workspace outside git.";
|
|
434
|
+
}];
|
|
238
435
|
};
|
|
239
436
|
readonly mcp: {
|
|
240
437
|
readonly name: "mcp";
|
|
@@ -281,6 +478,30 @@ export declare const commands: {
|
|
|
281
478
|
readonly description: "With `--http`: allow the write tools, which are off over HTTP by default.";
|
|
282
479
|
};
|
|
283
480
|
};
|
|
481
|
+
readonly examples: readonly [{
|
|
482
|
+
readonly command: "archidocs mcp --workspace archidocs";
|
|
483
|
+
readonly description: "Serve a Workspace checkout over stdio, with the read and write tools. This is the command to register with a coding agent, which starts it from the repo root.";
|
|
484
|
+
}, {
|
|
485
|
+
readonly command: "archidocs mcp --bundle https://big-bank.archidocs.dev/workspace.bundle.json";
|
|
486
|
+
readonly description: "Serve a published Bundle, here the Big Bank demo's, with the read tools only.";
|
|
487
|
+
}, {
|
|
488
|
+
readonly command: "archidocs mcp --bundle https://architecture.example.com/workspace.bundle.json --viewer-url https://architecture.example.com/";
|
|
489
|
+
readonly description: "Serve your own published Bundle, with links to its viewer in the tool results.";
|
|
490
|
+
}, {
|
|
491
|
+
readonly command: "archidocs mcp --http --port 3737 --workspace archidocs";
|
|
492
|
+
readonly description: "Serve Streamable HTTP at `/mcp` on a loopback address, with the write tools off.";
|
|
493
|
+
}, {
|
|
494
|
+
readonly command: "archidocs mcp --http --allow-writes --workspace archidocs";
|
|
495
|
+
readonly description: "Serve over HTTP with the write tools on.";
|
|
496
|
+
}];
|
|
497
|
+
readonly exitCodes: readonly [{
|
|
498
|
+
readonly code: 0;
|
|
499
|
+
readonly meaning: "Over stdio, the client closed the connection.";
|
|
500
|
+
}, {
|
|
501
|
+
readonly code: 2;
|
|
502
|
+
readonly meaning: "It could not start: an unknown flag, a flag missing its value, flags that don't go together, a `--viewer-url` that is not a URL, a `--port` that is not a port or is in use, a `--host` that is not a loopback address, or no Workspace found when `--bundle` is not given.";
|
|
503
|
+
}];
|
|
504
|
+
readonly exitNote: "With `--http`, `mcp` runs until you stop it with Ctrl+C. The interrupt ends the process, so the exit status is the shell's for an interrupted command (130 in most shells), not a code of its own. A Bundle that can't be read does not stop the server: each tool call answers `source_unavailable`, and the next call tries again.";
|
|
284
505
|
};
|
|
285
506
|
};
|
|
286
507
|
export type CommandName = keyof typeof commands;
|