archgate 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -11
- package/bin/archgate.cjs +4 -2
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -33,7 +33,9 @@ Archgate has two layers:
|
|
|
33
33
|
|
|
34
34
|
When a rule is violated, `archgate check` reports the file, line, and which ADR was broken. Exit code 1 means violations — wire it into CI and it blocks merges automatically.
|
|
35
35
|
|
|
36
|
-
**The
|
|
36
|
+
**The CLI is free and open source.** Writing ADRs, enforcing rules, running checks in CI, and wiring up pre-commit hooks all work without an account or subscription.
|
|
37
|
+
|
|
38
|
+
**Editor plugins are an optional paid add-on** for teams that want AI agents (Claude Code, Cursor) to read ADRs, validate changes, and capture new patterns automatically. Plugins are distributed from [plugins.archgate.dev](https://plugins.archgate.dev). See [Editor plugins](#editor-plugins) for details.
|
|
37
39
|
|
|
38
40
|
## Installation
|
|
39
41
|
|
|
@@ -41,7 +43,7 @@ When a rule is violated, `archgate check` reports the file, line, and which ADR
|
|
|
41
43
|
npm install -g archgate
|
|
42
44
|
```
|
|
43
45
|
|
|
44
|
-
**Requirements:** macOS (arm64) or
|
|
46
|
+
**Requirements:** macOS (arm64), Linux (x86_64), or Windows (x86_64). Node.js is only needed to run the wrapper — the CLI itself is a standalone binary.
|
|
45
47
|
|
|
46
48
|
> **Using [proto](https://moonrepo.dev/proto)?** Add the following to `~/.proto/config.toml` and your shell profile so globals persist across Node.js version switches:
|
|
47
49
|
>
|
|
@@ -76,7 +78,9 @@ archgate init
|
|
|
76
78
|
archgate check
|
|
77
79
|
```
|
|
78
80
|
|
|
79
|
-
`archgate init` creates the `.archgate/adrs/` directory
|
|
81
|
+
`archgate init` creates the `.archgate/adrs/` directory with an example ADR and rules file, and configures editor settings. No account or login is needed — the CLI is fully functional without plugins.
|
|
82
|
+
|
|
83
|
+
**Want AI agent integration?** See [Editor plugins](#editor-plugins) to add the optional paid plugin for Claude Code or Cursor.
|
|
80
84
|
|
|
81
85
|
## Writing rules
|
|
82
86
|
|
|
@@ -117,15 +121,37 @@ Rules receive the list of files to check (filtered by the ADR's `files` glob if
|
|
|
117
121
|
|
|
118
122
|
## Commands
|
|
119
123
|
|
|
124
|
+
### `archgate login`
|
|
125
|
+
|
|
126
|
+
Authenticate with GitHub to access the optional paid editor plugins.
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
archgate login # authenticate via GitHub Device Flow
|
|
130
|
+
archgate login status # show current auth status
|
|
131
|
+
archgate login logout # remove stored credentials
|
|
132
|
+
archgate login refresh # re-authenticate and claim a new token
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Opens a browser-based GitHub Device Flow. Once authorized, an archgate plugin token is stored in `~/.archgate/credentials`. This token is used by `archgate init` to install the editor plugin. Not required for CLI-only usage.
|
|
136
|
+
|
|
120
137
|
### `archgate init`
|
|
121
138
|
|
|
122
139
|
Initialize governance in the current project.
|
|
123
140
|
|
|
124
141
|
```bash
|
|
125
|
-
archgate init
|
|
142
|
+
archgate init # Claude Code (default)
|
|
143
|
+
archgate init --editor cursor # Cursor
|
|
144
|
+
archgate init --install-plugin # force plugin install attempt
|
|
126
145
|
```
|
|
127
146
|
|
|
128
|
-
Creates `.archgate/adrs/` with an example ADR and rules file
|
|
147
|
+
Creates `.archgate/adrs/` with an example ADR and rules file and configures editor settings. Works without an account — plugin installation only happens when you are logged in.
|
|
148
|
+
|
|
149
|
+
**Plugin install behavior** (optional — requires `archgate login`):
|
|
150
|
+
|
|
151
|
+
- If you are logged in, init auto-detects your credentials and installs the plugin.
|
|
152
|
+
- For **Claude Code**: if the `claude` CLI is on PATH, the plugin is installed automatically via `claude plugin marketplace add` and `claude plugin install`. If not, the manual commands are printed.
|
|
153
|
+
- For **Cursor**: the plugin bundle is downloaded from [plugins.archgate.dev](https://plugins.archgate.dev) and extracted into `.cursor/`.
|
|
154
|
+
- Use `--install-plugin` to explicitly request plugin installation (useful if auto-detection is skipped).
|
|
129
155
|
|
|
130
156
|
### `archgate check`
|
|
131
157
|
|
|
@@ -230,15 +256,41 @@ pre-commit:
|
|
|
230
256
|
run: archgate check --staged
|
|
231
257
|
```
|
|
232
258
|
|
|
233
|
-
##
|
|
259
|
+
## Editor plugins
|
|
260
|
+
|
|
261
|
+
> **Plugins are an optional paid add-on.** The CLI works fully without them. Plugins add AI agent integration — your AI coding agent reads ADRs before writing code, validates changes after implementation, and captures new patterns back into ADRs.
|
|
262
|
+
|
|
263
|
+
Plugins are distributed from [plugins.archgate.dev](https://plugins.archgate.dev).
|
|
264
|
+
|
|
265
|
+
### Setup
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
# 1. Log in (one-time) — links your GitHub account and issues a plugin token
|
|
269
|
+
archgate login
|
|
270
|
+
|
|
271
|
+
# 2. Initialize a project with the plugin
|
|
272
|
+
archgate init # Claude Code (default)
|
|
273
|
+
archgate init --editor cursor # or Cursor
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
If you are logged in, `archgate init` auto-detects your credentials and installs the plugin. You can also pass `--install-plugin` explicitly.
|
|
277
|
+
|
|
278
|
+
### Claude Code
|
|
279
|
+
|
|
280
|
+
If the `claude` CLI is on your PATH, the plugin is installed automatically. Otherwise, run the printed commands manually:
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
claude plugin marketplace add https://<user>:<token>@plugins.archgate.dev/archgate.git
|
|
284
|
+
claude plugin install archgate@archgate
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
Once installed, run `archgate:onboard` in Claude Code to initialize governance for your project.
|
|
234
288
|
|
|
235
|
-
|
|
289
|
+
### Cursor
|
|
236
290
|
|
|
237
|
-
|
|
238
|
-
- Validates changes after implementation
|
|
239
|
-
- Captures new patterns back into ADRs
|
|
291
|
+
The Cursor plugin bundle is downloaded from [plugins.archgate.dev](https://plugins.archgate.dev) and extracted into `.cursor/` automatically.
|
|
240
292
|
|
|
241
|
-
|
|
293
|
+
Once installed, run the `ag-onboard` skill in Cursor to initialize governance for your project.
|
|
242
294
|
|
|
243
295
|
## Contributing
|
|
244
296
|
|
package/bin/archgate.cjs
CHANGED
|
@@ -9,16 +9,18 @@ function getPlatformPackageName() {
|
|
|
9
9
|
const { platform, arch } = process;
|
|
10
10
|
if (platform === "darwin" && arch === "arm64") return "archgate-darwin-arm64";
|
|
11
11
|
if (platform === "linux" && arch === "x64") return "archgate-linux-x64";
|
|
12
|
+
if (platform === "win32" && arch === "x64") return "archgate-win32-x64";
|
|
12
13
|
throw new Error(
|
|
13
|
-
`Unsupported platform: ${platform}/${arch}\narchgate supports darwin/arm64 and
|
|
14
|
+
`Unsupported platform: ${platform}/${arch}\narchgate supports darwin/arm64, linux/x64, and win32/x64.`
|
|
14
15
|
);
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
function getBinaryPath() {
|
|
18
19
|
const pkgName = getPlatformPackageName();
|
|
20
|
+
const binaryName = process.platform === "win32" ? "archgate.exe" : "archgate";
|
|
19
21
|
try {
|
|
20
22
|
const pkgDir = path.dirname(require.resolve(`${pkgName}/package.json`));
|
|
21
|
-
const binaryPath = path.join(pkgDir, "bin",
|
|
23
|
+
const binaryPath = path.join(pkgDir, "bin", binaryName);
|
|
22
24
|
if (fs.existsSync(binaryPath)) return binaryPath;
|
|
23
25
|
} catch {
|
|
24
26
|
/* platform package not installed */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "archgate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Enforce Architecture Decision Records as executable rules — for both humans and AI agents",
|
|
5
5
|
"readme": "README.md",
|
|
6
6
|
"license": "FSL-1.1-ALv2",
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"os": [
|
|
35
35
|
"darwin",
|
|
36
|
-
"linux"
|
|
36
|
+
"linux",
|
|
37
|
+
"win32"
|
|
37
38
|
],
|
|
38
39
|
"scripts": {
|
|
39
40
|
"cli": "bun run src/cli.ts",
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
"format:check": "prettier --check .",
|
|
45
46
|
"test": "bun test --timeout 60000",
|
|
46
47
|
"test:watch": "bun test --watch --timeout 60000",
|
|
47
|
-
"build:check": "bun build src/cli.ts --compile --bytecode --outfile dist/.build-check && rm -f dist/.build-check",
|
|
48
|
+
"build:check": "bun build src/cli.ts --compile --bytecode --outfile dist/.build-check && rm -f dist/.build-check dist/.build-check.exe",
|
|
48
49
|
"validate": "bun run lint && bun run typecheck && bun run format:check && bun test && bun run check && bun run build:check",
|
|
49
50
|
"commit": "cz",
|
|
50
51
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
|
|
@@ -71,6 +72,7 @@
|
|
|
71
72
|
},
|
|
72
73
|
"optionalDependencies": {
|
|
73
74
|
"archgate-darwin-arm64": ">=0.1.1",
|
|
74
|
-
"archgate-linux-x64": ">=0.1.1"
|
|
75
|
+
"archgate-linux-x64": ">=0.1.1",
|
|
76
|
+
"archgate-win32-x64": ">=0.1.1"
|
|
75
77
|
}
|
|
76
78
|
}
|