Skip to content

feat(cursor): automated plugin install via tarball download#395

Merged
rhuanbarreto merged 8 commits into
mainfrom
feat/cursor-direct-install
Jun 6, 2026
Merged

feat(cursor): automated plugin install via tarball download#395
rhuanbarreto merged 8 commits into
mainfrom
feat/cursor-direct-install

Conversation

@rhuanbarreto

Copy link
Copy Markdown
Contributor

Summary

Completes the Cursor direct-install story started in archgate/plugins#114. Replaces the manual Team Marketplace URL instructions with automated tarball-based installation.

Key changes:

  • archgate plugin install --editor cursor now downloads the direct-install tarball from GET /api/cursor and extracts skills, agents, rules, and hooks into ~/.cursor/ — matching the opencode install pattern
  • archgate init --editor cursor now writes project-level governance files (.cursor/rules/archgate-governance.mdc + .cursor/hooks.json) for cloud agent compatibility, and auto-installs user-level components when credentials are available
  • installCursorPlugin(token) — download, extract to ~/.cursor/{skills,agents,rules}/, merge hooks.json
  • mergeCursorHooks() — safely merges archgate hooks into existing ~/.cursor/hooks.json without overwriting user hooks
  • cursorUserDir() — path helper for ~/.cursor/
  • configureCursorSettings() — upgraded from no-op to write project-level governance rule + hooks

Depends on

Test plan

  • bun run validate passes (1252 tests, 0 fail)
  • All cursor-settings, init-project, plugin/install, and integration tests updated and passing
  • archgate check passes (39/39 rules)
  • knip clean (no unused exports)
  • Build check passes (binary compiles successfully)

Replace the manual Team Marketplace URL instructions with automated
tarball-based installation, matching the opencode plugin install pattern.

`archgate plugin install --editor cursor` now downloads the Cursor
direct-install tarball from GET /api/cursor and extracts it into
~/.cursor/{skills,agents,rules}/, making archgate skills, agents, and
governance rules available globally for `cursor agent` sessions.

`archgate init --editor cursor` now writes project-level governance
files (.cursor/rules/archgate-governance.mdc + .cursor/hooks.json)
for cloud agent compatibility, and auto-installs the user-level
components when credentials are available.

Changes:
- Add installCursorPlugin() to plugin-install.ts (download + extract)
- Add mergeCursorHooks() for safe hooks.json merging
- Add cursorUserDir() path helper
- Update configureCursorSettings() to write project-level governance
- Update installForEditor/printManualInstructions for cursor
- Update tryInstallPlugin in init-project.ts for auto-install
- Update all cursor-related tests

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 3, 2026

Copy link
Copy Markdown

Deploying archgate-cli with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4b8a3c0
Status: ✅  Deploy successful!
Preview URL: https://a9cee2e0.archgate-cli.pages.dev
Branch Preview URL: https://feat-cursor-direct-install.archgate-cli.pages.dev

View logs

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Code Coverage

Metric Value
Lines 90.1% (6786 / 7531)
Threshold 90% minimum — met
Platforms Linux + Windows

Full HTML report available in workflow artifacts.

Per-directory breakdown
Directory Coverage Lines
src/commands/ 88.1% 2078 / 2359
src/engine/ 93.1% 1379 / 1481
src/formats/ 100.0% 141 / 141
src/helpers/ 89.8% 3188 / 3550

rhuanbarreto and others added 7 commits June 5, 2026 13:58
Cursor doesn't support user-level rule files — user rules are
configured only via the Settings UI. The governance rule as a
prompt-level hint can't enforce agent delegation, making it noise.

Keep only .cursor/hooks.json (afterFileEdit → archgate check) which
provides mechanical enforcement regardless of which agent is active.

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
The plugins PR dropped the governance rule from the tarball, but the
CLI still referenced ~/.cursor/rules/ in comments, JSDoc, and created
the directory during install. Align with the merged plugins output:
tarball contains only skills/, agents/, and hooks.json.

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Adds 4 tests for installCursorPlugin matching the installOpencodePlugin
pattern: success path, tar failure, 401 auth, and generic HTTP error.
Fixes coverage dropping below the 90% threshold.

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
DRY the tarball download+extract pattern shared by installCursorPlugin
and installOpencodePlugin into a single downloadAndExtractTarball()
function. Both callers now pass an options object (apiPath, token,
targetDir, label, tempFile) and handle only their editor-specific
post-extract logic (hooks merge for Cursor, settings config for
opencode).

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Rewrites the Cursor integration guide and updates plugin/init reference
pages to reflect the new distribution model: tarball download to
~/.cursor/{skills,agents}/ instead of Team Marketplace URL + VSIX.

Key changes across all locales (en, pt-br, nb):
- Distribution: Team Marketplace + VSIX → authenticated tarball
- Generated files: .cursor/rules/archgate-governance.mdc → .cursor/hooks.json
- Skill names: architect/quality-manager → archgate-reviewer/archgate-lessons-learned
- New agents section: archgate-developer + archgate-planner
- New cloud agent support section
- Updated llms-full.txt with new Cursor content

Signed-off-by: Rhuan Barreto <rhuan@barreto.work>
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@rhuanbarreto rhuanbarreto merged commit 41eb37e into main Jun 6, 2026
19 checks passed
@rhuanbarreto rhuanbarreto deleted the feat/cursor-direct-install branch June 6, 2026 14:41
@archgatebot archgatebot Bot mentioned this pull request Jun 7, 2026
rhuanbarreto pushed a commit that referenced this pull request Jun 9, 2026
# archgate

