archidocs 0.0.0-stage → 1.2.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/LICENSE +21 -0
- package/README.md +181 -2
- package/dist/cli/commands.d.ts +322 -0
- package/dist/cli/commands.js +174 -0
- package/dist/cli/dev.d.ts +31 -0
- package/dist/cli/dev.js +156 -0
- package/dist/cli/diff-format.d.ts +9 -0
- package/dist/cli/diff-format.js +50 -0
- package/dist/cli/format.d.ts +15 -0
- package/dist/cli/format.js +64 -0
- package/dist/cli/init.d.ts +17 -0
- package/dist/cli/init.js +82 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +330 -0
- package/dist/core/adr.d.ts +28 -0
- package/dist/core/adr.js +88 -0
- package/dist/core/adrs.d.ts +20 -0
- package/dist/core/adrs.js +86 -0
- package/dist/core/catalogue.d.ts +7 -0
- package/dist/core/catalogue.js +35 -0
- package/dist/core/compare.d.ts +21 -0
- package/dist/core/compare.js +62 -0
- package/dist/core/deployment-views.d.ts +28 -0
- package/dist/core/deployment-views.js +108 -0
- package/dist/core/deployments.d.ts +18 -0
- package/dist/core/deployments.js +21 -0
- package/dist/core/diff.d.ts +44 -0
- package/dist/core/diff.js +138 -0
- package/dist/core/dynamic-views.d.ts +73 -0
- package/dist/core/dynamic-views.js +162 -0
- package/dist/core/files.d.ts +2 -0
- package/dist/core/files.js +1 -0
- package/dist/core/fs.d.ts +19 -0
- package/dist/core/fs.js +21 -0
- package/dist/core/history-scope.d.ts +40 -0
- package/dist/core/history-scope.js +63 -0
- package/dist/core/impact.d.ts +34 -0
- package/dist/core/impact.js +62 -0
- package/dist/core/index.d.ts +20 -0
- package/dist/core/index.js +18 -0
- package/dist/core/load.d.ts +32 -0
- package/dist/core/load.js +465 -0
- package/dist/core/model.d.ts +150 -0
- package/dist/core/model.js +1 -0
- package/dist/core/ownership.d.ts +34 -0
- package/dist/core/ownership.js +65 -0
- package/dist/core/paths.d.ts +47 -0
- package/dist/core/paths.js +115 -0
- package/dist/core/query.d.ts +51 -0
- package/dist/core/query.js +77 -0
- package/dist/core/refs.d.ts +31 -0
- package/dist/core/refs.js +50 -0
- package/dist/core/rules.d.ts +41 -0
- package/dist/core/rules.js +1033 -0
- package/dist/core/save-as-view.d.ts +45 -0
- package/dist/core/save-as-view.js +114 -0
- package/dist/core/saved-views.d.ts +48 -0
- package/dist/core/saved-views.js +243 -0
- package/dist/core/schema-check.d.ts +13 -0
- package/dist/core/schema-check.js +79 -0
- package/dist/core/search.d.ts +27 -0
- package/dist/core/search.js +63 -0
- package/dist/core/suggest.d.ts +3 -0
- package/dist/core/suggest.js +30 -0
- package/dist/core/views.d.ts +126 -0
- package/dist/core/views.js +217 -0
- package/dist/core/yaml.d.ts +16 -0
- package/dist/core/yaml.js +52 -0
- package/dist/git.d.ts +7 -0
- package/dist/git.js +23 -0
- package/dist/guide/index.d.ts +53 -0
- package/dist/guide/index.js +57 -0
- package/dist/history/git.d.ts +39 -0
- package/dist/history/git.js +126 -0
- package/dist/history/index.d.ts +118 -0
- package/dist/history/index.js +223 -0
- package/dist/history/migrate.d.ts +16 -0
- package/dist/history/migrate.js +30 -0
- package/dist/mcp/history.d.ts +36 -0
- package/dist/mcp/history.js +175 -0
- package/dist/mcp/http.d.ts +23 -0
- package/dist/mcp/http.js +85 -0
- package/dist/mcp/index.d.ts +3 -0
- package/dist/mcp/index.js +3 -0
- package/dist/mcp/server.d.ts +54 -0
- package/dist/mcp/server.js +824 -0
- package/dist/mcp/source.d.ts +50 -0
- package/dist/mcp/source.js +132 -0
- package/dist/mcp/writes.d.ts +10 -0
- package/dist/mcp/writes.js +267 -0
- package/dist/render/font.d.ts +14 -0
- package/dist/render/font.js +11 -0
- package/dist/render/index.d.ts +8 -0
- package/dist/render/index.js +8 -0
- package/dist/render/layout.d.ts +53 -0
- package/dist/render/layout.js +199 -0
- package/dist/render/node.d.ts +3 -0
- package/dist/render/node.js +8 -0
- package/dist/render/png.d.ts +11 -0
- package/dist/render/png.js +29 -0
- package/dist/render/sequence-svg.d.ts +33 -0
- package/dist/render/sequence-svg.js +98 -0
- package/dist/render/sequence.d.ts +103 -0
- package/dist/render/sequence.js +142 -0
- package/dist/render/svg.d.ts +36 -0
- package/dist/render/svg.js +222 -0
- package/dist/render/teams.d.ts +12 -0
- package/dist/render/teams.js +31 -0
- package/dist/render/text.d.ts +15 -0
- package/dist/render/text.js +29 -0
- package/dist/render/tokens.d.ts +53 -0
- package/dist/render/tokens.js +71 -0
- package/dist/schema/adr.d.ts +36 -0
- package/dist/schema/adr.js +27 -0
- package/dist/schema/bundle.d.ts +726 -0
- package/dist/schema/bundle.js +171 -0
- package/dist/schema/index.d.ts +4 -0
- package/dist/schema/index.js +4 -0
- package/dist/schema/json-schema.d.ts +8 -0
- package/dist/schema/json-schema.js +19 -0
- package/dist/schema/workspace.d.ts +1066 -0
- package/dist/schema/workspace.js +271 -0
- package/dist/viewer/assets/index-DvKgCpBr.css +1 -0
- package/dist/viewer/assets/index-gucix3xm.js +113 -0
- package/dist/viewer/assets/index_bg-Blvrv-U2.wasm +0 -0
- package/dist/viewer/assets/index_bg-D3t31u3-.js +1 -0
- package/dist/viewer/assets/layout.worker-Bg-OaLVN.js +26 -0
- package/dist/viewer/assets/overpass-latin-QyaMbcmi.woff2 +0 -0
- package/dist/viewer/assets/overpass-latin-ext-DSRhPfzW.woff2 +0 -0
- package/dist/viewer/assets/overpass-mono-latin-BTquVRaO.woff2 +0 -0
- package/dist/viewer/assets/overpass-mono-latin-ext-D47EiU4_.woff2 +0 -0
- package/dist/viewer/assets/png-BDKIXtm5.js +1 -0
- package/dist/viewer/assets/svg-Bulv5YWn.js +2 -0
- package/dist/viewer/favicon.svg +1 -0
- package/dist/viewer/index.html +53 -0
- package/dist/writer/adrs.d.ts +21 -0
- package/dist/writer/adrs.js +72 -0
- package/dist/writer/deployments.d.ts +51 -0
- package/dist/writer/deployments.js +145 -0
- package/dist/writer/diff.d.ts +6 -0
- package/dist/writer/diff.js +77 -0
- package/dist/writer/document.d.ts +25 -0
- package/dist/writer/document.js +79 -0
- package/dist/writer/edit.d.ts +78 -0
- package/dist/writer/edit.js +63 -0
- package/dist/writer/index.d.ts +67 -0
- package/dist/writer/index.js +310 -0
- package/dist/writer/overlay.d.ts +7 -0
- package/dist/writer/overlay.js +26 -0
- package/dist/writer/views.d.ts +29 -0
- package/dist/writer/views.js +78 -0
- package/dist/writer/workspace.d.ts +25 -0
- package/dist/writer/workspace.js +56 -0
- package/guide/SKILL.md +36 -0
- package/guide/topics/add-service.md +30 -0
- package/guide/topics/bootstrap.md +28 -0
- package/guide/topics/change.md +32 -0
- package/guide/topics/deployments.md +36 -0
- package/guide/topics/dynamic-view.md +39 -0
- package/guide/topics/propose-adr.md +12 -0
- package/guide/topics/relationships.md +39 -0
- package/guide/topics/saved-view.md +36 -0
- package/package.json +75 -4
- package/schemas/adr.schema.json +82 -0
- package/schemas/model.schema.json +1381 -0
- package/schemas/project.schema.json +24 -0
- package/schemas/workspace.schema.json +72 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Logan Harber
|
|
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.
|
package/README.md
CHANGED
|
@@ -1,3 +1,182 @@
|
|
|
1
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<picture>
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/brand/archidocs-mark-light.svg">
|
|
4
|
+
<img src="assets/brand/archidocs-mark-dark.svg" alt="Archidocs" width="72">
|
|
5
|
+
</picture>
|
|
6
|
+
</p>
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
<h1 align="center">Archidocs</h1>
|
|
9
|
+
|
|
10
|
+
<p align="center">Git-native architecture as code. Each Team declares its slice of the architecture as YAML; Archidocs validates it, combines it into one Model, and publishes a diagram viewer for people and an MCP server for agents.</p>
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Why
|
|
15
|
+
|
|
16
|
+
- **Diagrams that don't go stale.** Every diagram is generated from the validated Model at a commit, never drawn by hand.
|
|
17
|
+
- **Ownership is first-class.** Every Element has exactly one Owner Team, shown on every node.
|
|
18
|
+
- **One answer, many Teams.** Each Team keeps its own Project folder in one Workspace repo. Archidocs merges them, so nobody has to ask around.
|
|
19
|
+
- **Every screen is a link.** Any view in the viewer can be shared by URL and saved as View YAML.
|
|
20
|
+
- **Same answers for people and agents.** What the viewer shows, the MCP server can answer, and agents can edit the Model through it.
|
|
21
|
+
|
|
22
|
+
The questions it's built to answer:
|
|
23
|
+
|
|
24
|
+
| Who | Question |
|
|
25
|
+
| --- | --- |
|
|
26
|
+
| Enterprise Architect | How are two Services connected? |
|
|
27
|
+
| Solutions Architect | Where is a Service deployed? |
|
|
28
|
+
| Developer | What does my Team own? |
|
|
29
|
+
| Product Owner | What is upstream and downstream of an outage? |
|
|
30
|
+
| QA Tester | What is a Service's URL in a given Environment? |
|
|
31
|
+
| Technical staff | Which decisions sit behind an Element, and how has the system changed? |
|
|
32
|
+
|
|
33
|
+
## Quick start
|
|
34
|
+
|
|
35
|
+
Requires Node.js 22.18 or later.
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm install --global archidocs
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
In the repo that will hold your Workspace:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
archidocs init
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
This writes `archidocs/workspace.yaml`, adds the `.archidocs/` cache to `.gitignore`, and installs an authoring skill for coding agents. Add a Project folder, then check it and open the viewer:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
archidocs check
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
archidocs dev
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`archidocs dev` serves the viewer on <http://localhost:4321> and reloads as you edit.
|
|
58
|
+
|
|
59
|
+
## The Model
|
|
60
|
+
|
|
61
|
+
A Workspace is one repo. `workspace.yaml` defines Teams and Environments; each Project folder, marked by a `project.yaml`, declares one Team's Elements, Relationships, Deployments and Saved Views.
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
archidocs/
|
|
65
|
+
├── workspace.yaml # Teams and Environments
|
|
66
|
+
├── payments/
|
|
67
|
+
│ ├── project.yaml # id, name, owner Team
|
|
68
|
+
│ ├── model.yaml # Systems, Services, Components, Relationships
|
|
69
|
+
│ ├── deployments.yaml # which Service runs where, and its URL
|
|
70
|
+
│ └── views.yaml # Saved Views
|
|
71
|
+
└── core/
|
|
72
|
+
└── ...
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
```yaml
|
|
76
|
+
# payments/model.yaml
|
|
77
|
+
systems:
|
|
78
|
+
payments:
|
|
79
|
+
name: Payments
|
|
80
|
+
services:
|
|
81
|
+
payments-service:
|
|
82
|
+
name: Payments Service
|
|
83
|
+
technology: Java, Spring Boot
|
|
84
|
+
relationships:
|
|
85
|
+
- to: payments-db
|
|
86
|
+
description: Stores payment state in
|
|
87
|
+
- to: core:mainframe # another Project's Element
|
|
88
|
+
description: Posts payments to the ledger in
|
|
89
|
+
payments-db:
|
|
90
|
+
name: Payments DB
|
|
91
|
+
type: datastore
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
```yaml
|
|
95
|
+
# payments/deployments.yaml
|
|
96
|
+
deployments:
|
|
97
|
+
- service: payments-service
|
|
98
|
+
environment: prod
|
|
99
|
+
target: platform:eks-prod
|
|
100
|
+
url: https://payments.bigbank.example
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The terms (Workspace, Project, Element, Relationship, Team, Environment, Deployment Target and more) are defined in [GLOSSARY.md](GLOSSARY.md). Every check rule is listed in [docs/rules.md](docs/rules.md).
|
|
104
|
+
|
|
105
|
+
## CLI
|
|
106
|
+
|
|
107
|
+
| Command | What it does |
|
|
108
|
+
| --- | --- |
|
|
109
|
+
| `archidocs init [--skill]` | Set up a Workspace, or with `--skill` install only the agent skill in a code repo. |
|
|
110
|
+
| `archidocs check [--strict]` | Validate the Workspace. Formats: `text`, `json`, `github`. |
|
|
111
|
+
| `archidocs dev` | Serve the viewer locally with live reload. |
|
|
112
|
+
| `archidocs build [--out <dir>]` | Build the static viewer site with past Revisions. `--preview` builds a PR preview. |
|
|
113
|
+
| `archidocs export <view-id>` | Render a View to SVG or PNG, styled like the viewer; `--all-saved` renders every Saved View, `--theme dark` draws it in the viewer's dark palette and `--label <text>` replaces the source line. |
|
|
114
|
+
| `archidocs diff <from> [<to>]` | Show what changed in the Model between two refs. |
|
|
115
|
+
| `archidocs mcp` | Run the MCP server over a Workspace checkout or a published Bundle. |
|
|
116
|
+
| `archidocs guide [topic]` | Print the authoring guide for agents. |
|
|
117
|
+
| `archidocs version` | Print the CLI and Bundle schema versions. |
|
|
118
|
+
|
|
119
|
+
## Publishing
|
|
120
|
+
|
|
121
|
+
`archidocs build` writes a fully static site with relative URLs and hash routing, so any static host can serve it. The GitHub Action checks, builds and deploys to GitHub Pages:
|
|
122
|
+
|
|
123
|
+
```yaml
|
|
124
|
+
# .github/workflows/architecture.yml
|
|
125
|
+
on:
|
|
126
|
+
push:
|
|
127
|
+
branches: [main]
|
|
128
|
+
tags: ["*"]
|
|
129
|
+
|
|
130
|
+
permissions:
|
|
131
|
+
contents: read
|
|
132
|
+
pages: write
|
|
133
|
+
id-token: write
|
|
134
|
+
|
|
135
|
+
jobs:
|
|
136
|
+
publish:
|
|
137
|
+
runs-on: ubuntu-latest
|
|
138
|
+
environment:
|
|
139
|
+
name: github-pages
|
|
140
|
+
url: ${{ steps.archidocs.outputs.page-url }}
|
|
141
|
+
steps:
|
|
142
|
+
- uses: actions/checkout@v4
|
|
143
|
+
with:
|
|
144
|
+
fetch-depth: 0
|
|
145
|
+
- uses: chalharb/archidocs@v1
|
|
146
|
+
id: archidocs
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
A failed check deploys nothing, so the last good site stays up. GitLab Pages, PR previews, Saved View images for wikis, and other hosts are covered in [docs/publishing.md](docs/publishing.md); the GitLab template is in [templates/gitlab](templates/gitlab).
|
|
150
|
+
|
|
151
|
+
## Agents and MCP
|
|
152
|
+
|
|
153
|
+
`archidocs mcp` serves the Model to AI agents. Read tools answer the same questions as the viewer; write tools (`upsert_element`, `upsert_relationship`, `upsert_deployment`, `upsert_view`, `propose_adr` and more) edit the YAML in place, keep comments and formatting, return a diff, and refuse any change that would fail `archidocs check`.
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
archidocs mcp --workspace ./archidocs
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
`archidocs init` installs the authoring skill into `.agents/skills`, `.claude/skills` and `.github/skills`. The full guide is in [guide/SKILL.md](guide/SKILL.md) with task topics in [guide/topics](guide/topics).
|
|
160
|
+
|
|
161
|
+
## Examples
|
|
162
|
+
|
|
163
|
+
| Example | What it shows | Source | Demo |
|
|
164
|
+
| --- | --- | --- | --- |
|
|
165
|
+
| Big Bank plc | A fictional bank with five Teams, two Environments and a history of Revisions to browse and compare. | [examples/big-bank](examples/big-bank) | [big-bank.archidocs.dev](https://big-bank.archidocs.dev) |
|
|
166
|
+
| Kitchen sink | Every feature of the Model in one Workspace. | [examples/kitchen-sink](examples/kitchen-sink) | [kitchen-sink.archidocs.dev](https://kitchen-sink.archidocs.dev) |
|
|
167
|
+
|
|
168
|
+
## Development
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
pnpm install
|
|
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).
|
|
179
|
+
|
|
180
|
+
## License
|
|
181
|
+
|
|
182
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CLI's commands and flags, described once. The CLI parses each
|
|
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 checks every
|
|
5
|
+
* `archidocs …` line in a page with `parseCommandLine`. Importing this
|
|
6
|
+
* module has no side effects and pulls in nothing but `node:util`.
|
|
7
|
+
*/
|
|
8
|
+
import { parseArgs } from "node:util";
|
|
9
|
+
/** One flag. Its key in `flags` is its name, without the leading `--`. */
|
|
10
|
+
export interface FlagDefinition {
|
|
11
|
+
readonly type: "string" | "boolean";
|
|
12
|
+
/** What a string flag takes, as the usage shows it: `<dir>` or `text|json`. */
|
|
13
|
+
readonly value?: string;
|
|
14
|
+
/** The value the parser fills in when the flag is absent. */
|
|
15
|
+
readonly default?: string | boolean;
|
|
16
|
+
/** The default in words, for a flag whose default the command works out itself. */
|
|
17
|
+
readonly defaultText?: string;
|
|
18
|
+
readonly description: string;
|
|
19
|
+
}
|
|
20
|
+
/** A positional argument, as the synopsis writes it: `<view-id>` or `[topic]`. */
|
|
21
|
+
export interface ArgumentDefinition {
|
|
22
|
+
readonly name: string;
|
|
23
|
+
readonly description: string;
|
|
24
|
+
}
|
|
25
|
+
export interface CommandDefinition {
|
|
26
|
+
/** The words after `archidocs`: `check`, or `history build` for a subcommand. */
|
|
27
|
+
readonly name: string;
|
|
28
|
+
/** Each way to call it, after `archidocs `. */
|
|
29
|
+
readonly synopsis: readonly string[];
|
|
30
|
+
/** One line on what it does. */
|
|
31
|
+
readonly description: string;
|
|
32
|
+
readonly arguments: readonly ArgumentDefinition[];
|
|
33
|
+
readonly flags: Readonly<Record<string, FlagDefinition>>;
|
|
34
|
+
}
|
|
35
|
+
export declare const commands: {
|
|
36
|
+
readonly version: {
|
|
37
|
+
readonly name: "version";
|
|
38
|
+
readonly synopsis: readonly ["version [--format text|json]"];
|
|
39
|
+
readonly description: "Print the CLI's version and the Bundle schemaVersion it writes.";
|
|
40
|
+
readonly arguments: readonly [];
|
|
41
|
+
readonly flags: {
|
|
42
|
+
readonly format: {
|
|
43
|
+
readonly type: "string";
|
|
44
|
+
readonly value: "text|json";
|
|
45
|
+
readonly default: "text";
|
|
46
|
+
readonly description: "Print a line of text, or a JSON object with `version` and `schemaVersion`.";
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
readonly init: {
|
|
51
|
+
readonly name: "init";
|
|
52
|
+
readonly synopsis: readonly ["init [--skill [--workspace <dir>]]"];
|
|
53
|
+
readonly description: "Set up a Workspace in this repo and install the agent skill, or with `--skill` install only the skill in a code repo. Safe to re-run.";
|
|
54
|
+
readonly arguments: readonly [];
|
|
55
|
+
readonly flags: {
|
|
56
|
+
readonly skill: {
|
|
57
|
+
readonly type: "boolean";
|
|
58
|
+
readonly default: false;
|
|
59
|
+
readonly description: "Install only the agent skill and its pointers, for a code repo that has no Workspace of its own.";
|
|
60
|
+
};
|
|
61
|
+
readonly workspace: {
|
|
62
|
+
readonly type: "string";
|
|
63
|
+
readonly value: "<dir>";
|
|
64
|
+
readonly description: "With `--skill`: the Workspace checkout that the printed MCP command points at.";
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
readonly guide: {
|
|
69
|
+
readonly name: "guide";
|
|
70
|
+
readonly synopsis: readonly ["guide [topic]"];
|
|
71
|
+
readonly description: "Print the authoring guide for agents, or one of its task topics.";
|
|
72
|
+
readonly arguments: readonly [{
|
|
73
|
+
readonly name: "[topic]";
|
|
74
|
+
readonly description: "A task topic; with none, the guide and the list of topics.";
|
|
75
|
+
}];
|
|
76
|
+
readonly flags: {};
|
|
77
|
+
};
|
|
78
|
+
readonly check: {
|
|
79
|
+
readonly name: "check";
|
|
80
|
+
readonly synopsis: readonly ["check [--format text|json|github] [--strict]"];
|
|
81
|
+
readonly description: "Validate the Workspace found from the current folder. Exits 1 on errors, 2 if it could not run.";
|
|
82
|
+
readonly arguments: readonly [];
|
|
83
|
+
readonly flags: {
|
|
84
|
+
readonly format: {
|
|
85
|
+
readonly type: "string";
|
|
86
|
+
readonly value: "text|json|github";
|
|
87
|
+
readonly default: "text";
|
|
88
|
+
readonly description: "Print issues as text, as JSON, or as GitHub Actions annotations.";
|
|
89
|
+
};
|
|
90
|
+
readonly strict: {
|
|
91
|
+
readonly type: "boolean";
|
|
92
|
+
readonly default: false;
|
|
93
|
+
readonly description: "Exit 1 on warnings too, not only on errors.";
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
readonly build: {
|
|
98
|
+
readonly name: "build";
|
|
99
|
+
readonly synopsis: readonly ["build [--out <dir>] [--bundle-only] [--keep <n|all>]", "build --preview [--base <branch>] [--out <dir>]"];
|
|
100
|
+
readonly description: "Write the static viewer site with the Workspace's Bundle and past Revisions, or a PR preview site.";
|
|
101
|
+
readonly arguments: readonly [];
|
|
102
|
+
readonly flags: {
|
|
103
|
+
readonly out: {
|
|
104
|
+
readonly type: "string";
|
|
105
|
+
readonly value: "<dir>";
|
|
106
|
+
readonly default: "dist";
|
|
107
|
+
readonly description: "The folder to write the site, or the Bundle, into.";
|
|
108
|
+
};
|
|
109
|
+
readonly "bundle-only": {
|
|
110
|
+
readonly type: "boolean";
|
|
111
|
+
readonly default: false;
|
|
112
|
+
readonly description: "Write only `workspace.bundle.json`, without the viewer or past Revisions.";
|
|
113
|
+
};
|
|
114
|
+
readonly keep: {
|
|
115
|
+
readonly type: "string";
|
|
116
|
+
readonly value: "<n|all>";
|
|
117
|
+
readonly defaultText: "200";
|
|
118
|
+
readonly description: "How many of the latest past Revisions the site keeps Bundles for, or `all`; tagged Revisions are always kept.";
|
|
119
|
+
};
|
|
120
|
+
readonly preview: {
|
|
121
|
+
readonly type: "boolean";
|
|
122
|
+
readonly default: false;
|
|
123
|
+
readonly description: "Build a PR preview site holding just the PR head and the base branch's latest Revision, for Compare.";
|
|
124
|
+
};
|
|
125
|
+
readonly base: {
|
|
126
|
+
readonly type: "string";
|
|
127
|
+
readonly value: "<branch>";
|
|
128
|
+
readonly defaultText: "the branch origin/HEAD points at";
|
|
129
|
+
readonly description: "With `--preview`: the base branch, read from `origin/<branch>` without fetching.";
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
readonly dev: {
|
|
134
|
+
readonly name: "dev";
|
|
135
|
+
readonly synopsis: readonly ["dev [--workspace <dir>] [--port <n>] [--host <host>]"];
|
|
136
|
+
readonly description: "Serve the viewer locally and reload it as you edit the Workspace.";
|
|
137
|
+
readonly arguments: readonly [];
|
|
138
|
+
readonly flags: {
|
|
139
|
+
readonly workspace: {
|
|
140
|
+
readonly type: "string";
|
|
141
|
+
readonly value: "<dir>";
|
|
142
|
+
readonly defaultText: "the Workspace found from the current folder";
|
|
143
|
+
readonly description: "Where to look for the Workspace.";
|
|
144
|
+
};
|
|
145
|
+
readonly port: {
|
|
146
|
+
readonly type: "string";
|
|
147
|
+
readonly value: "<n>";
|
|
148
|
+
readonly default: "4321";
|
|
149
|
+
readonly description: "The port to serve on.";
|
|
150
|
+
};
|
|
151
|
+
readonly host: {
|
|
152
|
+
readonly type: "string";
|
|
153
|
+
readonly value: "<host>";
|
|
154
|
+
readonly default: "127.0.0.1";
|
|
155
|
+
readonly description: "The address to listen on.";
|
|
156
|
+
};
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
readonly export: {
|
|
160
|
+
readonly name: "export";
|
|
161
|
+
readonly synopsis: readonly ["export <view-id> [--format svg|png] [--out <file>] [--direction TB|BT|LR|RL] [--theme light|dark] [--label <text>]", "export --all-saved --out <dir> [--format svg|png] [--direction TB|BT|LR|RL] [--theme light|dark] [--label <text>]"];
|
|
162
|
+
readonly description: "Render a View, or every Saved View, to an SVG or PNG picture.";
|
|
163
|
+
readonly arguments: readonly [{
|
|
164
|
+
readonly name: "<view-id>";
|
|
165
|
+
readonly description: "The View: c1, c2, c2/<system>, c3/<service>, deployment/<environment>, or a Saved View as project:view-id.";
|
|
166
|
+
}];
|
|
167
|
+
readonly flags: {
|
|
168
|
+
readonly format: {
|
|
169
|
+
readonly type: "string";
|
|
170
|
+
readonly value: "svg|png";
|
|
171
|
+
readonly default: "svg";
|
|
172
|
+
readonly description: "The picture format.";
|
|
173
|
+
};
|
|
174
|
+
readonly out: {
|
|
175
|
+
readonly type: "string";
|
|
176
|
+
readonly value: "<file>";
|
|
177
|
+
readonly defaultText: "<view-id>.<format> in the current folder";
|
|
178
|
+
readonly description: "The file to write; with `--all-saved`, the folder to write each picture into.";
|
|
179
|
+
};
|
|
180
|
+
readonly direction: {
|
|
181
|
+
readonly type: "string";
|
|
182
|
+
readonly value: "TB|BT|LR|RL";
|
|
183
|
+
readonly defaultText: "a Saved View's own direction, else LR";
|
|
184
|
+
readonly description: "The layout direction: top to bottom, bottom to top, left to right or right to left. Dynamic Views ignore it.";
|
|
185
|
+
};
|
|
186
|
+
readonly "all-saved": {
|
|
187
|
+
readonly type: "boolean";
|
|
188
|
+
readonly default: false;
|
|
189
|
+
readonly description: "Render every Saved View into the `--out` folder, one picture each.";
|
|
190
|
+
};
|
|
191
|
+
readonly theme: {
|
|
192
|
+
readonly type: "string";
|
|
193
|
+
readonly value: "light|dark";
|
|
194
|
+
readonly default: "light";
|
|
195
|
+
readonly description: "The palette: the viewer's light tokens, or its Night shift dark ones.";
|
|
196
|
+
};
|
|
197
|
+
readonly label: {
|
|
198
|
+
readonly type: "string";
|
|
199
|
+
readonly value: "<text>";
|
|
200
|
+
readonly defaultText: "the Workspace, short commit and date";
|
|
201
|
+
readonly description: "The line under the title, such as `Big Bank · v1.2.0`, in place of the source line.";
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
};
|
|
205
|
+
readonly diff: {
|
|
206
|
+
readonly name: "diff";
|
|
207
|
+
readonly synopsis: readonly ["diff <from> [<to>] [--format text|json|markdown]"];
|
|
208
|
+
readonly description: "Show what changed in the Model between two points in the Workspace's history.";
|
|
209
|
+
readonly arguments: readonly [{
|
|
210
|
+
readonly name: "<from>";
|
|
211
|
+
readonly description: "A git ref, or a date, which means the last default-branch commit at or before it.";
|
|
212
|
+
}, {
|
|
213
|
+
readonly name: "[<to>]";
|
|
214
|
+
readonly description: "A ref or date like `<from>`; with none, the working tree.";
|
|
215
|
+
}];
|
|
216
|
+
readonly flags: {
|
|
217
|
+
readonly format: {
|
|
218
|
+
readonly type: "string";
|
|
219
|
+
readonly value: "text|json|markdown";
|
|
220
|
+
readonly default: "text";
|
|
221
|
+
readonly description: "Print the changes as text, JSON, or Markdown for a PR comment.";
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
readonly "history build": {
|
|
226
|
+
readonly name: "history build";
|
|
227
|
+
readonly synopsis: readonly ["history build [--since <ref|date>]"];
|
|
228
|
+
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
|
+
readonly arguments: readonly [];
|
|
230
|
+
readonly flags: {
|
|
231
|
+
readonly since: {
|
|
232
|
+
readonly type: "string";
|
|
233
|
+
readonly value: "<ref|date>";
|
|
234
|
+
readonly defaultText: "every Revision";
|
|
235
|
+
readonly description: "Only build Revisions at or after this ref's commit time or the start of this date.";
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
readonly mcp: {
|
|
240
|
+
readonly name: "mcp";
|
|
241
|
+
readonly synopsis: readonly ["mcp [--workspace <dir> | --bundle <url|path>] [--viewer-url <url>]", "mcp --http [--host <loopback>] [--port <n>] [--allow-writes] [--workspace <dir> | --bundle <url|path>] [--viewer-url <url>]"];
|
|
242
|
+
readonly description: "Serve the Model to AI agents over MCP, from a Workspace checkout or a published Bundle, on stdio or local HTTP.";
|
|
243
|
+
readonly arguments: readonly [];
|
|
244
|
+
readonly flags: {
|
|
245
|
+
readonly workspace: {
|
|
246
|
+
readonly type: "string";
|
|
247
|
+
readonly value: "<dir>";
|
|
248
|
+
readonly defaultText: "the Workspace found from the current folder";
|
|
249
|
+
readonly description: "Serve this Workspace checkout; its write tools edit the YAML in place.";
|
|
250
|
+
};
|
|
251
|
+
readonly bundle: {
|
|
252
|
+
readonly type: "string";
|
|
253
|
+
readonly value: "<url|path>";
|
|
254
|
+
readonly description: "Serve a published Bundle, read-only, instead of a checkout.";
|
|
255
|
+
};
|
|
256
|
+
readonly "viewer-url": {
|
|
257
|
+
readonly type: "string";
|
|
258
|
+
readonly value: "<url>";
|
|
259
|
+
readonly description: "The published viewer's base URL; tool results then link to it.";
|
|
260
|
+
};
|
|
261
|
+
readonly http: {
|
|
262
|
+
readonly type: "boolean";
|
|
263
|
+
readonly default: false;
|
|
264
|
+
readonly description: "Serve Streamable HTTP at `/mcp` instead of stdio.";
|
|
265
|
+
};
|
|
266
|
+
readonly host: {
|
|
267
|
+
readonly type: "string";
|
|
268
|
+
readonly value: "<loopback>";
|
|
269
|
+
readonly defaultText: "127.0.0.1";
|
|
270
|
+
readonly description: "With `--http`: the loopback address to listen on, `127.0.0.1`, `localhost` or `::1`.";
|
|
271
|
+
};
|
|
272
|
+
readonly port: {
|
|
273
|
+
readonly type: "string";
|
|
274
|
+
readonly value: "<n>";
|
|
275
|
+
readonly defaultText: "3737";
|
|
276
|
+
readonly description: "With `--http`: the port to serve on.";
|
|
277
|
+
};
|
|
278
|
+
readonly "allow-writes": {
|
|
279
|
+
readonly type: "boolean";
|
|
280
|
+
readonly default: false;
|
|
281
|
+
readonly description: "With `--http`: allow the write tools, which are off over HTTP by default.";
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
};
|
|
286
|
+
export type CommandName = keyof typeof commands;
|
|
287
|
+
/** Every command, in the order the usage lists them. */
|
|
288
|
+
export declare const commandList: readonly CommandDefinition[];
|
|
289
|
+
/** The usage text the CLI prints after a usage error. */
|
|
290
|
+
export declare function usageText(): string;
|
|
291
|
+
/**
|
|
292
|
+
* Parses a command's arguments (the words after its name) with its flags,
|
|
293
|
+
* strictly: an unknown flag or a missing value throws `ERR_PARSE_ARGS_*`.
|
|
294
|
+
*/
|
|
295
|
+
export declare function parseCommand<N extends CommandName>(name: N, args: string[]): ParsedCommand<N>;
|
|
296
|
+
/** `parseArgs`'s typed result for a command: its flags' values and its positionals. */
|
|
297
|
+
type ParsedCommand<N extends CommandName> = ReturnType<typeof parseArgs<{
|
|
298
|
+
args: string[];
|
|
299
|
+
options: (typeof commands)[N]["flags"];
|
|
300
|
+
allowPositionals: true;
|
|
301
|
+
strict: true;
|
|
302
|
+
}>>;
|
|
303
|
+
/** The command a command line names, and the arguments after its name. */
|
|
304
|
+
export declare function findCommand(argv: readonly string[]): {
|
|
305
|
+
command: CommandDefinition;
|
|
306
|
+
args: string[];
|
|
307
|
+
} | undefined;
|
|
308
|
+
export type ParsedCommandLine = {
|
|
309
|
+
ok: true;
|
|
310
|
+
command: string;
|
|
311
|
+
} | {
|
|
312
|
+
ok: false;
|
|
313
|
+
message: string;
|
|
314
|
+
};
|
|
315
|
+
/**
|
|
316
|
+
* Checks a command line (the words after `archidocs`) against the
|
|
317
|
+
* definitions without running anything: an unknown command, an unknown
|
|
318
|
+
* flag, a flag missing its value or a stray argument is reported. What
|
|
319
|
+
* a value means, and which flags go together, are left to the command.
|
|
320
|
+
*/
|
|
321
|
+
export declare function parseCommandLine(argv: readonly string[]): ParsedCommandLine;
|
|
322
|
+
export {};
|