@agentrules/cli 0.0.14 → 0.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/README.md +51 -50
- package/dist/index.js +5722 -1294
- package/package.json +16 -11
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @agentrules/cli
|
|
2
2
|
|
|
3
|
-
CLI for installing and publishing AGENT_RULES
|
|
3
|
+
CLI for installing and publishing AGENT_RULES rules.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
@@ -15,14 +15,14 @@ agentrules <command>
|
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
## Installing
|
|
18
|
+
## Installing Rules
|
|
19
19
|
|
|
20
|
-
### `agentrules add <
|
|
20
|
+
### `agentrules add <rule>`
|
|
21
21
|
|
|
22
|
-
Install a
|
|
22
|
+
Install a rule from the registry.
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
agentrules add <
|
|
25
|
+
agentrules add <rule> --platform <platform> [options]
|
|
26
26
|
```
|
|
27
27
|
|
|
28
28
|
**Options:**
|
|
@@ -42,7 +42,7 @@ agentrules add <preset> --platform <platform> [options]
|
|
|
42
42
|
**Examples:**
|
|
43
43
|
|
|
44
44
|
```bash
|
|
45
|
-
# Install a
|
|
45
|
+
# Install a rule for OpenCode
|
|
46
46
|
agentrules add agentic-dev-starter --platform opencode
|
|
47
47
|
|
|
48
48
|
# Install globally
|
|
@@ -52,7 +52,7 @@ agentrules add agentic-dev-starter --platform opencode --global
|
|
|
52
52
|
agentrules add agentic-dev-starter --platform opencode --version 1.0
|
|
53
53
|
|
|
54
54
|
# Version can also be specified with @ syntax
|
|
55
|
-
agentrules add agentic-dev-starter
|
|
55
|
+
agentrules add agentic-dev-starter@1.0 --platform opencode
|
|
56
56
|
|
|
57
57
|
# Preview what would be installed
|
|
58
58
|
agentrules add agentic-dev-starter --platform opencode --dry-run
|
|
@@ -60,11 +60,11 @@ agentrules add agentic-dev-starter --platform opencode --dry-run
|
|
|
60
60
|
|
|
61
61
|
---
|
|
62
62
|
|
|
63
|
-
## Creating
|
|
63
|
+
## Creating Rules
|
|
64
64
|
|
|
65
65
|
### `agentrules init [directory]`
|
|
66
66
|
|
|
67
|
-
Initialize a
|
|
67
|
+
Initialize a rule config in a platform directory. The command guides you through the publishing fields (with sensible defaults).
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
70
|
agentrules init [directory] [options]
|
|
@@ -74,10 +74,10 @@ agentrules init [directory] [options]
|
|
|
74
74
|
|
|
75
75
|
| Option | Description |
|
|
76
76
|
|--------|-------------|
|
|
77
|
-
| `-n, --name <name>` |
|
|
77
|
+
| `-n, --name <name>` | Rule name (default: `my-rule`) |
|
|
78
78
|
| `-t, --title <title>` | Display title |
|
|
79
|
-
| `--description <text>` |
|
|
80
|
-
| `-p, --platform <platform>` | Target platform |
|
|
79
|
+
| `--description <text>` | Rule description |
|
|
80
|
+
| `-p, --platform <platform>` | Target platform (repeatable). Supports `<platform>=<path>` mappings for multi-platform rules. |
|
|
81
81
|
| `-l, --license <license>` | License (e.g., `MIT`) |
|
|
82
82
|
| `-f, --force` | Overwrite existing config |
|
|
83
83
|
| `-y, --yes` | Accept defaults, skip prompts |
|
|
@@ -89,38 +89,42 @@ agentrules init [directory] [options]
|
|
|
89
89
|
cd .opencode
|
|
90
90
|
agentrules init
|
|
91
91
|
|
|
92
|
-
# Initialize in
|
|
93
|
-
agentrules init
|
|
92
|
+
# Initialize in current directory (interactive)
|
|
93
|
+
agentrules init
|
|
94
|
+
|
|
95
|
+
# Initialize non-interactively (requires --platform)
|
|
96
|
+
agentrules init --platform opencode --yes
|
|
94
97
|
|
|
95
|
-
#
|
|
96
|
-
agentrules init
|
|
98
|
+
# Multi-platform with per-platform source paths
|
|
99
|
+
agentrules init --platform opencode=opencode --platform cursor=cursor --yes
|
|
97
100
|
```
|
|
98
101
|
|
|
99
|
-
|
|
102
|
+
A typical single-platform rule structure is:
|
|
100
103
|
|
|
101
104
|
```
|
|
102
|
-
.
|
|
103
|
-
├── agentrules.json #
|
|
104
|
-
├──
|
|
105
|
-
├──
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
└── INSTALL.txt # Shown after install
|
|
105
|
+
.
|
|
106
|
+
├── agentrules.json # Rule config (created by init)
|
|
107
|
+
├── README.md # Shown on registry page (optional, not bundled)
|
|
108
|
+
├── LICENSE.md # Full license text (optional, not bundled)
|
|
109
|
+
├── INSTALL.txt # Shown after install (optional, not bundled)
|
|
110
|
+
├── AGENTS.md # Instruction file (optional)
|
|
111
|
+
└── command/
|
|
112
|
+
└── review.md
|
|
111
113
|
```
|
|
112
114
|
|
|
113
|
-
|
|
115
|
+
By default, files are collected from the config directory and bundled under the platform prefix (e.g. `command/review.md` → `.opencode/command/review.md`).
|
|
116
|
+
|
|
117
|
+
### Rule Config Fields
|
|
114
118
|
|
|
115
119
|
| Field | Required | Description |
|
|
116
120
|
|-------|----------|-------------|
|
|
117
121
|
| `name` | Yes | URL-safe identifier (lowercase, hyphens) |
|
|
118
122
|
| `title` | Yes | Display name |
|
|
119
|
-
| `description` |
|
|
123
|
+
| `description` | No | Short description (max 500 chars; recommended) |
|
|
120
124
|
| `license` | Yes | SPDX license identifier (e.g., `MIT`) |
|
|
121
|
-
| `
|
|
125
|
+
| `platforms` | Yes | Array of target platforms: `opencode`, `claude`, `cursor`, `codex` |
|
|
122
126
|
| `version` | No | Major version (default: 1) |
|
|
123
|
-
| `tags` | No |
|
|
127
|
+
| `tags` | No | 0-10 tags for discoverability (recommended) |
|
|
124
128
|
| `features` | No | Up to 5 key features to highlight |
|
|
125
129
|
| `ignore` | No | Additional patterns to exclude from bundle |
|
|
126
130
|
|
|
@@ -140,7 +144,7 @@ Use the `ignore` field for additional exclusions:
|
|
|
140
144
|
|
|
141
145
|
### `agentrules validate [path]`
|
|
142
146
|
|
|
143
|
-
Validate a
|
|
147
|
+
Validate a rule configuration before publishing.
|
|
144
148
|
|
|
145
149
|
```bash
|
|
146
150
|
# Validate current directory
|
|
@@ -152,9 +156,9 @@ agentrules validate .opencode
|
|
|
152
156
|
|
|
153
157
|
---
|
|
154
158
|
|
|
155
|
-
## Publishing
|
|
159
|
+
## Publishing Rules
|
|
156
160
|
|
|
157
|
-
Publish your
|
|
161
|
+
Publish your rule to [agentrules.directory](https://agentrules.directory) to reach developers and get a profile showcasing your rules.
|
|
158
162
|
|
|
159
163
|
### `agentrules login`
|
|
160
164
|
|
|
@@ -170,7 +174,7 @@ Show the currently authenticated user.
|
|
|
170
174
|
|
|
171
175
|
### `agentrules publish [path]`
|
|
172
176
|
|
|
173
|
-
Publish a
|
|
177
|
+
Publish a rule to the registry. Requires authentication.
|
|
174
178
|
|
|
175
179
|
```bash
|
|
176
180
|
agentrules publish [path] [options]
|
|
@@ -189,8 +193,8 @@ agentrules publish [path] [options]
|
|
|
189
193
|
# Publish current directory
|
|
190
194
|
agentrules publish
|
|
191
195
|
|
|
192
|
-
# Publish a specific
|
|
193
|
-
agentrules publish ./my-
|
|
196
|
+
# Publish a specific rule
|
|
197
|
+
agentrules publish ./my-rule
|
|
194
198
|
|
|
195
199
|
# Publish to major version 2
|
|
196
200
|
agentrules publish --version 2
|
|
@@ -199,34 +203,31 @@ agentrules publish --version 2
|
|
|
199
203
|
agentrules publish --dry-run
|
|
200
204
|
```
|
|
201
205
|
|
|
202
|
-
**Versioning:**
|
|
206
|
+
**Versioning:** Rules use `MAJOR.MINOR` versioning. You set the major version, and the registry auto-increments the minor version on each publish.
|
|
203
207
|
|
|
204
|
-
### `agentrules unpublish <
|
|
208
|
+
### `agentrules unpublish <rule>`
|
|
205
209
|
|
|
206
|
-
Remove a specific version of a
|
|
210
|
+
Remove a specific version of a rule from the registry. Requires authentication.
|
|
207
211
|
|
|
208
212
|
```bash
|
|
209
|
-
agentrules unpublish <
|
|
213
|
+
agentrules unpublish <rule> [options]
|
|
210
214
|
```
|
|
211
215
|
|
|
212
216
|
**Options:**
|
|
213
217
|
|
|
214
218
|
| Option | Description |
|
|
215
219
|
|--------|-------------|
|
|
216
|
-
| `-p, --platform <platform>` | Target platform (if not in
|
|
217
|
-
| `-V, --version <version>` | Version to unpublish (if not in
|
|
220
|
+
| `-p, --platform <platform>` | Target platform (if not in rule string) |
|
|
221
|
+
| `-V, --version <version>` | Version to unpublish (if not in rule string) |
|
|
218
222
|
|
|
219
223
|
**Examples:**
|
|
220
224
|
|
|
221
225
|
```bash
|
|
222
|
-
# Full format: slug.platform@version
|
|
223
|
-
agentrules unpublish my-preset.opencode@1.0
|
|
224
|
-
|
|
225
226
|
# With flags
|
|
226
|
-
agentrules unpublish my-
|
|
227
|
+
agentrules unpublish my-rule --platform opencode --version 1.0
|
|
227
228
|
|
|
228
|
-
#
|
|
229
|
-
agentrules unpublish my-
|
|
229
|
+
# Version can be specified with @ syntax
|
|
230
|
+
agentrules unpublish my-rule@1.0 --platform opencode
|
|
230
231
|
```
|
|
231
232
|
|
|
232
233
|
**Note:** Unpublished versions cannot be republished with the same version number.
|
|
@@ -258,7 +259,7 @@ Set the default registry.
|
|
|
258
259
|
|
|
259
260
|
### `agentrules registry build`
|
|
260
261
|
|
|
261
|
-
Build registry artifacts from
|
|
262
|
+
Build registry artifacts from rule directories. For self-hosted registries.
|
|
262
263
|
|
|
263
264
|
```bash
|
|
264
265
|
agentrules registry build -i <input> -o <output> [options]
|
|
@@ -268,7 +269,7 @@ agentrules registry build -i <input> -o <output> [options]
|
|
|
268
269
|
|
|
269
270
|
| Option | Description |
|
|
270
271
|
|--------|-------------|
|
|
271
|
-
| `-i, --input <path>` | Directory containing
|
|
272
|
+
| `-i, --input <path>` | Directory containing rule folders |
|
|
272
273
|
| `-o, --out <path>` | Output directory for registry artifacts |
|
|
273
274
|
| `-b, --bundle-base <url>` | URL prefix for bundle locations |
|
|
274
275
|
| `-c, --compact` | Emit minified JSON |
|