@agentrules/cli 0.1.0 → 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.
Files changed (3) hide show
  1. package/README.md +49 -45
  2. package/dist/index.js +5237 -1061
  3. 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 presets.
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 Presets
18
+ ## Installing Rules
19
19
 
20
- ### `agentrules add <preset>`
20
+ ### `agentrules add <rule>`
21
21
 
22
- Install a preset from the registry.
22
+ Install a rule from the registry.
23
23
 
24
24
  ```bash
25
- agentrules add <preset> --platform <platform> [options]
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 preset for OpenCode
45
+ # Install a rule for OpenCode
46
46
  agentrules add agentic-dev-starter --platform opencode
47
47
 
48
48
  # Install globally
@@ -60,11 +60,11 @@ agentrules add agentic-dev-starter --platform opencode --dry-run
60
60
 
61
61
  ---
62
62
 
63
- ## Creating Presets
63
+ ## Creating Rules
64
64
 
65
65
  ### `agentrules init [directory]`
66
66
 
67
- Initialize a preset config in a platform directory. The command guides you through the required fields for publishing.
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>` | Preset name (default: `my-preset`) |
77
+ | `-n, --name <name>` | Rule name (default: `my-rule`) |
78
78
  | `-t, --title <title>` | Display title |
79
- | `--description <text>` | Preset description |
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 a specific platform directory
93
- agentrules init .claude
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
- # Accept all defaults, skip prompts
96
- agentrules init .opencode --yes
98
+ # Multi-platform with per-platform source paths
99
+ agentrules init --platform opencode=opencode --platform cursor=cursor --yes
97
100
  ```
98
101
 
99
- After running `init`, your preset structure is:
102
+ A typical single-platform rule structure is:
100
103
 
101
104
  ```
102
- .opencode/
103
- ├── agentrules.json # Preset config (created by init)
104
- ├── AGENTS.md # Your config files (included in bundle)
105
- ├── commands/
106
- │ └── review.md
107
- └── .agentrules/ # Optional metadata folder
108
- ├── README.md # Shown on registry page
109
- ├── LICENSE.md # Full license text
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
- ### Preset Config Fields
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` | Yes | Short description (max 500 chars) |
123
+ | `description` | No | Short description (max 500 chars; recommended) |
120
124
  | `license` | Yes | SPDX license identifier (e.g., `MIT`) |
121
- | `platform` | Yes | Target platform: `opencode`, `claude`, `cursor`, `codex` |
125
+ | `platforms` | Yes | Array of target platforms: `opencode`, `claude`, `cursor`, `codex` |
122
126
  | `version` | No | Major version (default: 1) |
123
- | `tags` | Yes | 1-10 tags for discoverability |
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 preset configuration before publishing.
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 Presets
159
+ ## Publishing Rules
156
160
 
157
- Publish your preset to [agentrules.directory](https://agentrules.directory) to reach developers and get a profile showcasing your presets.
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 preset to the registry. Requires authentication.
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 preset
193
- agentrules publish ./my-preset
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,31 +203,31 @@ agentrules publish --version 2
199
203
  agentrules publish --dry-run
200
204
  ```
201
205
 
202
- **Versioning:** Presets use `MAJOR.MINOR` versioning. You set the major version, and the registry auto-increments the minor version on each publish.
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 <preset>`
208
+ ### `agentrules unpublish <rule>`
205
209
 
206
- Remove a specific version of a preset from the registry. Requires authentication.
210
+ Remove a specific version of a rule from the registry. Requires authentication.
207
211
 
208
212
  ```bash
209
- agentrules unpublish <preset> [options]
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 preset string) |
217
- | `-V, --version <version>` | Version to unpublish (if not in preset string) |
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
226
  # With flags
223
- agentrules unpublish my-preset --platform opencode --version 1.0
227
+ agentrules unpublish my-rule --platform opencode --version 1.0
224
228
 
225
229
  # Version can be specified with @ syntax
226
- agentrules unpublish my-preset@1.0 --platform opencode
230
+ agentrules unpublish my-rule@1.0 --platform opencode
227
231
  ```
228
232
 
229
233
  **Note:** Unpublished versions cannot be republished with the same version number.
@@ -255,7 +259,7 @@ Set the default registry.
255
259
 
256
260
  ### `agentrules registry build`
257
261
 
258
- Build registry artifacts from preset directories. For self-hosted registries.
262
+ Build registry artifacts from rule directories. For self-hosted registries.
259
263
 
260
264
  ```bash
261
265
  agentrules registry build -i <input> -o <output> [options]
@@ -265,7 +269,7 @@ agentrules registry build -i <input> -o <output> [options]
265
269
 
266
270
  | Option | Description |
267
271
  |--------|-------------|
268
- | `-i, --input <path>` | Directory containing preset folders |
272
+ | `-i, --input <path>` | Directory containing rule folders |
269
273
  | `-o, --out <path>` | Output directory for registry artifacts |
270
274
  | `-b, --bundle-base <url>` | URL prefix for bundle locations |
271
275
  | `-c, --compact` | Emit minified JSON |