## [0.44.0](v0.43.0...v0.44.0)
(2026-06-09)

### Features

* **cursor:** automated plugin install via tarball download
([#395](#395))
([41eb37e](41eb37e))

### Bug Fixes

* **opencode:** extract to config dir and clean stale files on install
([#400](#400))
([51b41e7](51b41e7))

---
This PR was generated with
[simple-release](https://github.com/TrigenSoftware/simple-release).

<details>
<summary>📄 Cheatsheet</summary>
<br>



You can configure the bot's behavior through a pull request comment
using the `!simple-release/set-options` command.

### Command Format

````md
!simple-release/set-options

```json
{
  "bump": {},
  "publish": {}
}
```
````

### Useful Parameters

#### Bump

| Parameter | Type | Description |
|-----------|------|-------------|
| `version` | `string` | Force set specific version |
| `as` | `'major' \| 'minor' \| 'patch' \| 'prerelease'` | Release type
|
| `prerelease` | `string` | Pre-release identifier (e.g., "alpha",
"beta") |
| `firstRelease` | `boolean` | Whether this is the first release |
| `skip` | `boolean` | Skip version bump |
| `byProject` | `Record<string, object>` | Per-project bump options for
monorepos |

#### Publish

| Parameter | Type | Description |
|-----------|------|-------------|
| `skip` | `boolean` | Skip publishing |
| `access` | `'public' \| 'restricted'` | Package access level |
| `tag` | `string` | Tag for npm publication |

### Usage Examples

#### Force specific version

````md
!simple-release/set-options

```json
{
  "bump": {
    "version": "2.0.0"
  }
}
```
````

#### Force major bump

````md
!simple-release/set-options

```json
{
  "bump": {
    "as": "major"
  }
}
```
````

#### Create alpha pre-release

````md
!simple-release/set-options

```json
{
  "bump": {
    "prerelease": "alpha"
  }
}
```
````

#### Publish with specific access and tag

````md
!simple-release/set-options

```json
{
  "bump": {
    "prerelease": "beta"
  },
  "publish": {
    "access": "public",
    "tag": "beta"
  }
}
```
````

### Access Restrictions

The command can only be used by users with permissions:
- repository owner
- organization member
- collaborator

### Notes

- The last comment with `!simple-release/set-options` command takes
priority
- JSON must be valid, otherwise the command will be ignored
- Parameters apply only to the current release execution
- The command can be updated by editing the comment or adding a new one


</details>

<!--
  Please do not edit this comment.
  simple-release-pull-request: true
  simple-release-branch-from: release
  simple-release-branch-to: main
-->

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@archgatebot archgatebot Bot mentioned this pull request Jun 10, 2026
rhuanbarreto pushed a commit that referenced this pull request Jun 10, 2026
# archgate

## [0.45.0](v0.43.0...v0.45.0)
(2026-06-10)

### Features

* **cursor:** automated plugin install via tarball download
([#395](#395))
([41eb37e](41eb37e))

### Bug Fixes

* **opencode:** extract to config dir and clean stale files on install
([#400](#400))
([51b41e7](51b41e7))
* **tests:** eliminate user-scope pollution and global module mocks in
tests ([#401](#401))
([0cff642](0cff642))

---
This PR was generated with
[simple-release](https://github.com/TrigenSoftware/simple-release).

<details>
<summary>📄 Cheatsheet</summary>
<br>



You can configure the bot's behavior through a pull request comment
using the `!simple-release/set-options` command.

### Command Format

````md
!simple-release/set-options

```json
{
  "bump": {},
  "publish": {}
}
```
````

### Useful Parameters

#### Bump

| Parameter | Type | Description |
|-----------|------|-------------|
| `version` | `string` | Force set specific version |
| `as` | `'major' \| 'minor' \| 'patch' \| 'prerelease'` | Release type
|
| `prerelease` | `string` | Pre-release identifier (e.g., "alpha",
"beta") |
| `firstRelease` | `boolean` | Whether this is the first release |
| `skip` | `boolean` | Skip version bump |
| `byProject` | `Record<string, object>` | Per-project bump options for
monorepos |

#### Publish

| Parameter | Type | Description |
|-----------|------|-------------|
| `skip` | `boolean` | Skip publishing |
| `access` | `'public' \| 'restricted'` | Package access level |
| `tag` | `string` | Tag for npm publication |

### Usage Examples

#### Force specific version

````md
!simple-release/set-options

```json
{
  "bump": {
    "version": "2.0.0"
  }
}
```
````

#### Force major bump

````md
!simple-release/set-options

```json
{
  "bump": {
    "as": "major"
  }
}
```
````

#### Create alpha pre-release

````md
!simple-release/set-options

```json
{
  "bump": {
    "prerelease": "alpha"
  }
}
```
````

#### Publish with specific access and tag

````md
!simple-release/set-options

```json
{
  "bump": {
    "prerelease": "beta"
  },
  "publish": {
    "access": "public",
    "tag": "beta"
  }
}
```
````

### Access Restrictions

The command can only be used by users with permissions:
- repository owner
- organization member
- collaborator

### Notes

- The last comment with `!simple-release/set-options` command takes
priority
- JSON must be valid, otherwise the command will be ignored
- Parameters apply only to the current release execution
- The command can be updated by editing the comment or adding a new one


</details>

<!--
  Please do not edit this comment.
  simple-release-pull-request: true
  simple-release-branch-from: release
  simple-release-branch-to: main
-->

Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant