agents-io 0.1.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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +295 -0
  3. package/dist/index.js +8570 -0
  4. package/package.json +52 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Sergej Popov
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,295 @@
1
+ # agents-io
2
+
3
+ Install AI coding agents from GitHub — or your local filesystem — into your project. One command, any tool.
4
+
5
+ ```bash
6
+ npx agents-io add owner/repo
7
+ ```
8
+
9
+ agents-io fetches an agent definition from a GitHub repo and installs it in the correct format for whichever AI coding tools you use — OpenCode, Claude Code, Codex, or Kiro.
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ # No install needed — run directly:
15
+ npx agents-io add owner/repo
16
+
17
+ # Or install globally:
18
+ npm i -g agents-io
19
+ ```
20
+
21
+ ## Quick start
22
+
23
+ ```bash
24
+ # Install an agent from GitHub
25
+ npx agents-io add acme/code-reviewer
26
+
27
+ # Install for a specific platform only
28
+ npx agents-io add acme/code-reviewer --platform claude-code
29
+
30
+ # Install globally (user-level, not project-level)
31
+ npx agents-io add acme/code-reviewer --global
32
+
33
+ # List installed agents
34
+ npx agents-io list
35
+
36
+ # Remove an agent
37
+ npx agents-io remove code-reviewer
38
+
39
+ # Scaffold a new agent
40
+ npx agents-io init my-agent
41
+
42
+ # Install from a local path
43
+ npx agents-io add ./my-agents/code-reviewer
44
+
45
+ # Update all installed agents
46
+ npx agents-io update
47
+
48
+ # Update a specific agent
49
+ npx agents-io update code-reviewer
50
+ ```
51
+
52
+ ## Commands
53
+
54
+ ### `add <source>`
55
+
56
+ Fetches `agent.md` from a GitHub repo or local directory and installs it for your detected tools.
57
+
58
+ When run without `--platform` or `--global` flags, agents-io prompts you to choose the install scope and target platforms interactively. Pass flags to skip prompts (useful for CI).
59
+
60
+ ```bash
61
+ npx agents-io add owner/repo
62
+ npx agents-io add owner/repo --platform opencode
63
+ npx agents-io add owner/repo --platform claude-code
64
+ npx agents-io add owner/repo --global
65
+ npx agents-io add owner/repo --path agents/reviewer
66
+ npx agents-io add ./path/to/agent
67
+ npx agents-io add /absolute/path/to/agent
68
+ npx agents-io add C:\Users\you\agents\reviewer
69
+ ```
70
+
71
+ | Flag | Description |
72
+ |------|-------------|
73
+ | `--platform <platform>` | Target a specific platform: `opencode`, `claude-code`, `codex`, or `kiro` |
74
+ | `--global` | Install to the tool's global config directory instead of the project |
75
+ | `--path <path>` | Subfolder within the repo that contains `agent.md` |
76
+
77
+ Flags skip the corresponding prompts. Without flags, agents-io asks interactively:
78
+
79
+ 1. **Scope** — Project (local) or Global (user-level). Default: local.
80
+ 2. **Platforms** — Which platforms to install for. Default: OpenCode only. Detected platforms are marked.
81
+
82
+ When `--platform` is omitted, agents-io auto-detects which tools you use by checking for their config files (`opencode.json`, `.claude/`, `.codex/`, `.kiro/`). If none are found, it defaults to OpenCode.
83
+
84
+ ### `list`
85
+
86
+ Lists all installed agents, both project-level and global.
87
+
88
+ ```bash
89
+ npx agents-io list
90
+ ```
91
+
92
+ ### `remove <name>`
93
+
94
+ Removes an installed agent by name.
95
+
96
+ ```bash
97
+ npx agents-io remove code-reviewer
98
+ npx agents-io remove code-reviewer --platform claude-code
99
+ npx agents-io remove code-reviewer --local
100
+ npx agents-io remove code-reviewer --global
101
+ npx agents-io remove code-reviewer --all
102
+ npx agents-io remove code-reviewer --all --platform opencode
103
+ ```
104
+
105
+ | Flag | Description |
106
+ |------|-------------|
107
+ | `--platform <platform>` | Remove only the selected platform install: `opencode`, `claude-code`, `codex`, or `kiro` |
108
+ | `--local` | Remove only the project-scoped install |
109
+ | `--global` | Remove only the global-scoped install |
110
+ | `--all` | Remove both project and global installs |
111
+
112
+ Default behavior is scope-aware and safe:
113
+
114
+ - If the agent exists only in the project lock file, agents-io removes the project install.
115
+ - If the agent exists only in the global lock file, agents-io removes the global install.
116
+ - If the agent exists in both scopes, agents-io stops and tells you to choose `--local`, `--global`, or `--all`.
117
+
118
+ When `--platform <platform>` is set, agents-io removes only that adapter's files. If other platforms still reference the same agent in that scope, the lock entry stays and `installedFor` is updated. If that was the last installed platform in the scope, the lock entry is removed.
119
+
120
+ CLI output always states which scope is being removed.
121
+
122
+ ### `init [name]`
123
+
124
+ Scaffolds a new agent template.
125
+
126
+ ```bash
127
+ npx agents-io init my-agent
128
+ ```
129
+
130
+ Creates `my-agent/agent.md` and `my-agent/README.md`. `agent.md` is the required contract. Add an optional `agent.json` only if you need extra settings like color, model, or tool-specific overrides. Edit the files, push to GitHub, and anyone can install it:
131
+
132
+ ```bash
133
+ npx agents-io add yourname/my-agent
134
+ ```
135
+
136
+ ### `update [name]`
137
+
138
+ Re-fetches installed agents from their original source and reinstalls if the content has changed. Without a name, updates all installed agents.
139
+
140
+ ```bash
141
+ npx agents-io update
142
+ npx agents-io update code-reviewer
143
+ npx agents-io update --global
144
+ npx agents-io update code-reviewer --platform opencode
145
+ ```
146
+
147
+ | Flag | Description |
148
+ |------|-------------|
149
+ | `--platform <platform>` | Only update for a specific platform |
150
+ | `--global` | Update global agents instead of project agents |
151
+
152
+ agents-io tracks content hashes in the lock file. If the hash matches, the agent is skipped. If it differs, the agent is re-installed.
153
+
154
+ When you run `update --platform <platform>`, agents-io updates only that adapter's files but keeps the full `installedFor` metadata intact.
155
+
156
+ ## How it works
157
+
158
+ 1. You run `npx agents-io add owner/repo`
159
+ 2. agents-io fetches `agent.md` from the repo (via `raw.githubusercontent.com`) or reads it from a local path
160
+ 3. It detects which AI coding tools are present in your project
161
+ 4. It converts the agent definition into each tool's native format and writes the files
162
+ 5. It tracks the installation in `agents-io-lock.json`
163
+
164
+ ### Local sources
165
+
166
+ When the source starts with `.`, `/`, contains `\`, or matches a Windows drive letter (e.g. `C:`), agents-io treats it as a local filesystem path instead of a GitHub repo. The local file is read directly — no network requests are made.
167
+
168
+ ## Agent format
169
+
170
+ Agents are defined by a required `agent.md` file — markdown with YAML frontmatter. This is OpenCode's native format and serves as the canonical representation.
171
+
172
+ ```yaml
173
+ ---
174
+ name: code-reviewer
175
+ description: "Reviews code for bugs, logic errors, and security issues"
176
+ mode: subagent
177
+ tools:
178
+ read: true
179
+ glob: true
180
+ grep: true
181
+ bash: false
182
+ write: false
183
+ edit: false
184
+ ---
185
+
186
+ # Code Reviewer
187
+
188
+ You are an expert code reviewer. Analyze the provided code for:
189
+ - Logic errors and bugs
190
+ - Security vulnerabilities
191
+ - Performance issues
192
+ ...
193
+ ```
194
+
195
+ ### Optional `agent.json`
196
+
197
+ If you need install-time settings that do not belong in the shared prompt contract, add an `agent.json` file next to `agent.md`. agents-io reads it when fetching from GitHub or a local path.
198
+
199
+ ```json
200
+ {
201
+ "color": "#0f766e",
202
+ "model": "claude-sonnet-4",
203
+ "opencode": {
204
+ "temperature": 0.2
205
+ },
206
+ "kiro": {
207
+ "tools": ["read", "shell"]
208
+ }
209
+ }
210
+ ```
211
+
212
+ ### Required fields
213
+
214
+ | Field | Type | Description |
215
+ |-------|------|-------------|
216
+ | `name` | string | Kebab-case identifier (e.g. `code-reviewer`) |
217
+ | `description` | string | One-line summary of what the agent does |
218
+
219
+ ### Optional fields
220
+
221
+ | Field | Type | Default | Description |
222
+ |-------|------|---------|-------------|
223
+ | `mode` | `"primary"` \| `"subagent"` | `"subagent"` | Whether this agent runs as the main agent or a delegated subagent |
224
+ | `tools` | `Record<string, boolean>` | — | Which tools the agent is allowed to use |
225
+
226
+ ### Tool-specific overrides
227
+
228
+ You can include per-tool configuration blocks in the frontmatter to control behavior that doesn't map cleanly across tools:
229
+
230
+ ```yaml
231
+ ---
232
+ name: code-reviewer
233
+ description: "Reviews code for bugs and security issues"
234
+ tools:
235
+ read: true
236
+ grep: true
237
+ write: false
238
+
239
+ claude-code:
240
+ permissions:
241
+ allow: ["Read", "Glob", "Grep"]
242
+ deny: ["Write", "Edit"]
243
+
244
+ kiro:
245
+ model: "claude-sonnet-4"
246
+ tools: ["read", "shell"]
247
+ ---
248
+ ```
249
+
250
+ ## Where agents get installed
251
+
252
+ Each tool has its own format and file structure. agents-io handles the conversion automatically.
253
+
254
+ | Tool | Writes to | Registers in |
255
+ |------|-----------|--------------|
256
+ | OpenCode | `agents/{name}.md` (markdown with frontmatter) | `opencode.json` |
257
+ | Claude Code | `.claude/agents/{name}.md` (plain markdown, no frontmatter) | `.claude/settings.json` |
258
+ | Codex | `AGENTS.md` (appends a delimited section) | — |
259
+ | Kiro | `.kiro/agents/{name}.json` | — |
260
+
261
+ ## Project vs global install
262
+
263
+ By default, agents install into your project directory. The project root is found by walking up from the current directory looking for `.git`, `package.json`, or `opencode.json`.
264
+
265
+ With `--global`, agents install into each tool's global config directory:
266
+
267
+ | Tool | Global directory |
268
+ |------|-----------------|
269
+ | OpenCode | `~/.config/opencode` |
270
+ | Claude Code | `~/.claude` |
271
+ | Codex | `~/.codex` |
272
+ | Kiro | `~/.kiro` |
273
+
274
+ ## Creating your own agent
275
+
276
+ ```bash
277
+ npx agents-io init my-agent
278
+ ```
279
+
280
+ This gives you a ready-to-publish template. The workflow:
281
+
282
+ 1. `npx agents-io init my-agent` — scaffold the files
283
+ 2. Edit `my-agent/agent.md` — write your agent's instructions and configure its frontmatter
284
+ 3. Push to GitHub
285
+ 4. Share: `npx agents-io add yourname/my-agent`
286
+
287
+ The only file that matters is `agent.md` at the repo root (or in a subfolder, installable via `--path`).
288
+
289
+ ## Lock file
290
+
291
+ agents-io tracks installations in `agents-io-lock.json` at the project root. This file records which agents are installed, their source repos, and which tools they were installed for. Commit it to version control so your team stays in sync.
292
+
293
+ ## License
294
+
295
+ MIT