agentinit 1.7.0 → 1.8.1
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/CHANGELOG.md +33 -0
- package/README.md +127 -104
- package/dist/agents/Agent.d.ts +56 -0
- package/dist/agents/Agent.d.ts.map +1 -1
- package/dist/agents/Agent.js +133 -22
- package/dist/agents/Agent.js.map +1 -1
- package/dist/agents/AiderAgent.d.ts +9 -0
- package/dist/agents/AiderAgent.d.ts.map +1 -0
- package/dist/agents/AiderAgent.js +138 -0
- package/dist/agents/AiderAgent.js.map +1 -0
- package/dist/agents/ClaudeAgent.d.ts +4 -0
- package/dist/agents/ClaudeAgent.d.ts.map +1 -1
- package/dist/agents/ClaudeAgent.js +37 -18
- package/dist/agents/ClaudeAgent.js.map +1 -1
- package/dist/agents/ClaudeDesktopAgent.d.ts +5 -0
- package/dist/agents/ClaudeDesktopAgent.d.ts.map +1 -1
- package/dist/agents/ClaudeDesktopAgent.js +36 -2
- package/dist/agents/ClaudeDesktopAgent.js.map +1 -1
- package/dist/agents/ClineAgent.d.ts +8 -0
- package/dist/agents/ClineAgent.d.ts.map +1 -0
- package/dist/agents/ClineAgent.js +42 -0
- package/dist/agents/ClineAgent.js.map +1 -0
- package/dist/agents/CodexCliAgent.d.ts +4 -0
- package/dist/agents/CodexCliAgent.d.ts.map +1 -1
- package/dist/agents/CodexCliAgent.js +42 -8
- package/dist/agents/CodexCliAgent.js.map +1 -1
- package/dist/agents/CopilotAgent.d.ts +9 -0
- package/dist/agents/CopilotAgent.d.ts.map +1 -0
- package/dist/agents/CopilotAgent.js +135 -0
- package/dist/agents/CopilotAgent.js.map +1 -0
- package/dist/agents/CursorAgent.d.ts +4 -4
- package/dist/agents/CursorAgent.d.ts.map +1 -1
- package/dist/agents/CursorAgent.js +36 -43
- package/dist/agents/CursorAgent.js.map +1 -1
- package/dist/agents/DroidAgent.d.ts +5 -0
- package/dist/agents/DroidAgent.d.ts.map +1 -1
- package/dist/agents/DroidAgent.js +42 -18
- package/dist/agents/DroidAgent.js.map +1 -1
- package/dist/agents/GeminiCliAgent.d.ts +4 -0
- package/dist/agents/GeminiCliAgent.d.ts.map +1 -1
- package/dist/agents/GeminiCliAgent.js +40 -8
- package/dist/agents/GeminiCliAgent.js.map +1 -1
- package/dist/agents/MarkdownRulesAgent.d.ts +13 -0
- package/dist/agents/MarkdownRulesAgent.d.ts.map +1 -0
- package/dist/agents/MarkdownRulesAgent.js +53 -0
- package/dist/agents/MarkdownRulesAgent.js.map +1 -0
- package/dist/agents/RooCodeAgent.d.ts +9 -0
- package/dist/agents/RooCodeAgent.d.ts.map +1 -0
- package/dist/agents/RooCodeAgent.js +135 -0
- package/dist/agents/RooCodeAgent.js.map +1 -0
- package/dist/agents/WindsurfAgent.d.ts +9 -0
- package/dist/agents/WindsurfAgent.d.ts.map +1 -0
- package/dist/agents/WindsurfAgent.js +127 -0
- package/dist/agents/WindsurfAgent.js.map +1 -0
- package/dist/agents/ZedAgent.d.ts +9 -0
- package/dist/agents/ZedAgent.d.ts.map +1 -0
- package/dist/agents/ZedAgent.js +130 -0
- package/dist/agents/ZedAgent.js.map +1 -0
- package/dist/cli.js +30724 -11949
- package/dist/cli.js.map +1 -1
- package/dist/commands/apply.d.ts +10 -0
- package/dist/commands/apply.d.ts.map +1 -1
- package/dist/commands/apply.js +152 -3
- package/dist/commands/apply.js.map +1 -1
- package/dist/commands/detect.d.ts.map +1 -1
- package/dist/commands/detect.js +25 -0
- package/dist/commands/detect.js.map +1 -1
- package/dist/commands/init.js +1 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/mcp.d.ts +2 -7
- package/dist/commands/mcp.d.ts.map +1 -1
- package/dist/commands/mcp.js +594 -105
- package/dist/commands/mcp.js.map +1 -1
- package/dist/commands/plugins.d.ts +3 -0
- package/dist/commands/plugins.d.ts.map +1 -0
- package/dist/commands/plugins.js +309 -0
- package/dist/commands/plugins.js.map +1 -0
- package/dist/commands/revert.d.ts +7 -0
- package/dist/commands/revert.d.ts.map +1 -0
- package/dist/commands/revert.js +48 -0
- package/dist/commands/revert.js.map +1 -0
- package/dist/commands/rules.d.ts +3 -0
- package/dist/commands/rules.d.ts.map +1 -0
- package/dist/commands/rules.js +354 -0
- package/dist/commands/rules.js.map +1 -0
- package/dist/commands/skills.d.ts +3 -0
- package/dist/commands/skills.d.ts.map +1 -0
- package/dist/commands/skills.js +190 -0
- package/dist/commands/skills.js.map +1 -0
- package/dist/commands/sync.d.ts +1 -0
- package/dist/commands/sync.d.ts.map +1 -1
- package/dist/commands/sync.js +26 -2
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/verifyMcp.js +1 -1
- package/dist/commands/verifyMcp.js.map +1 -1
- package/dist/core/agentDetector.d.ts.map +1 -1
- package/dist/core/agentDetector.js +8 -2
- package/dist/core/agentDetector.js.map +1 -1
- package/dist/core/agentManager.d.ts.map +1 -1
- package/dist/core/agentManager.js +12 -0
- package/dist/core/agentManager.js.map +1 -1
- package/dist/core/gitignoreManager.d.ts +8 -0
- package/dist/core/gitignoreManager.d.ts.map +1 -0
- package/dist/core/gitignoreManager.js +114 -0
- package/dist/core/gitignoreManager.js.map +1 -0
- package/dist/core/managedState.d.ts +42 -0
- package/dist/core/managedState.d.ts.map +1 -0
- package/dist/core/managedState.js +194 -0
- package/dist/core/managedState.js.map +1 -0
- package/dist/core/pluginManager.d.ts +134 -0
- package/dist/core/pluginManager.d.ts.map +1 -0
- package/dist/core/pluginManager.js +845 -0
- package/dist/core/pluginManager.js.map +1 -0
- package/dist/core/projectSkills.d.ts +19 -0
- package/dist/core/projectSkills.d.ts.map +1 -0
- package/dist/core/projectSkills.js +105 -0
- package/dist/core/projectSkills.js.map +1 -0
- package/dist/core/projectStandards.d.ts +18 -0
- package/dist/core/projectStandards.d.ts.map +1 -0
- package/dist/core/projectStandards.js +50 -0
- package/dist/core/projectStandards.js.map +1 -0
- package/dist/core/propagator.d.ts +9 -1
- package/dist/core/propagator.d.ts.map +1 -1
- package/dist/core/propagator.js +197 -36
- package/dist/core/propagator.js.map +1 -1
- package/dist/core/rulesApplicator.d.ts +0 -4
- package/dist/core/rulesApplicator.d.ts.map +1 -1
- package/dist/core/rulesApplicator.js +8 -39
- package/dist/core/rulesApplicator.js.map +1 -1
- package/dist/core/rulesTemplateLoader.js +2 -2
- package/dist/core/rulesTemplateLoader.js.map +1 -1
- package/dist/core/skillsManager.d.ts +61 -0
- package/dist/core/skillsManager.d.ts.map +1 -0
- package/dist/core/skillsManager.js +419 -0
- package/dist/core/skillsManager.js.map +1 -0
- package/dist/types/index.d.ts +19 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/plugins.d.ts +161 -0
- package/dist/types/plugins.d.ts.map +1 -0
- package/dist/types/plugins.js +2 -0
- package/dist/types/plugins.js.map +1 -0
- package/dist/types/skills.d.ts +50 -0
- package/dist/types/skills.d.ts.map +1 -0
- package/dist/types/skills.js +2 -0
- package/dist/types/skills.js.map +1 -0
- package/package.json +7 -2
- package/dist/agentinit-1.7.0.tgz +0 -0
- package/dist/registry/mcpRegistry.d.ts +0 -12
- package/dist/registry/mcpRegistry.d.ts.map +0 -1
- package/dist/registry/mcpRegistry.js +0 -114
- package/dist/registry/mcpRegistry.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,36 @@
|
|
|
1
|
+
## [1.8.1](https://github.com/agentinit/agentinit/compare/v1.8.0...v1.8.1) (2026-03-29)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* align shared project standards and mcp verification ([b604e51](https://github.com/agentinit/agentinit/commit/b604e51d5c1226faea20b3f04b791d4f62c05d01))
|
|
7
|
+
|
|
8
|
+
# [1.8.0](https://github.com/agentinit/agentinit/compare/v1.7.0...v1.8.0) (2026-03-29)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* cicd ([1be823d](https://github.com/agentinit/agentinit/commit/1be823d97966ffabdb0dab7c1d1601422e3f0be3))
|
|
14
|
+
* **ci:** switch to npm trusted publishing with OIDC ([4434bb9](https://github.com/agentinit/agentinit/commit/4434bb9bd3708989ce31e31cb67c158bb59817ae))
|
|
15
|
+
* **ci:** upgrade semantic-release to v25 for OIDC support ([b05b81c](https://github.com/agentinit/agentinit/commit/b05b81c5b700f09440c476eca0736371eba9e241))
|
|
16
|
+
* **mcp:** pass verification timeout as options ([58e3e06](https://github.com/agentinit/agentinit/commit/58e3e064c216fdf127df930382858009019f8bca))
|
|
17
|
+
* **plugins:** avoid stale installs and temp skill leaks ([41bb185](https://github.com/agentinit/agentinit/commit/41bb185e3452fa0cae5f227c3455708eea83c5a5))
|
|
18
|
+
* **plugins:** require explicit marketplace for search ([8e500af](https://github.com/agentinit/agentinit/commit/8e500af9d09aa90e14e44e38e4da9f41d05cf541))
|
|
19
|
+
* **plugins:** require explicit marketplace prefixes ([4c6ba54](https://github.com/agentinit/agentinit/commit/4c6ba542fe07e3e6b687c9abc1ea18f09e51ff06))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* add project apply workflow with managed rollback ([f9e9616](https://github.com/agentinit/agentinit/commit/f9e96163fcdb95217ecdd5de364da890f4499f22))
|
|
25
|
+
* **cli:** split agent config into dedicated commands ([59b3726](https://github.com/agentinit/agentinit/commit/59b3726523dedb7b7684a97ea06c0883fd133e1b))
|
|
26
|
+
|
|
27
|
+
## Unreleased
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* fix plugin scope handling for global MCP installs/removals and targeted removals
|
|
32
|
+
* update docs and onboarding to the `mcp add|verify`, `rules add`, and `skills add` command model
|
|
33
|
+
|
|
1
34
|
# [1.7.0](https://github.com/agentinit/agentinit/compare/v1.6.0...v1.7.0) (2025-10-17)
|
|
2
35
|
|
|
3
36
|
|
package/README.md
CHANGED
|
@@ -9,8 +9,9 @@ AgentInit transforms AI agent configuration from a fragmented, manual process in
|
|
|
9
9
|
- **🤖 Universal Agent Configuration**: Unified `agents.md` file that syncs with all major AI coding agents
|
|
10
10
|
- **🔍 Smart Stack Detection**: Automatically detects project language, framework, and tools
|
|
11
11
|
- **🔄 Bidirectional Sync**: Keep agent configurations in sync across Claude, Cursor, Windsurf, and more
|
|
12
|
-
- **📦 MCP Management**:
|
|
12
|
+
- **📦 MCP Management**: Configure, inspect, and verify Model Context Protocol servers
|
|
13
13
|
- **📋 Rules Templates**: Apply coding best practices with predefined rule templates (Git, testing, docs, linting)
|
|
14
|
+
- **🔌 Plugin Marketplace**: Install portable skills and MCP bundles from explicit marketplace sources
|
|
14
15
|
- **⚙️ Project Templates**: Pre-built templates for web apps, CLI tools, libraries, and more
|
|
15
16
|
- **🎯 Stack-Aware Guidance**: Customized instructions based on your technology stack
|
|
16
17
|
|
|
@@ -35,8 +36,12 @@ agentinit detect
|
|
|
35
36
|
# Sync agents.md with agent-specific files
|
|
36
37
|
agentinit sync
|
|
37
38
|
|
|
38
|
-
#
|
|
39
|
-
agentinit
|
|
39
|
+
# Apply project-owned agent files, skills, and ignore management
|
|
40
|
+
agentinit apply
|
|
41
|
+
|
|
42
|
+
# Add and verify an MCP server
|
|
43
|
+
agentinit mcp add --verify \
|
|
44
|
+
--mcp-stdio everything "npx -y @modelcontextprotocol/server-everything"
|
|
40
45
|
```
|
|
41
46
|
|
|
42
47
|
## 📋 Commands
|
|
@@ -77,139 +82,148 @@ Sync agents.md with agent-specific configuration files.
|
|
|
77
82
|
|
|
78
83
|
```bash
|
|
79
84
|
agentinit sync # Sync configurations
|
|
85
|
+
agentinit sync --agent claude cursor
|
|
80
86
|
agentinit sync --dry-run # Preview changes
|
|
81
87
|
agentinit sync --backup # Create backups
|
|
82
88
|
```
|
|
83
89
|
|
|
84
|
-
### `agentinit
|
|
90
|
+
### `agentinit apply`
|
|
85
91
|
|
|
86
|
-
|
|
92
|
+
Apply `agents.md` plus project-owned skills to supported agent files, and manage ignore entries for generated files.
|
|
87
93
|
|
|
88
94
|
```bash
|
|
89
|
-
agentinit
|
|
90
|
-
agentinit
|
|
91
|
-
agentinit
|
|
92
|
-
agentinit
|
|
95
|
+
agentinit apply # Sync + project skills + managed ignore block
|
|
96
|
+
agentinit apply --agent claude cursor # Target specific agents
|
|
97
|
+
agentinit apply --dry-run # Preview changes
|
|
98
|
+
agentinit apply --backup # Create sibling .agentinit.backup files
|
|
99
|
+
agentinit apply --no-skills # Skip project-owned skills
|
|
100
|
+
agentinit apply --gitignore-local # Write ignore entries to .git/info/exclude
|
|
93
101
|
```
|
|
94
102
|
|
|
95
|
-
### `agentinit
|
|
103
|
+
### `agentinit mcp`
|
|
96
104
|
|
|
97
|
-
|
|
105
|
+
Manage Model Context Protocol server configurations.
|
|
98
106
|
|
|
99
107
|
**Examples:**
|
|
100
108
|
```bash
|
|
101
|
-
#
|
|
102
|
-
agentinit
|
|
103
|
-
# Verify STDIO server
|
|
104
|
-
agentinit verify_mcp --mcp-stdio everything "npx -y @modelcontextprotocol/server-everything"
|
|
105
|
-
# Verify HTTP server
|
|
106
|
-
agentinit verify_mcp --mcp-http notion_api "https://mcp.notion.com/mcp" --timeout 30000
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
Shows connection status, response time, and available tools/resources/prompts for each MCP server.
|
|
110
|
-
|
|
111
|
-
### `agentinit apply`
|
|
112
|
-
|
|
113
|
-
Apply configurations including MCP server setup.
|
|
114
|
-
|
|
115
|
-
#### MCP Configuration
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
# Configure STDIO MCP with everything server (recommended example)
|
|
120
|
-
npx agentinit apply \
|
|
109
|
+
# Add a project-local STDIO server
|
|
110
|
+
agentinit mcp add \
|
|
121
111
|
--mcp-stdio everything "npx -y @modelcontextprotocol/server-everything"
|
|
122
112
|
|
|
123
|
-
#
|
|
124
|
-
|
|
125
|
-
--mcp-stdio everything "npx -y @modelcontextprotocol/server-everything" \
|
|
113
|
+
# Add multiple servers and verify them immediately
|
|
114
|
+
agentinit mcp add --verify \
|
|
126
115
|
--mcp-stdio supabase "npx -y @supabase/mcp-server-supabase@latest" \
|
|
127
116
|
--args "--read-only --project-ref=<project-ref>" \
|
|
128
117
|
--env "SUPABASE_ACCESS_TOKEN=<personal-access-token>" \
|
|
129
|
-
--mcp-http notion_api "https://mcp.notion.com/mcp"
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
--header "CONTEXT7_API_KEY:YOUR_API_KEY"
|
|
140
|
-
|
|
141
|
-
# Multiple custom headers
|
|
142
|
-
npx agentinit apply \
|
|
143
|
-
--mcp-http api_server "https://api.example.com/mcp" \
|
|
144
|
-
--header "X-API-Key:YOUR_API_KEY" \
|
|
145
|
-
--header "X-Client-ID:YOUR_CLIENT_ID"
|
|
146
|
-
|
|
147
|
-
# Combine Bearer auth with custom headers
|
|
148
|
-
npx agentinit apply \
|
|
149
|
-
--mcp-http advanced_api "https://api.example.com/mcp" \
|
|
150
|
-
--auth "Bearer YOUR_TOKEN" \
|
|
151
|
-
--header "X-Custom-Header:custom_value"
|
|
152
|
-
|
|
153
|
-
# Configure Docker-based MCP with environment
|
|
154
|
-
npx agentinit apply \
|
|
155
|
-
--mcp-stdio browserbase "docker run -i --rm ghcr.io/metorial/mcp-container--browserbase--mcp-server-browserbase--browserbase node cli.js" \
|
|
156
|
-
--env "BROWSERBASE_API_KEY=browserbase-api-key"
|
|
157
|
-
|
|
158
|
-
# Global configuration with custom headers
|
|
159
|
-
npx agentinit apply --global --client claude \
|
|
160
|
-
--mcp-http context7 "https://mcp.context7.com/mcp" \
|
|
161
|
-
--header "CONTEXT7_API_KEY:YOUR_API_KEY"
|
|
162
|
-
|
|
163
|
-
# Verify MCPs immediately after configuration
|
|
164
|
-
npx agentinit apply --verify-mcp \
|
|
165
|
-
--mcp-stdio everything "npx -y @modelcontextprotocol/server-everything"
|
|
118
|
+
--mcp-http notion_api "https://mcp.notion.com/mcp"
|
|
119
|
+
|
|
120
|
+
# Manage global MCP config for a specific agent
|
|
121
|
+
agentinit mcp list --global --agent claude
|
|
122
|
+
agentinit mcp remove notion_api --global --agent claude
|
|
123
|
+
|
|
124
|
+
# Verify existing configs or direct MCP args
|
|
125
|
+
agentinit mcp verify --all
|
|
126
|
+
agentinit mcp verify --name exa
|
|
127
|
+
agentinit mcp verify --mcp-http notion_api "https://mcp.notion.com/mcp" --timeout 30000
|
|
166
128
|
```
|
|
167
129
|
|
|
168
|
-
|
|
130
|
+
Shows connection status, response time, and available tools/resources/prompts for each MCP server.
|
|
169
131
|
|
|
170
132
|
**MCP Authentication Options**:
|
|
171
133
|
- `--auth "Bearer TOKEN"` - Adds Authorization header for Bearer token authentication
|
|
172
134
|
- `--header "KEY:VALUE"` - Adds custom headers in KEY:VALUE format (can be used multiple times)
|
|
173
135
|
- Both flags can be combined for APIs requiring multiple authentication methods
|
|
174
136
|
|
|
175
|
-
|
|
137
|
+
### `agentinit rules`
|
|
176
138
|
|
|
177
|
-
|
|
178
|
-
# Verify with custom timeout
|
|
179
|
-
npx agentinit apply --verify-mcp --timeout 30000 \
|
|
180
|
-
--mcp-stdio chrome-mcp "bunx -y chrome-devtools-mcp@latest"
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
#### Rules Configuration
|
|
184
|
-
|
|
185
|
-
Apply coding rules and best practices to your AI agents using predefined templates or custom rules.
|
|
139
|
+
Manage coding rules independently from MCP configuration.
|
|
186
140
|
|
|
141
|
+
**Examples:**
|
|
187
142
|
```bash
|
|
188
|
-
#
|
|
189
|
-
agentinit
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
agentinit apply --rules git,write_docs --rule-raw "Use TypeScript strict mode"
|
|
193
|
-
|
|
194
|
-
# Load rules from a file
|
|
195
|
-
agentinit apply --rules-file ./project-rules.md
|
|
143
|
+
# Add rules from templates, raw text, files, or URLs
|
|
144
|
+
agentinit rules add --template git,write_tests,use_linter
|
|
145
|
+
agentinit rules add --template git --raw "Use TypeScript strict mode"
|
|
146
|
+
agentinit rules add --file ./project-rules.md
|
|
196
147
|
|
|
197
|
-
#
|
|
198
|
-
agentinit
|
|
148
|
+
# Inspect and remove configured rules
|
|
149
|
+
agentinit rules list
|
|
150
|
+
agentinit rules remove git write_tests
|
|
199
151
|
|
|
200
|
-
#
|
|
201
|
-
agentinit
|
|
152
|
+
# Apply globally when the target agent supports global rules
|
|
153
|
+
agentinit rules add --global --agent claude --template git,write_tests
|
|
202
154
|
```
|
|
203
155
|
|
|
204
156
|
**Available Rule Templates:**
|
|
205
157
|
- `git` - Enforce Git workflows and commit standards
|
|
206
158
|
- `write_docs` - Require comprehensive documentation
|
|
207
|
-
- `use_git_worktrees` - Enable parallel development with worktrees
|
|
159
|
+
- `use_git_worktrees` - Enable parallel development with worktrees
|
|
208
160
|
- `use_subagents` - Delegate work to specialized subagents
|
|
209
161
|
- `use_linter` - Enforce code quality and formatting
|
|
210
162
|
- `write_tests` - Implement test-driven development practices
|
|
211
163
|
|
|
212
|
-
|
|
164
|
+
### `agentinit skills`
|
|
165
|
+
|
|
166
|
+
Install, list, and remove reusable agent skills from local paths or GitHub repositories.
|
|
167
|
+
|
|
168
|
+
**Examples:**
|
|
169
|
+
```bash
|
|
170
|
+
# Inspect a source before installing
|
|
171
|
+
agentinit skills add owner/repo --list
|
|
172
|
+
|
|
173
|
+
# Install all discovered skills for detected agents
|
|
174
|
+
agentinit skills add ./skills
|
|
175
|
+
|
|
176
|
+
# Install selected skills globally for a specific agent
|
|
177
|
+
agentinit skills add owner/repo --global --agent claude --skill openai-docs
|
|
178
|
+
|
|
179
|
+
# Review and clean up installed skills
|
|
180
|
+
agentinit skills list
|
|
181
|
+
agentinit skills remove openai-docs
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### `agentinit plugins`
|
|
185
|
+
|
|
186
|
+
Install, inspect, search, and remove portable plugins from explicit marketplace sources, GitHub repositories, or local paths.
|
|
187
|
+
|
|
188
|
+
**Examples:**
|
|
189
|
+
```bash
|
|
190
|
+
# Search a marketplace explicitly
|
|
191
|
+
agentinit plugins search --from claude
|
|
192
|
+
agentinit plugins search code-review --from claude
|
|
193
|
+
|
|
194
|
+
# Install from a marketplace explicitly
|
|
195
|
+
agentinit plugins install claude/code-review
|
|
196
|
+
agentinit plugins install code-review --from claude
|
|
197
|
+
|
|
198
|
+
# Install from GitHub or a local path
|
|
199
|
+
agentinit plugins install owner/repo
|
|
200
|
+
agentinit plugins install ./plugins/code-review
|
|
201
|
+
|
|
202
|
+
# Inspect and remove installed plugins
|
|
203
|
+
agentinit plugins list
|
|
204
|
+
agentinit plugins remove code-review
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
**Marketplace Rules:**
|
|
208
|
+
- Marketplace installs are explicit by design. Bare names like `agentinit plugins install code-review` are rejected.
|
|
209
|
+
- Use `<marketplace>/<plugin>` or `--from <marketplace>` when installing from a marketplace.
|
|
210
|
+
- `plugins search` also requires `--from <marketplace>`.
|
|
211
|
+
- Only `claude` is implemented today, mapped to Anthropic's `claude-plugins-official` marketplace.
|
|
212
|
+
|
|
213
|
+
### `agentinit revert`
|
|
214
|
+
|
|
215
|
+
Revert files and backups managed by `agentinit apply` or `agentinit sync`.
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
agentinit revert # Restore backups and remove generated files
|
|
219
|
+
agentinit revert --dry-run # Preview what would be reverted
|
|
220
|
+
agentinit revert --keep-backups
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Compatibility
|
|
224
|
+
|
|
225
|
+
`agentinit apply` is now the project-level orchestration command for sync, project skills, and managed ignore state.
|
|
226
|
+
Legacy `agentinit apply --mcp-*`, `--rules`, and related flags still work for backward compatibility, and `agentinit verify_mcp` remains deprecated in favor of `agentinit mcp verify`.
|
|
213
227
|
|
|
214
228
|
## 🏗️ Project Structure
|
|
215
229
|
|
|
@@ -219,11 +233,10 @@ AgentInit creates and manages these key files:
|
|
|
219
233
|
your-project/
|
|
220
234
|
├── agents.md # Universal agent configuration
|
|
221
235
|
├── CLAUDE.md # Claude-specific config (synced)
|
|
222
|
-
├── .
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
└── .windsurfrules # Windsurf-specific config (synced)
|
|
236
|
+
├── .cursorrules # Cursor-specific config (synced)
|
|
237
|
+
├── AGENTS.md # Shared AGENTS.md standard for supporting agents
|
|
238
|
+
├── .windsurfrules # Windsurf-specific config (synced)
|
|
239
|
+
└── .agentinit/ # Managed state and internal backups
|
|
227
240
|
```
|
|
228
241
|
|
|
229
242
|
## 📖 Configuration
|
|
@@ -260,12 +273,22 @@ This is a TypeScript project using Next.js...
|
|
|
260
273
|
|
|
261
274
|
### Supported Agents
|
|
262
275
|
|
|
276
|
+
`AGENTS.md` is a shared standard used by multiple tools, so AgentInit does not use it by itself as an auto-detection signal.
|
|
277
|
+
|
|
263
278
|
| Agent | Config File | Status |
|
|
264
279
|
|-------|-------------|--------|
|
|
265
280
|
| Claude | `CLAUDE.md` | ✅ |
|
|
266
|
-
|
|
|
281
|
+
| Claude Desktop | global desktop config | ✅ |
|
|
282
|
+
| Cursor | `.cursorrules` | ✅ |
|
|
267
283
|
| Windsurf | `.windsurfrules` | ✅ |
|
|
268
|
-
| Copilot | `.
|
|
284
|
+
| GitHub Copilot | `AGENTS.md`, `.vscode/mcp.json` | ✅ |
|
|
285
|
+
| Aider | `AGENTS.md`, `.aider.conf.yml` | ✅ |
|
|
286
|
+
| Cline | `.clinerules` | ✅ |
|
|
287
|
+
| Codex CLI | `.codex/config.toml` | ✅ |
|
|
288
|
+
| Gemini CLI | `.gemini/settings.json` | ✅ |
|
|
289
|
+
| RooCode | `AGENTS.md`, `.roo/mcp.json` | ✅ |
|
|
290
|
+
| Zed | `AGENTS.md`, `.zed/settings.json` | ✅ |
|
|
291
|
+
| Droid | `AGENTS.md`, `.factory/mcp.json` | ✅ |
|
|
269
292
|
| Codeium | `.codeium/config.json` | 🚧 |
|
|
270
293
|
|
|
271
294
|
## 🔧 Stack Detection
|
|
@@ -644,4 +667,4 @@ MIT License - see [LICENSE](LICENSE) file for details.
|
|
|
644
667
|
|
|
645
668
|
---
|
|
646
669
|
|
|
647
|
-
**AgentInit** - Unify your AI agent configurations, amplify your development workflow.
|
|
670
|
+
**AgentInit** - Unify your AI agent configurations, amplify your development workflow.
|
package/dist/agents/Agent.d.ts
CHANGED
|
@@ -44,6 +44,16 @@ export declare abstract class Agent {
|
|
|
44
44
|
* Returns null if global configuration is not supported
|
|
45
45
|
*/
|
|
46
46
|
getGlobalMcpPath(): string | null;
|
|
47
|
+
/**
|
|
48
|
+
* Get the project rules path for this agent
|
|
49
|
+
* Returns null if rules are not supported
|
|
50
|
+
*/
|
|
51
|
+
getProjectRulesPath(projectPath: string): string | null;
|
|
52
|
+
/**
|
|
53
|
+
* Get the global rules path for this agent
|
|
54
|
+
* Returns null if global rules are not supported
|
|
55
|
+
*/
|
|
56
|
+
getGlobalRulesPath(): string | null;
|
|
47
57
|
/**
|
|
48
58
|
* Check if this agent supports global configuration
|
|
49
59
|
*/
|
|
@@ -102,6 +112,52 @@ export declare abstract class Agent {
|
|
|
102
112
|
* Apply rules configuration to this agent's global config
|
|
103
113
|
*/
|
|
104
114
|
applyGlobalRules(rules: AppliedRules): Promise<RuleApplicationResult>;
|
|
115
|
+
/**
|
|
116
|
+
* Check if this agent supports skills
|
|
117
|
+
*/
|
|
118
|
+
supportsSkills(): boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Get the skills directory for this agent
|
|
121
|
+
* Returns null if skills are not supported
|
|
122
|
+
*/
|
|
123
|
+
getSkillsDir(projectPath: string, global?: boolean): string | null;
|
|
124
|
+
/**
|
|
125
|
+
* Return the project-level shared rules standard used by this agent, if any.
|
|
126
|
+
*/
|
|
127
|
+
getProjectRulesStandard(): 'claude' | 'agents' | null;
|
|
128
|
+
/**
|
|
129
|
+
* Return the project-level shared skills standard used by this agent, if any.
|
|
130
|
+
*/
|
|
131
|
+
getProjectSkillsStandard(): 'claude' | 'agents' | null;
|
|
132
|
+
/**
|
|
133
|
+
* Check whether this agent supports project-scoped MCP configuration.
|
|
134
|
+
*/
|
|
135
|
+
supportsProjectMcpConfig(): boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Check if this agent supports global rules configuration
|
|
138
|
+
*/
|
|
139
|
+
supportsGlobalRules(): boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Remove an MCP server by name from this agent's configuration
|
|
142
|
+
* Must be implemented by each specific agent
|
|
143
|
+
*/
|
|
144
|
+
abstract removeMCPServer(projectPath: string, serverName: string): Promise<boolean>;
|
|
145
|
+
/**
|
|
146
|
+
* Remove an MCP server from global configuration
|
|
147
|
+
*/
|
|
148
|
+
removeGlobalMCPServer(serverName: string): Promise<boolean>;
|
|
149
|
+
/**
|
|
150
|
+
* Get existing MCP servers from this agent's global configuration
|
|
151
|
+
*/
|
|
152
|
+
getGlobalMCPServers(): Promise<MCPServerConfig[]>;
|
|
153
|
+
/**
|
|
154
|
+
* Replace existing markdown rule sections and append the desired rules once.
|
|
155
|
+
*/
|
|
156
|
+
protected replaceMarkdownRulesSections(existingContent: string, sections: RuleSection[], headingPattern: RegExp): string;
|
|
157
|
+
/**
|
|
158
|
+
* Run an operation against the agent's global MCP file using the native parser.
|
|
159
|
+
*/
|
|
160
|
+
protected withGlobalMcpPath<T>(operation: (projectPath: string) => Promise<T>): Promise<T>;
|
|
105
161
|
/**
|
|
106
162
|
* Get a summary of this agent
|
|
107
163
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Agent.d.ts","sourceRoot":"","sources":["../../src/agents/Agent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Agent.d.ts","sourceRoot":"","sources":["../../src/agents/Agent.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,eAAe,EACf,eA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U,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIjE;;OAEG;IACG,mBAAmB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;IAIvD;;OAEG;IACH,SAAS,CAAC,4BAA4B,CACpC,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,WAAW,EAAE,EACvB,cAAc,EAAE,MAAM,GACrB,MAAM;IAqCT;;OAEG;cACa,iBAAiB,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAoBhG;;OAEG;IACH,QAAQ,IAAI,MAAM;CAGnB"}
|
package/dist/agents/Agent.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { resolve } from 'path';
|
|
2
|
+
import { homedir } from 'os';
|
|
2
3
|
import { pathExists } from '../utils/fs.js';
|
|
3
4
|
import { getFullGlobalConfigPath } from '../utils/paths.js';
|
|
4
5
|
import { RulesApplicator } from '../core/rulesApplicator.js';
|
|
@@ -75,6 +76,26 @@ export class Agent {
|
|
|
75
76
|
getGlobalMcpPath() {
|
|
76
77
|
return getFullGlobalConfigPath(this.definition.globalConfigPath, this.definition.globalConfigPaths);
|
|
77
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Get the project rules path for this agent
|
|
81
|
+
* Returns null if rules are not supported
|
|
82
|
+
*/
|
|
83
|
+
getProjectRulesPath(projectPath) {
|
|
84
|
+
if (!this.capabilities.rules || !this.definition.rulesPath) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
return resolve(projectPath, this.definition.rulesPath);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Get the global rules path for this agent
|
|
91
|
+
* Returns null if global rules are not supported
|
|
92
|
+
*/
|
|
93
|
+
getGlobalRulesPath() {
|
|
94
|
+
if (!this.capabilities.rules) {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
return getFullGlobalConfigPath(this.definition.globalRulesPath, this.definition.globalRulesPaths);
|
|
98
|
+
}
|
|
78
99
|
/**
|
|
79
100
|
* Check if this agent supports global configuration
|
|
80
101
|
*/
|
|
@@ -94,25 +115,7 @@ export class Agent {
|
|
|
94
115
|
* Can be overridden by specific agents for different global config formats
|
|
95
116
|
*/
|
|
96
117
|
async applyGlobalMCPConfig(servers) {
|
|
97
|
-
|
|
98
|
-
if (!globalPath) {
|
|
99
|
-
throw new Error(`Agent ${this.name} does not support global configuration`);
|
|
100
|
-
}
|
|
101
|
-
// Extract directory from global path and use it as "project path"
|
|
102
|
-
// This allows reusing the existing applyMCPConfig logic
|
|
103
|
-
const lastSlashIndex = Math.max(globalPath.lastIndexOf('/'), globalPath.lastIndexOf('\\'));
|
|
104
|
-
const globalDir = lastSlashIndex > 0 ? globalPath.substring(0, lastSlashIndex) : '';
|
|
105
|
-
// Temporarily override the native config path to point to global config
|
|
106
|
-
const originalNativeConfigPath = this.definition.nativeConfigPath;
|
|
107
|
-
const globalFileName = globalPath.substring(lastSlashIndex + 1);
|
|
108
|
-
this.definition.nativeConfigPath = globalFileName;
|
|
109
|
-
try {
|
|
110
|
-
await this.applyMCPConfig(globalDir, servers);
|
|
111
|
-
}
|
|
112
|
-
finally {
|
|
113
|
-
// Restore original native config path
|
|
114
|
-
this.definition.nativeConfigPath = originalNativeConfigPath;
|
|
115
|
-
}
|
|
118
|
+
await this.withGlobalMcpPath(projectPath => this.applyMCPConfig(projectPath, servers));
|
|
116
119
|
}
|
|
117
120
|
/**
|
|
118
121
|
* Filter MCP servers based on this agent's capabilities
|
|
@@ -152,18 +155,126 @@ export class Agent {
|
|
|
152
155
|
*/
|
|
153
156
|
async applyGlobalRules(rules) {
|
|
154
157
|
const applicator = new RulesApplicator();
|
|
155
|
-
if (!this.
|
|
158
|
+
if (!this.supportsGlobalRules()) {
|
|
156
159
|
return {
|
|
157
160
|
success: false,
|
|
158
161
|
rulesApplied: 0,
|
|
159
162
|
agent: this.name,
|
|
160
163
|
configPath: '',
|
|
161
|
-
errors: [`Agent ${this.name} does not support global
|
|
164
|
+
errors: [`Agent ${this.name} does not support global rules`]
|
|
162
165
|
};
|
|
163
166
|
}
|
|
164
|
-
// Use empty string as project path for global config
|
|
165
167
|
return applicator.applyRulesToAgent(this, rules, '', true);
|
|
166
168
|
}
|
|
169
|
+
/**
|
|
170
|
+
* Check if this agent supports skills
|
|
171
|
+
*/
|
|
172
|
+
supportsSkills() {
|
|
173
|
+
return this.capabilities.skills && !!this.definition.skillPaths;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Get the skills directory for this agent
|
|
177
|
+
* Returns null if skills are not supported
|
|
178
|
+
*/
|
|
179
|
+
getSkillsDir(projectPath, global) {
|
|
180
|
+
if (!this.definition.skillPaths)
|
|
181
|
+
return null;
|
|
182
|
+
if (global) {
|
|
183
|
+
return this.definition.skillPaths.global.replace('~', homedir());
|
|
184
|
+
}
|
|
185
|
+
return resolve(projectPath, this.definition.skillPaths.project);
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Return the project-level shared rules standard used by this agent, if any.
|
|
189
|
+
*/
|
|
190
|
+
getProjectRulesStandard() {
|
|
191
|
+
return this.definition.projectStandards?.rules || null;
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Return the project-level shared skills standard used by this agent, if any.
|
|
195
|
+
*/
|
|
196
|
+
getProjectSkillsStandard() {
|
|
197
|
+
return this.definition.projectStandards?.skills || null;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Check whether this agent supports project-scoped MCP configuration.
|
|
201
|
+
*/
|
|
202
|
+
supportsProjectMcpConfig() {
|
|
203
|
+
const supportsAnyMcp = Object.values(this.capabilities.mcp).some(Boolean);
|
|
204
|
+
if (!supportsAnyMcp) {
|
|
205
|
+
return false;
|
|
206
|
+
}
|
|
207
|
+
return this.definition.mcpConfigScope !== 'global-only';
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Check if this agent supports global rules configuration
|
|
211
|
+
*/
|
|
212
|
+
supportsGlobalRules() {
|
|
213
|
+
return this.getGlobalRulesPath() !== null;
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* Remove an MCP server from global configuration
|
|
217
|
+
*/
|
|
218
|
+
async removeGlobalMCPServer(serverName) {
|
|
219
|
+
return this.withGlobalMcpPath(projectPath => this.removeMCPServer(projectPath, serverName));
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Get existing MCP servers from this agent's global configuration
|
|
223
|
+
*/
|
|
224
|
+
async getGlobalMCPServers() {
|
|
225
|
+
return this.withGlobalMcpPath(projectPath => this.getMCPServers(projectPath));
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Replace existing markdown rule sections and append the desired rules once.
|
|
229
|
+
*/
|
|
230
|
+
replaceMarkdownRulesSections(existingContent, sections, headingPattern) {
|
|
231
|
+
const existingSections = this.extractExistingSections(existingContent);
|
|
232
|
+
const existingSectionTitles = new Set(existingSections.map(section => section.templateName));
|
|
233
|
+
const keptLines = [];
|
|
234
|
+
let skippingSection = false;
|
|
235
|
+
for (const line of existingContent.split('\n')) {
|
|
236
|
+
const trimmed = line.trim();
|
|
237
|
+
const headingMatch = trimmed.match(headingPattern);
|
|
238
|
+
if (headingMatch?.[1]) {
|
|
239
|
+
skippingSection = existingSectionTitles.has(headingMatch[1].trim());
|
|
240
|
+
if (skippingSection) {
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
if (!skippingSection) {
|
|
245
|
+
keptLines.push(line);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
const baseContent = keptLines.join('\n').replace(/\n{3,}/g, '\n\n').trimEnd();
|
|
249
|
+
const renderedRules = this.generateRulesContent(sections).trim();
|
|
250
|
+
if (!renderedRules) {
|
|
251
|
+
return baseContent ? `${baseContent}\n` : '';
|
|
252
|
+
}
|
|
253
|
+
if (!baseContent) {
|
|
254
|
+
return `${renderedRules}\n`;
|
|
255
|
+
}
|
|
256
|
+
return `${baseContent}\n\n${renderedRules}\n`;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Run an operation against the agent's global MCP file using the native parser.
|
|
260
|
+
*/
|
|
261
|
+
async withGlobalMcpPath(operation) {
|
|
262
|
+
const globalPath = this.getGlobalMcpPath();
|
|
263
|
+
if (!globalPath) {
|
|
264
|
+
throw new Error(`Agent ${this.name} does not support global configuration`);
|
|
265
|
+
}
|
|
266
|
+
const lastSlashIndex = Math.max(globalPath.lastIndexOf('/'), globalPath.lastIndexOf('\\'));
|
|
267
|
+
const globalDir = lastSlashIndex > 0 ? globalPath.substring(0, lastSlashIndex) : '';
|
|
268
|
+
const originalNativeConfigPath = this.definition.nativeConfigPath;
|
|
269
|
+
const globalFileName = globalPath.substring(lastSlashIndex + 1);
|
|
270
|
+
this.definition.nativeConfigPath = globalFileName;
|
|
271
|
+
try {
|
|
272
|
+
return await operation(globalDir);
|
|
273
|
+
}
|
|
274
|
+
finally {
|
|
275
|
+
this.definition.nativeConfigPath = originalNativeConfigPath;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
167
278
|
/**
|
|
168
279
|
* Get a summary of this agent
|
|
169
280
|
*/
|
package/dist/agents/Agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Agent.js","sourceRoot":"","sources":["../../src/agents/Agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAS7D;;;GAGG;AACH,MAAM,OAAgB,KAAK;IACf,UAAU,CAAkB;IAEtC,YAAY,UAA2B;QACrC,IAAI,CAAC,UAAU,GAAG,UAA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