rulesync 0.33.0 → 0.36.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.ja.md +104 -8
- package/README.md +104 -8
- package/dist/chunk-6PQ4APY4.mjs +70 -0
- package/dist/chunk-QHXMJZTJ.mjs +62 -0
- package/dist/chunk-QVPQ2X4L.mjs +77 -0
- package/dist/chunk-SBYRCTWS.mjs +64 -0
- package/dist/chunk-UNTCJDMQ.mjs +73 -0
- package/dist/chunk-YGXGGUBG.mjs +80 -0
- package/dist/claude-O4SRX6VC.mjs +8 -0
- package/dist/cline-H5JF2OPT.mjs +8 -0
- package/dist/copilot-GCIYHK4Q.mjs +8 -0
- package/dist/cursor-N75OH6WS.mjs +8 -0
- package/dist/geminicli-AGOQ32ZE.mjs +8 -0
- package/dist/index.js +1291 -214
- package/dist/index.mjs +990 -207
- package/dist/roo-V5YVC222.mjs +8 -0
- package/package.json +14 -6
package/README.ja.md
CHANGED
|
@@ -16,6 +16,7 @@ rulesyncは以下のAI開発ツールの**生成**と**インポート**の両
|
|
|
16
16
|
- **Cline Rules** (`.clinerules/*.md` + `.cline/instructions.md`)
|
|
17
17
|
- **Claude Code Memory** (`./CLAUDE.md` + `.claude/memories/*.md`)
|
|
18
18
|
- **Roo Code Rules** (`.roo/rules/*.md` + `.roo/instructions.md`)
|
|
19
|
+
- **Gemini CLI** (`GEMINI.md` + `.gemini/memories/*.md`)
|
|
19
20
|
|
|
20
21
|
## インストール
|
|
21
22
|
|
|
@@ -59,15 +60,13 @@ yarn global add rulesync
|
|
|
59
60
|
|
|
60
61
|
1. **既存設定をインポート:**
|
|
61
62
|
```bash
|
|
62
|
-
#
|
|
63
|
-
npx rulesync import --claudecode --cursor --copilot
|
|
64
|
-
|
|
65
|
-
# または特定のツールからインポート
|
|
63
|
+
# 特定のツールからインポート(一度に1つのツールのみ指定可能)
|
|
66
64
|
npx rulesync import --claudecode # CLAUDE.mdと.claude/memories/*.mdから
|
|
67
65
|
npx rulesync import --cursor # .cursorrulesと.cursor/rules/*.mdcから
|
|
68
66
|
npx rulesync import --copilot # .github/copilot-instructions.mdから
|
|
69
67
|
npx rulesync import --cline # .cline/instructions.mdから
|
|
70
68
|
npx rulesync import --roo # .roo/instructions.mdから
|
|
69
|
+
npx rulesync import --geminicli # GEMINI.mdと.gemini/memories/*.mdから
|
|
71
70
|
```
|
|
72
71
|
|
|
73
72
|
2. **`.rulesync/`ディレクトリのインポートされたルールを確認・編集**
|
|
@@ -93,9 +92,10 @@ AI開発ツールは新しいツールが頻繁に登場し、急速に進化し
|
|
|
93
92
|
- Cursor:リファクタリング
|
|
94
93
|
- Claude Code:アーキテクチャ設計
|
|
95
94
|
- Cline:デバッグ支援
|
|
95
|
+
- Gemini CLI:知的コード解析
|
|
96
96
|
|
|
97
97
|
### 🔓 **ベンダーロックインなし**
|
|
98
|
-
ベンダーロックインを完全に回避できます。rulesyncの使用を停止することを決定した場合でも、生成されたルールファイル(`.github/instructions/`、`.cursor/rules/`、`.clinerules/`、`CLAUDE.md`など)をそのまま使い続けることができます。
|
|
98
|
+
ベンダーロックインを完全に回避できます。rulesyncの使用を停止することを決定した場合でも、生成されたルールファイル(`.github/instructions/`、`.cursor/rules/`、`.clinerules/`、`CLAUDE.md`、`GEMINI.md`など)をそのまま使い続けることができます。
|
|
99
99
|
|
|
100
100
|
### 🎯 **ツール間の一貫性**
|
|
101
101
|
すべてのAIツールに一貫したルールを適用し、チーム全体のコード品質と開発体験を向上させます。
|
|
@@ -171,6 +171,7 @@ rulesyncは2レベルのルールシステムを使用します:
|
|
|
171
171
|
| **GitHub Copilot** | 標準フォーマット | 標準フォーマット | すべてのルールがフロントマター付きの同じフォーマットを使用 |
|
|
172
172
|
| **Cline** | 標準フォーマット | 標準フォーマット | すべてのルールがプレーンMarkdownフォーマットを使用 |
|
|
173
173
|
| **Roo Code** | 標準フォーマット | 標準フォーマット | すべてのルールが説明ヘッダー付きのプレーンMarkdownフォーマットを使用 |
|
|
174
|
+
| **Gemini CLI** | `GEMINI.md` | `.gemini/memories/*.md` | GEMINI.mdがメモリファイルへの`@filename`参照を含む |
|
|
174
175
|
|
|
175
176
|
### 3. 設定ファイルの生成
|
|
176
177
|
|
|
@@ -184,6 +185,7 @@ npx rulesync generate --cursor
|
|
|
184
185
|
npx rulesync generate --cline
|
|
185
186
|
npx rulesync generate --claudecode
|
|
186
187
|
npx rulesync generate --roo
|
|
188
|
+
npx rulesync generate --geminicli
|
|
187
189
|
|
|
188
190
|
# クリーンビルド(既存ファイルを最初に削除)
|
|
189
191
|
npx rulesync generate --delete
|
|
@@ -205,7 +207,7 @@ npx rulesync generate --base-dir ./apps/web,./apps/api,./packages/shared
|
|
|
205
207
|
|
|
206
208
|
- `--delete`: 新しいファイルを作成する前に既存の生成済みファイルをすべて削除
|
|
207
209
|
- `--verbose`: 生成プロセス中に詳細出力を表示
|
|
208
|
-
- `--copilot`, `--cursor`, `--cline`, `--claudecode`, `--roo`: 指定されたツールのみ生成
|
|
210
|
+
- `--copilot`, `--cursor`, `--cline`, `--claudecode`, `--roo`, `--geminicli`: 指定されたツールのみ生成
|
|
209
211
|
- `--base-dir <paths>`: 指定されたベースディレクトリに設定ファイルを生成(複数パスの場合はカンマ区切り)。異なるプロジェクトディレクトリにツール固有の設定を生成したいmonorepoセットアップに便利。
|
|
210
212
|
|
|
211
213
|
### 4. 既存設定のインポート
|
|
@@ -219,9 +221,12 @@ npx rulesync import --cursor # .cursorrulesと.cursor/rules/*.mdからイン
|
|
|
219
221
|
npx rulesync import --copilot # .github/copilot-instructions.mdと.github/instructions/*.instructions.mdからインポート
|
|
220
222
|
npx rulesync import --cline # .cline/instructions.mdからインポート
|
|
221
223
|
npx rulesync import --roo # .roo/instructions.mdからインポート
|
|
224
|
+
npx rulesync import --geminicli # GEMINI.mdと.gemini/memories/*.mdからインポート
|
|
222
225
|
|
|
223
|
-
#
|
|
224
|
-
npx rulesync import --claudecode
|
|
226
|
+
# 各ツールを個別にインポート
|
|
227
|
+
npx rulesync import --claudecode
|
|
228
|
+
npx rulesync import --cursor
|
|
229
|
+
npx rulesync import --copilot
|
|
225
230
|
|
|
226
231
|
# インポート時の詳細出力
|
|
227
232
|
npx rulesync import --claudecode --verbose
|
|
@@ -272,6 +277,33 @@ npx rulesync gitignore
|
|
|
272
277
|
└── custom.md # プロジェクト固有ルール (root: false)
|
|
273
278
|
```
|
|
274
279
|
|
|
280
|
+
### .rulesyncignoreでファイルを除外
|
|
281
|
+
|
|
282
|
+
プロジェクトルートに`.rulesyncignore`ファイルを作成することで、特定のルールファイルを処理から除外できます。このファイルはgitignoreスタイルのパターンを使用します。
|
|
283
|
+
|
|
284
|
+
`.rulesyncignore`の例:
|
|
285
|
+
```
|
|
286
|
+
# テスト用ルールファイルを無視
|
|
287
|
+
**/*.test.md
|
|
288
|
+
|
|
289
|
+
# 一時ファイルを無視
|
|
290
|
+
tmp/**/*
|
|
291
|
+
|
|
292
|
+
# ドラフトルールを無視
|
|
293
|
+
draft-*.md
|
|
294
|
+
*-draft.md
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
`.rulesyncignore`が存在する場合、rulesyncは:
|
|
298
|
+
1. 処理時にマッチするファイルをスキップ
|
|
299
|
+
2. ツール固有のignoreファイルを生成:
|
|
300
|
+
- Cursor用の`.cursorignore`
|
|
301
|
+
- Cline用の`.clineignore`
|
|
302
|
+
- Roo Code用の`.rooignore`
|
|
303
|
+
- GitHub Copilot用の`.copilotignore`(コミュニティツール用)
|
|
304
|
+
- Gemini CLI用の`.aiexclude`
|
|
305
|
+
- Claude Code用に`.claude/settings.json`のpermissions.denyに`Read()`ルールを追加
|
|
306
|
+
|
|
275
307
|
### フロントマタースキーマ
|
|
276
308
|
|
|
277
309
|
各ルールファイルには以下のフィールドを含むフロントマターが必要です:
|
|
@@ -326,6 +358,7 @@ globs: "**/*.ts,**/*.tsx"
|
|
|
326
358
|
| **Cline** | `.clinerules/*.md` | プレーンMarkdown | 両レベルとも同じフォーマットを使用 |
|
|
327
359
|
| **Claude Code** | `./CLAUDE.md` (ルート)<br>`.claude/memories/*.md` (非ルート) | プレーンMarkdown | ルートはCLAUDE.mdに移動<br>非ルートは別メモリファイルに移動<br>CLAUDE.mdは`@filename`参照を含む |
|
|
328
360
|
| **Roo Code** | `.roo/rules/*.md` | プレーンMarkdown | 両レベルとも説明ヘッダー付きの同じフォーマットを使用 |
|
|
361
|
+
| **Gemini CLI** | `GEMINI.md` (ルート)<br>`.gemini/memories/*.md` (非ルート) | プレーンMarkdown | ルートはGEMINI.mdに移動<br>非ルートは別メモリファイルに移動<br>GEMINI.mdは`@filename`参照を含む |
|
|
329
362
|
|
|
330
363
|
## バリデーション
|
|
331
364
|
|
|
@@ -341,6 +374,69 @@ npx rulesync validate
|
|
|
341
374
|
- ファイルパターン(globs)が有効な構文を使用
|
|
342
375
|
- ターゲットツールが認識される値である
|
|
343
376
|
|
|
377
|
+
## MCP(Model Context Protocol)サポート
|
|
378
|
+
|
|
379
|
+
rulesyncは、対応するAIツール用のMCPサーバー設定も管理できます。これにより、言語サーバーやその他のMCP互換サービスを一度設定すれば、複数のAIコーディングアシスタントにデプロイできます。
|
|
380
|
+
|
|
381
|
+
### MCPをサポートするツール
|
|
382
|
+
|
|
383
|
+
- **Claude Code** (`.mcp.json`)
|
|
384
|
+
- **GitHub Copilot** (`.vscode/mcp.json`)
|
|
385
|
+
- **Cursor** (`.cursor/mcp.json`)
|
|
386
|
+
- **Cline** (`.cline/mcp.json`)
|
|
387
|
+
- **Gemini CLI** (`.gemini/settings.json`)
|
|
388
|
+
- **Roo Code** (`.roo/mcp.json`)
|
|
389
|
+
|
|
390
|
+
### MCP設定
|
|
391
|
+
|
|
392
|
+
プロジェクトに`.rulesync/.mcp.json`ファイルを作成:
|
|
393
|
+
|
|
394
|
+
```json
|
|
395
|
+
{
|
|
396
|
+
"mcpServers": {
|
|
397
|
+
"github": {
|
|
398
|
+
"command": "docker",
|
|
399
|
+
"args": [
|
|
400
|
+
"run", "-i", "--rm",
|
|
401
|
+
"-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
|
|
402
|
+
"ghcr.io/github/github-mcp-server"
|
|
403
|
+
],
|
|
404
|
+
"env": {},
|
|
405
|
+
"rulesyncTargets": ["*"]
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
### MCP設定フィールド
|
|
412
|
+
|
|
413
|
+
- **`mcpServers`**: MCPサーバー設定を含むオブジェクト
|
|
414
|
+
- **`command`**: stdioベースのサーバー用の実行可能コマンド
|
|
415
|
+
- **`args`**: コマンド引数
|
|
416
|
+
- **`url`**: HTTP/SSEベースのサーバー用URL
|
|
417
|
+
- **`env`**: サーバーに渡す環境変数
|
|
418
|
+
- **`rulesyncTargets`**: このサーバーをデプロイするツール名の配列
|
|
419
|
+
- 特定のツール名を使用: `["claude", "cursor", "copilot"]`
|
|
420
|
+
- すべてのサポートツールにデプロイするには`["*"]`を使用
|
|
421
|
+
- 省略した場合、デフォルトですべてのツールにデプロイ
|
|
422
|
+
|
|
423
|
+
### MCP設定の生成
|
|
424
|
+
|
|
425
|
+
MCP設定はルールファイルと一緒に生成されます:
|
|
426
|
+
|
|
427
|
+
```bash
|
|
428
|
+
# ルールとMCP設定の両方を生成
|
|
429
|
+
npx rulesync generate
|
|
430
|
+
|
|
431
|
+
# 特定のツールのみ生成
|
|
432
|
+
npx rulesync generate --claudecode --cursor
|
|
433
|
+
|
|
434
|
+
# 特定のディレクトリに生成(monorepo)
|
|
435
|
+
npx rulesync generate --base-dir ./packages/frontend
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
MCP設定は各ツールの適切な場所に生成され、ツールは起動時に自動的にそれらを読み込みます。
|
|
439
|
+
|
|
344
440
|
## ライセンス
|
|
345
441
|
|
|
346
442
|
MIT License
|
package/README.md
CHANGED
|
@@ -16,6 +16,7 @@ rulesync supports both **generation** and **import** for the following AI develo
|
|
|
16
16
|
- **Cline Rules** (`.clinerules/*.md` + `.cline/instructions.md`)
|
|
17
17
|
- **Claude Code Memory** (`./CLAUDE.md` + `.claude/memories/*.md`)
|
|
18
18
|
- **Roo Code Rules** (`.roo/rules/*.md` + `.roo/instructions.md`)
|
|
19
|
+
- **Gemini CLI** (`GEMINI.md` + `.gemini/memories/*.md`)
|
|
19
20
|
|
|
20
21
|
## Installation
|
|
21
22
|
|
|
@@ -59,15 +60,13 @@ If you already have AI tool configurations, you can import them into rulesync fo
|
|
|
59
60
|
|
|
60
61
|
1. **Import existing configurations:**
|
|
61
62
|
```bash
|
|
62
|
-
# Import from
|
|
63
|
-
npx rulesync import --claudecode --cursor --copilot
|
|
64
|
-
|
|
65
|
-
# Or import from specific tools
|
|
63
|
+
# Import from specific tools (only one tool can be specified at a time)
|
|
66
64
|
npx rulesync import --claudecode # From CLAUDE.md and .claude/memories/*.md
|
|
67
65
|
npx rulesync import --cursor # From .cursorrules and .cursor/rules/*.mdc
|
|
68
66
|
npx rulesync import --copilot # From .github/copilot-instructions.md
|
|
69
67
|
npx rulesync import --cline # From .cline/instructions.md
|
|
70
68
|
npx rulesync import --roo # From .roo/instructions.md
|
|
69
|
+
npx rulesync import --geminicli # From GEMINI.md and .gemini/memories/*.md
|
|
71
70
|
```
|
|
72
71
|
|
|
73
72
|
2. **Review and edit** the imported rules in `.rulesync/` directory
|
|
@@ -93,9 +92,10 @@ Enable hybrid development workflows combining multiple AI tools:
|
|
|
93
92
|
- Cursor for refactoring
|
|
94
93
|
- Claude Code for architecture design
|
|
95
94
|
- Cline for debugging assistance
|
|
95
|
+
- Gemini CLI for intelligent code analysis
|
|
96
96
|
|
|
97
97
|
### 🔓 **No Vendor Lock-in**
|
|
98
|
-
Avoid vendor lock-in completely. If you decide to stop using rulesync, you can continue using the generated rule files (`.github/instructions/`, `.cursor/rules/`, `.clinerules/`, `CLAUDE.md`, etc.) as-is.
|
|
98
|
+
Avoid vendor lock-in completely. If you decide to stop using rulesync, you can continue using the generated rule files (`.github/instructions/`, `.cursor/rules/`, `.clinerules/`, `CLAUDE.md`, `GEMINI.md`, etc.) as-is.
|
|
99
99
|
|
|
100
100
|
### 🎯 **Consistency Across Tools**
|
|
101
101
|
Apply consistent rules across all AI tools, improving code quality and development experience for the entire team.
|
|
@@ -171,6 +171,7 @@ Each AI tool handles rule levels differently:
|
|
|
171
171
|
| **GitHub Copilot** | Standard format | Standard format | All rules use same format with frontmatter |
|
|
172
172
|
| **Cline** | Standard format | Standard format | All rules use plain Markdown format |
|
|
173
173
|
| **Roo Code** | Standard format | Standard format | All rules use plain Markdown format with description header |
|
|
174
|
+
| **Gemini CLI** | `GEMINI.md` | `.gemini/memories/*.md` | GEMINI.md includes `@filename` references to memory files |
|
|
174
175
|
|
|
175
176
|
### 3. Generate Configuration Files
|
|
176
177
|
|
|
@@ -184,6 +185,7 @@ npx rulesync generate --cursor
|
|
|
184
185
|
npx rulesync generate --cline
|
|
185
186
|
npx rulesync generate --claudecode
|
|
186
187
|
npx rulesync generate --roo
|
|
188
|
+
npx rulesync generate --geminicli
|
|
187
189
|
|
|
188
190
|
# Clean build (delete existing files first)
|
|
189
191
|
npx rulesync generate --delete
|
|
@@ -205,7 +207,7 @@ npx rulesync generate --base-dir ./apps/web,./apps/api,./packages/shared
|
|
|
205
207
|
|
|
206
208
|
- `--delete`: Remove all existing generated files before creating new ones
|
|
207
209
|
- `--verbose`: Show detailed output during generation process
|
|
208
|
-
- `--copilot`, `--cursor`, `--cline`, `--claudecode`, `--roo`: Generate only for specified tools
|
|
210
|
+
- `--copilot`, `--cursor`, `--cline`, `--claudecode`, `--roo`, `--geminicli`: Generate only for specified tools
|
|
209
211
|
- `--base-dir <paths>`: Generate configuration files in specified base directories (comma-separated for multiple paths). Useful for monorepo setups where you want to generate tool-specific configurations in different project directories.
|
|
210
212
|
|
|
211
213
|
### 4. Import Existing Configurations
|
|
@@ -219,9 +221,12 @@ npx rulesync import --cursor # Import from .cursorrules and .cursor/rules/*.
|
|
|
219
221
|
npx rulesync import --copilot # Import from .github/copilot-instructions.md and .github/instructions/*.instructions.md
|
|
220
222
|
npx rulesync import --cline # Import from .cline/instructions.md
|
|
221
223
|
npx rulesync import --roo # Import from .roo/instructions.md
|
|
224
|
+
npx rulesync import --geminicli # Import from GEMINI.md and .gemini/memories/*.md
|
|
222
225
|
|
|
223
|
-
# Import
|
|
224
|
-
npx rulesync import --claudecode
|
|
226
|
+
# Import each tool individually
|
|
227
|
+
npx rulesync import --claudecode
|
|
228
|
+
npx rulesync import --cursor
|
|
229
|
+
npx rulesync import --copilot
|
|
225
230
|
|
|
226
231
|
# Verbose output during import
|
|
227
232
|
npx rulesync import --claudecode --verbose
|
|
@@ -272,6 +277,33 @@ npx rulesync gitignore
|
|
|
272
277
|
└── custom.md # Project-specific rules (root: false)
|
|
273
278
|
```
|
|
274
279
|
|
|
280
|
+
### Excluding Files with .rulesyncignore
|
|
281
|
+
|
|
282
|
+
You can exclude specific rule files from being processed by creating a `.rulesyncignore` file in your project root. This file uses gitignore-style patterns.
|
|
283
|
+
|
|
284
|
+
Example `.rulesyncignore`:
|
|
285
|
+
```
|
|
286
|
+
# Ignore test rule files
|
|
287
|
+
**/*.test.md
|
|
288
|
+
|
|
289
|
+
# Ignore temporary files
|
|
290
|
+
tmp/**/*
|
|
291
|
+
|
|
292
|
+
# Ignore draft rules
|
|
293
|
+
draft-*.md
|
|
294
|
+
*-draft.md
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
When `.rulesyncignore` exists, rulesync will:
|
|
298
|
+
1. Skip matching files during rule processing
|
|
299
|
+
2. Generate tool-specific ignore files:
|
|
300
|
+
- `.cursorignore` for Cursor
|
|
301
|
+
- `.clineignore` for Cline
|
|
302
|
+
- `.rooignore` for Roo Code
|
|
303
|
+
- `.copilotignore` for GitHub Copilot (community tools)
|
|
304
|
+
- `.aiexclude` for Gemini CLI
|
|
305
|
+
- Update `.claude/settings.json` permissions.deny with `Read()` rules for Claude Code
|
|
306
|
+
|
|
275
307
|
### Frontmatter Schema
|
|
276
308
|
|
|
277
309
|
Each rule file must include frontmatter with the following fields:
|
|
@@ -326,6 +358,7 @@ globs: "**/*.ts,**/*.tsx"
|
|
|
326
358
|
| **Cline** | `.clinerules/*.md` | Plain Markdown | Both levels use same format |
|
|
327
359
|
| **Claude Code** | `./CLAUDE.md` (root)<br>`.claude/memories/*.md` (non-root) | Plain Markdown | Root goes to CLAUDE.md<br>Non-root go to separate memory files<br>CLAUDE.md includes `@filename` references |
|
|
328
360
|
| **Roo Code** | `.roo/rules/*.md` | Plain Markdown | Both levels use same format with description header |
|
|
361
|
+
| **Gemini CLI** | `GEMINI.md` (root)<br>`.gemini/memories/*.md` (non-root) | Plain Markdown | Root goes to GEMINI.md<br>Non-root go to separate memory files<br>GEMINI.md includes `@filename` references |
|
|
329
362
|
|
|
330
363
|
## Validation
|
|
331
364
|
|
|
@@ -341,6 +374,69 @@ Common validation rules:
|
|
|
341
374
|
- File patterns (globs) use valid syntax
|
|
342
375
|
- Target tools are recognized values
|
|
343
376
|
|
|
377
|
+
## MCP (Model Context Protocol) Support
|
|
378
|
+
|
|
379
|
+
rulesync can also manage MCP server configurations for supported AI tools. This allows you to configure language servers and other MCP-compatible services once and deploy them across multiple AI coding assistants.
|
|
380
|
+
|
|
381
|
+
### Supported MCP Tools
|
|
382
|
+
|
|
383
|
+
- **Claude Code** (`.mcp.json`)
|
|
384
|
+
- **GitHub Copilot** (`.vscode/mcp.json`)
|
|
385
|
+
- **Cursor** (`.cursor/mcp.json`)
|
|
386
|
+
- **Cline** (`.cline/mcp.json`)
|
|
387
|
+
- **Gemini CLI** (`.gemini/settings.json`)
|
|
388
|
+
- **Roo Code** (`.roo/mcp.json`)
|
|
389
|
+
|
|
390
|
+
### MCP Configuration
|
|
391
|
+
|
|
392
|
+
Create a `.rulesync/.mcp.json` file in your project:
|
|
393
|
+
|
|
394
|
+
```json
|
|
395
|
+
{
|
|
396
|
+
"mcpServers": {
|
|
397
|
+
"github": {
|
|
398
|
+
"command": "docker",
|
|
399
|
+
"args": [
|
|
400
|
+
"run", "-i", "--rm",
|
|
401
|
+
"-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
|
|
402
|
+
"ghcr.io/github/github-mcp-server"
|
|
403
|
+
],
|
|
404
|
+
"env": {},
|
|
405
|
+
"rulesyncTargets": ["*"]
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
### MCP Configuration Fields
|
|
412
|
+
|
|
413
|
+
- **`mcpServers`**: Object containing MCP server configurations
|
|
414
|
+
- **`command`**: Executable command for stdio-based servers
|
|
415
|
+
- **`args`**: Command arguments
|
|
416
|
+
- **`url`**: URL for HTTP/SSE-based servers
|
|
417
|
+
- **`env`**: Environment variables to pass to the server
|
|
418
|
+
- **`rulesyncTargets`**: Array of tool names to deploy this server to
|
|
419
|
+
- Use specific tool names: `["claude", "cursor", "copilot"]`
|
|
420
|
+
- Use `["*"]` to deploy to all supported tools
|
|
421
|
+
- If omitted, server is deployed to all tools by default
|
|
422
|
+
|
|
423
|
+
### Generating MCP Configurations
|
|
424
|
+
|
|
425
|
+
MCP configurations are generated alongside rule files:
|
|
426
|
+
|
|
427
|
+
```bash
|
|
428
|
+
# Generate both rules and MCP configurations
|
|
429
|
+
npx rulesync generate
|
|
430
|
+
|
|
431
|
+
# Generate only for specific tools
|
|
432
|
+
npx rulesync generate --claudecode --cursor
|
|
433
|
+
|
|
434
|
+
# Generate in specific directories (monorepo)
|
|
435
|
+
npx rulesync generate --base-dir ./packages/frontend
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
The MCP configurations will be generated in the appropriate locations for each tool, and the tools will automatically load them when started.
|
|
439
|
+
|
|
344
440
|
## License
|
|
345
441
|
|
|
346
442
|
MIT License
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// src/generators/mcp/geminicli.ts
|
|
2
|
+
function generateGeminiCliMcp(config, _target) {
|
|
3
|
+
const geminiSettings = {
|
|
4
|
+
mcpServers: {}
|
|
5
|
+
};
|
|
6
|
+
const shouldInclude = (server) => {
|
|
7
|
+
const targets = server.rulesyncTargets;
|
|
8
|
+
if (!targets || targets.length === 0) return true;
|
|
9
|
+
if (targets.length === 1 && targets[0] === "*") return true;
|
|
10
|
+
return targets.includes("geminicli");
|
|
11
|
+
};
|
|
12
|
+
for (const [serverName, server] of Object.entries(config.mcpServers)) {
|
|
13
|
+
if (!shouldInclude(server)) continue;
|
|
14
|
+
const geminiServer = {};
|
|
15
|
+
if (server.command) {
|
|
16
|
+
geminiServer.command = server.command;
|
|
17
|
+
if (server.args) geminiServer.args = server.args;
|
|
18
|
+
} else if (server.url || server.httpUrl) {
|
|
19
|
+
if (server.httpUrl) {
|
|
20
|
+
geminiServer.httpUrl = server.httpUrl;
|
|
21
|
+
} else if (server.url) {
|
|
22
|
+
geminiServer.url = server.url;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
if (server.env) {
|
|
26
|
+
geminiServer.env = {};
|
|
27
|
+
for (const [key, value] of Object.entries(server.env)) {
|
|
28
|
+
if (value.startsWith("${") && value.endsWith("}")) {
|
|
29
|
+
geminiServer.env[key] = value;
|
|
30
|
+
} else {
|
|
31
|
+
geminiServer.env[key] = `\${${value}}`;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
if (server.timeout !== void 0) {
|
|
36
|
+
geminiServer.timeout = server.timeout;
|
|
37
|
+
}
|
|
38
|
+
if (server.trust !== void 0) {
|
|
39
|
+
geminiServer.trust = server.trust;
|
|
40
|
+
}
|
|
41
|
+
geminiSettings.mcpServers[serverName] = geminiServer;
|
|
42
|
+
}
|
|
43
|
+
return JSON.stringify(geminiSettings, null, 2);
|
|
44
|
+
}
|
|
45
|
+
function generateGeminiCliMcpConfiguration(mcpServers, baseDir = "") {
|
|
46
|
+
const filepath = baseDir ? `${baseDir}/.gemini/settings.json` : ".gemini/settings.json";
|
|
47
|
+
const config = {
|
|
48
|
+
mcpServers: {}
|
|
49
|
+
};
|
|
50
|
+
for (const [serverName, server] of Object.entries(mcpServers)) {
|
|
51
|
+
const targets = server.rulesyncTargets;
|
|
52
|
+
if (targets && !targets.includes("*") && !targets.includes("geminicli")) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const { rulesyncTargets: _, ...serverConfig } = server;
|
|
56
|
+
config.mcpServers[serverName] = serverConfig;
|
|
57
|
+
}
|
|
58
|
+
return [
|
|
59
|
+
{
|
|
60
|
+
filepath,
|
|
61
|
+
content: `${JSON.stringify(config, null, 2)}
|
|
62
|
+
`
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
generateGeminiCliMcp,
|
|
69
|
+
generateGeminiCliMcpConfiguration
|
|
70
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// src/generators/mcp/cline.ts
|
|
2
|
+
function generateClineMcp(config, _target) {
|
|
3
|
+
const clineConfig = {
|
|
4
|
+
mcpServers: {}
|
|
5
|
+
};
|
|
6
|
+
const shouldInclude = (server) => {
|
|
7
|
+
const targets = server.rulesyncTargets;
|
|
8
|
+
if (!targets || targets.length === 0) return true;
|
|
9
|
+
if (targets.length === 1 && targets[0] === "*") return true;
|
|
10
|
+
return targets.includes("cline");
|
|
11
|
+
};
|
|
12
|
+
for (const [serverName, server] of Object.entries(config.mcpServers)) {
|
|
13
|
+
if (!shouldInclude(server)) continue;
|
|
14
|
+
const clineServer = {};
|
|
15
|
+
if (server.command) {
|
|
16
|
+
clineServer.command = server.command;
|
|
17
|
+
if (server.args) clineServer.args = server.args;
|
|
18
|
+
} else if (server.url) {
|
|
19
|
+
clineServer.url = server.url;
|
|
20
|
+
}
|
|
21
|
+
if (server.env) {
|
|
22
|
+
clineServer.env = server.env;
|
|
23
|
+
}
|
|
24
|
+
if (server.disabled !== void 0) {
|
|
25
|
+
clineServer.disabled = server.disabled;
|
|
26
|
+
}
|
|
27
|
+
if (server.alwaysAllow) {
|
|
28
|
+
clineServer.alwaysAllow = server.alwaysAllow;
|
|
29
|
+
}
|
|
30
|
+
if (server.networkTimeout !== void 0) {
|
|
31
|
+
clineServer.networkTimeout = server.networkTimeout;
|
|
32
|
+
}
|
|
33
|
+
clineConfig.mcpServers[serverName] = clineServer;
|
|
34
|
+
}
|
|
35
|
+
return JSON.stringify(clineConfig, null, 2);
|
|
36
|
+
}
|
|
37
|
+
function generateClineMcpConfiguration(mcpServers, baseDir = "") {
|
|
38
|
+
const filepath = baseDir ? `${baseDir}/.cline/mcp.json` : ".cline/mcp.json";
|
|
39
|
+
const config = {
|
|
40
|
+
mcpServers: {}
|
|
41
|
+
};
|
|
42
|
+
for (const [serverName, server] of Object.entries(mcpServers)) {
|
|
43
|
+
const targets = server.rulesyncTargets;
|
|
44
|
+
if (targets && !targets.includes("*") && !targets.includes("cline")) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
const { rulesyncTargets: _, ...serverConfig } = server;
|
|
48
|
+
config.mcpServers[serverName] = serverConfig;
|
|
49
|
+
}
|
|
50
|
+
return [
|
|
51
|
+
{
|
|
52
|
+
filepath,
|
|
53
|
+
content: `${JSON.stringify(config, null, 2)}
|
|
54
|
+
`
|
|
55
|
+
}
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export {
|
|
60
|
+
generateClineMcp,
|
|
61
|
+
generateClineMcpConfiguration
|
|
62
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// src/generators/mcp/roo.ts
|
|
2
|
+
function generateRooMcp(config, _target) {
|
|
3
|
+
const rooConfig = {
|
|
4
|
+
mcpServers: {}
|
|
5
|
+
};
|
|
6
|
+
const shouldInclude = (server) => {
|
|
7
|
+
const targets = server.rulesyncTargets;
|
|
8
|
+
if (!targets || targets.length === 0) return true;
|
|
9
|
+
if (targets.length === 1 && targets[0] === "*") return true;
|
|
10
|
+
return targets.includes("roo");
|
|
11
|
+
};
|
|
12
|
+
for (const [serverName, server] of Object.entries(config.mcpServers)) {
|
|
13
|
+
if (!shouldInclude(server)) continue;
|
|
14
|
+
const rooServer = {};
|
|
15
|
+
if (server.command) {
|
|
16
|
+
rooServer.command = server.command;
|
|
17
|
+
if (server.args) rooServer.args = server.args;
|
|
18
|
+
} else if (server.url || server.httpUrl) {
|
|
19
|
+
const url = server.httpUrl || server.url;
|
|
20
|
+
if (url) {
|
|
21
|
+
rooServer.url = url;
|
|
22
|
+
}
|
|
23
|
+
if (server.httpUrl || server.transport === "http") {
|
|
24
|
+
rooServer.type = "streamable-http";
|
|
25
|
+
} else if (server.transport === "sse" || server.type === "sse") {
|
|
26
|
+
rooServer.type = "sse";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (server.env) {
|
|
30
|
+
rooServer.env = {};
|
|
31
|
+
for (const [key, value] of Object.entries(server.env)) {
|
|
32
|
+
if (value.startsWith("${env:") && value.endsWith("}")) {
|
|
33
|
+
rooServer.env[key] = value;
|
|
34
|
+
} else {
|
|
35
|
+
rooServer.env[key] = `\${env:${value}}`;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (server.disabled !== void 0) {
|
|
40
|
+
rooServer.disabled = server.disabled;
|
|
41
|
+
}
|
|
42
|
+
if (server.alwaysAllow) {
|
|
43
|
+
rooServer.alwaysAllow = server.alwaysAllow;
|
|
44
|
+
}
|
|
45
|
+
if (server.networkTimeout !== void 0) {
|
|
46
|
+
rooServer.networkTimeout = Math.max(3e4, Math.min(3e5, server.networkTimeout));
|
|
47
|
+
}
|
|
48
|
+
rooConfig.mcpServers[serverName] = rooServer;
|
|
49
|
+
}
|
|
50
|
+
return JSON.stringify(rooConfig, null, 2);
|
|
51
|
+
}
|
|
52
|
+
function generateRooMcpConfiguration(mcpServers, baseDir = "") {
|
|
53
|
+
const filepath = baseDir ? `${baseDir}/.roo/mcp.json` : ".roo/mcp.json";
|
|
54
|
+
const config = {
|
|
55
|
+
mcpServers: {}
|
|
56
|
+
};
|
|
57
|
+
for (const [serverName, server] of Object.entries(mcpServers)) {
|
|
58
|
+
const targets = server.rulesyncTargets;
|
|
59
|
+
if (targets && !targets.includes("*") && !targets.includes("roo")) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
const { rulesyncTargets, ...serverConfig } = server;
|
|
63
|
+
config.mcpServers[serverName] = serverConfig;
|
|
64
|
+
}
|
|
65
|
+
return [
|
|
66
|
+
{
|
|
67
|
+
filepath,
|
|
68
|
+
content: `${JSON.stringify(config, null, 2)}
|
|
69
|
+
`
|
|
70
|
+
}
|
|
71
|
+
];
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export {
|
|
75
|
+
generateRooMcp,
|
|
76
|
+
generateRooMcpConfiguration
|
|
77
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// src/generators/mcp/cursor.ts
|
|
2
|
+
function generateCursorMcp(config, _target) {
|
|
3
|
+
const cursorConfig = {
|
|
4
|
+
mcpServers: {}
|
|
5
|
+
};
|
|
6
|
+
const shouldInclude = (server) => {
|
|
7
|
+
const targets = server.rulesyncTargets;
|
|
8
|
+
if (!targets || targets.length === 0) return true;
|
|
9
|
+
if (targets.length === 1 && targets[0] === "*") return true;
|
|
10
|
+
return targets.includes("cursor");
|
|
11
|
+
};
|
|
12
|
+
for (const [serverName, server] of Object.entries(config.mcpServers)) {
|
|
13
|
+
if (!shouldInclude(server)) continue;
|
|
14
|
+
const cursorServer = {};
|
|
15
|
+
if (server.command) {
|
|
16
|
+
cursorServer.command = server.command;
|
|
17
|
+
if (server.args) cursorServer.args = server.args;
|
|
18
|
+
} else if (server.url || server.httpUrl) {
|
|
19
|
+
const url = server.httpUrl || server.url;
|
|
20
|
+
if (url) {
|
|
21
|
+
cursorServer.url = url;
|
|
22
|
+
}
|
|
23
|
+
if (server.httpUrl || server.transport === "http") {
|
|
24
|
+
cursorServer.type = "streamable-http";
|
|
25
|
+
} else if (server.transport === "sse" || server.type === "sse") {
|
|
26
|
+
cursorServer.type = "sse";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (server.env) {
|
|
30
|
+
cursorServer.env = server.env;
|
|
31
|
+
}
|
|
32
|
+
if (server.cwd) {
|
|
33
|
+
cursorServer.cwd = server.cwd;
|
|
34
|
+
}
|
|
35
|
+
cursorConfig.mcpServers[serverName] = cursorServer;
|
|
36
|
+
}
|
|
37
|
+
return JSON.stringify(cursorConfig, null, 2);
|
|
38
|
+
}
|
|
39
|
+
function generateCursorMcpConfiguration(mcpServers, baseDir = "") {
|
|
40
|
+
const filepath = baseDir ? `${baseDir}/.cursor/mcp.json` : ".cursor/mcp.json";
|
|
41
|
+
const config = {
|
|
42
|
+
mcpServers: {}
|
|
43
|
+
};
|
|
44
|
+
for (const [serverName, server] of Object.entries(mcpServers)) {
|
|
45
|
+
const targets = server.rulesyncTargets;
|
|
46
|
+
if (targets && !targets.includes("*") && !targets.includes("cursor")) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const { rulesyncTargets, ...serverConfig } = server;
|
|
50
|
+
config.mcpServers[serverName] = serverConfig;
|
|
51
|
+
}
|
|
52
|
+
return [
|
|
53
|
+
{
|
|
54
|
+
filepath,
|
|
55
|
+
content: `${JSON.stringify(config, null, 2)}
|
|
56
|
+
`
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
generateCursorMcp,
|
|
63
|
+
generateCursorMcpConfiguration
|
|
64
|
+
};
|