archgate 0.4.0 → 0.6.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 CHANGED
@@ -6,6 +6,7 @@
6
6
 
7
7
  [![License: FSL-1.1-ALv2](https://img.shields.io/badge/License-FSL--1.1--ALv2-blue.svg)](LICENSE.md)
8
8
  [![Release](https://github.com/archgate/cli/actions/workflows/release.yml/badge.svg)](https://github.com/archgate/cli/actions/workflows/release.yml)
9
+ [![Docs](https://img.shields.io/badge/docs-cli.archgate.dev-blue)](https://cli.archgate.dev)
9
10
 
10
11
  </div>
11
12
 
@@ -33,15 +34,38 @@ Archgate has two layers:
33
34
 
34
35
  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
36
 
36
- **The AI integration layer** is a Claude Code plugin that gives AI agents live access to your ADRs through the MCP server (`archgate mcp`). Agents read the decisions before writing code, validate changes after, and capture new patterns into the governance base. Archgate ships as its own governance subject — its own development is governed by the ADRs in `.archgate/adrs/`.
37
+ **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.
38
+
39
+ **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
40
 
38
41
  ## Installation
39
42
 
40
43
  ```bash
44
+ # npm
41
45
  npm install -g archgate
46
+
47
+ # Bun
48
+ bun install -g archgate
49
+
50
+ # Yarn
51
+ yarn global add archgate
52
+
53
+ # pnpm
54
+ pnpm add -g archgate
55
+ ```
56
+
57
+ You can also install Archgate as a dev dependency and run it through your package manager:
58
+
59
+ ```bash
60
+ # Install as dev dependency
61
+ npm install -D archgate # or: bun add -d archgate
62
+
63
+ # Run via package manager
64
+ npx archgate check # npm / Yarn / pnpm
65
+ bun run archgate check # Bun
42
66
  ```
43
67
 
44
- **Requirements:** macOS (arm64) or Linux (x86_64). Node.js is only needed to run the wrapper — the CLI itself is a standalone binary.
68
+ **Requirements:** macOS (arm64), Linux (x86_64), or Windows (x86_64). Node.js is only needed to run the npm/yarn/pnpm wrapper — the CLI itself is a standalone binary.
45
69
 
46
70
  > **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
71
  >
@@ -59,8 +83,8 @@ npm install -g archgate
59
83
  ## Quick start
60
84
 
61
85
  ```bash
62
- # 1. Install
63
- npm install -g archgate
86
+ # 1. Install (pick your package manager)
87
+ npm install -g archgate # or: bun install -g archgate
64
88
 
65
89
  # 2. Initialize governance in your project
66
90
  cd my-project
@@ -76,7 +100,9 @@ archgate init
76
100
  archgate check
77
101
  ```
78
102
 
79
- `archgate init` creates the `.archgate/adrs/` directory, an example ADR with a companion rules file to show the pattern, and configures the Claude Code plugin if you use it.
103
+ `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.
104
+
105
+ **Want AI agent integration?** See [Editor plugins](#editor-plugins) to add the optional paid plugin for Claude Code or Cursor.
80
106
 
81
107
  ## Writing rules
82
108
 
@@ -117,15 +143,37 @@ Rules receive the list of files to check (filtered by the ADR's `files` glob if
117
143
 
118
144
  ## Commands
119
145
 
146
+ ### `archgate login`
147
+
148
+ Authenticate with GitHub to access the optional paid editor plugins.
149
+
150
+ ```bash
151
+ archgate login # authenticate via GitHub Device Flow
152
+ archgate login status # show current auth status
153
+ archgate login logout # remove stored credentials
154
+ archgate login refresh # re-authenticate and claim a new token
155
+ ```
156
+
157
+ 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.
158
+
120
159
  ### `archgate init`
121
160
 
122
161
  Initialize governance in the current project.
123
162
 
124
163
  ```bash
125
- archgate init
164
+ archgate init # Claude Code (default)
165
+ archgate init --editor cursor # Cursor
166
+ archgate init --install-plugin # force plugin install attempt
126
167
  ```
127
168
 
128
- Creates `.archgate/adrs/` with an example ADR and rules file, and optionally wires up the Claude Code plugin.
169
+ 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.
170
+
171
+ **Plugin install behavior** (optional — requires `archgate login`):
172
+
173
+ - If you are logged in, init auto-detects your credentials and installs the plugin.
174
+ - 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.
175
+ - For **Cursor**: the plugin bundle is downloaded from [plugins.archgate.dev](https://plugins.archgate.dev) and extracted into `.cursor/`.
176
+ - Use `--install-plugin` to explicitly request plugin installation (useful if auto-detection is skipped).
129
177
 
130
178
  ### `archgate check`
131
179
 
@@ -230,15 +278,45 @@ pre-commit:
230
278
  run: archgate check --staged
231
279
  ```
232
280
 
233
- ## Claude Code plugin
281
+ ## Editor plugins
282
+
283
+ > **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.
284
+
285
+ Plugins are distributed from [plugins.archgate.dev](https://plugins.archgate.dev).
286
+
287
+ ### Setup
288
+
289
+ ```bash
290
+ # 1. Log in (one-time) — links your GitHub account and issues a plugin token
291
+ archgate login
292
+
293
+ # 2. Initialize a project with the plugin
294
+ archgate init # Claude Code (default)
295
+ archgate init --editor cursor # or Cursor
296
+ ```
297
+
298
+ If you are logged in, `archgate init` auto-detects your credentials and installs the plugin. You can also pass `--install-plugin` explicitly.
299
+
300
+ ### Claude Code
301
+
302
+ If the `claude` CLI is on your PATH, the plugin is installed automatically. Otherwise, run the printed commands manually:
303
+
304
+ ```bash
305
+ claude plugin marketplace add https://<user>:<token>@plugins.archgate.dev/archgate.git
306
+ claude plugin install archgate@archgate
307
+ ```
308
+
309
+ Once installed, run `archgate:onboard` in Claude Code to initialize governance for your project.
310
+
311
+ ### Cursor
312
+
313
+ The Cursor plugin bundle is downloaded from [plugins.archgate.dev](https://plugins.archgate.dev) and extracted into `.cursor/` automatically.
234
314
 
235
- The Claude Code plugin (`archgate:developer`) gives AI agents a full governance workflow:
315
+ Once installed, run the `ag-onboard` skill in Cursor to initialize governance for your project.
236
316
 
237
- - Reads applicable ADRs before writing code
238
- - Validates changes after implementation
239
- - Captures new patterns back into ADRs
317
+ ## Documentation
240
318
 
241
- Install the plugin from [archgate/claude-code-plugin](https://github.com/archgate/claude-code-plugin), then run `archgate:onboard` once in your project to initialize governance.
319
+ Full documentation is available at **[cli.archgate.dev](https://cli.archgate.dev)** -- including guides for writing ADRs, writing rules, CI integration, editor plugin setup, and the complete CLI and MCP reference.
242
320
 
243
321
  ## Contributing
244
322
 
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 linux/x64 only.`
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", "archgate");
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.4.0",
3
+ "version": "0.6.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",
@@ -21,8 +21,11 @@
21
21
  },
22
22
  "keywords": [
23
23
  "archgate",
24
- "cli",
25
- "framework"
24
+ "adr",
25
+ "architecture-decision-records",
26
+ "governance",
27
+ "linter",
28
+ "cli"
26
29
  ],
27
30
  "bugs": {
28
31
  "url": "https://github.com/archgate/cli/issues"
@@ -33,7 +36,8 @@
33
36
  },
34
37
  "os": [
35
38
  "darwin",
36
- "linux"
39
+ "linux",
40
+ "win32"
37
41
  ],
38
42
  "scripts": {
39
43
  "cli": "bun run src/cli.ts",
@@ -44,10 +48,13 @@
44
48
  "format:check": "prettier --check .",
45
49
  "test": "bun test --timeout 60000",
46
50
  "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",
51
+ "build:check": "bun build src/cli.ts --compile --bytecode --outfile dist/.build-check && rm -f dist/.build-check dist/.build-check.exe",
48
52
  "validate": "bun run lint && bun run typecheck && bun run format:check && bun test && bun run check && bun run build:check",
49
53
  "commit": "cz",
50
- "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0"
54
+ "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
55
+ "docs:dev": "cd docs && bunx --bun astro dev",
56
+ "docs:build": "cd docs && bunx --bun astro build",
57
+ "docs:preview": "cd docs && bunx --bun astro preview"
51
58
  },
52
59
  "type": "module",
53
60
  "devDependencies": {
@@ -71,6 +78,7 @@
71
78
  },
72
79
  "optionalDependencies": {
73
80
  "archgate-darwin-arm64": ">=0.1.1",
74
- "archgate-linux-x64": ">=0.1.1"
81
+ "archgate-linux-x64": ">=0.1.1",
82
+ "archgate-win32-x64": ">=0.1.1"
75
83
  }
76
84
  }