llm-ide-rules 0.5.0__tar.gz → 0.7.0__tar.gz
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.
- {llm_ide_rules-0.5.0 → llm_ide_rules-0.7.0}/PKG-INFO +36 -59
- {llm_ide_rules-0.5.0 → llm_ide_rules-0.7.0}/README.md +29 -56
- llm_ide_rules-0.7.0/pyproject.toml +39 -0
- llm_ide_rules-0.7.0/src/llm_ide_rules/__init__.py +81 -0
- {llm_ide_rules-0.5.0 → llm_ide_rules-0.7.0}/src/llm_ide_rules/__main__.py +1 -1
- llm_ide_rules-0.7.0/src/llm_ide_rules/agents/__init__.py +28 -0
- llm_ide_rules-0.7.0/src/llm_ide_rules/agents/base.py +329 -0
- llm_ide_rules-0.7.0/src/llm_ide_rules/agents/claude.py +108 -0
- llm_ide_rules-0.7.0/src/llm_ide_rules/agents/cursor.py +199 -0
- llm_ide_rules-0.7.0/src/llm_ide_rules/agents/gemini.py +177 -0
- llm_ide_rules-0.7.0/src/llm_ide_rules/agents/github.py +212 -0
- llm_ide_rules-0.7.0/src/llm_ide_rules/agents/opencode.py +130 -0
- {llm_ide_rules-0.5.0 → llm_ide_rules-0.7.0}/src/llm_ide_rules/commands/delete.py +24 -34
- {llm_ide_rules-0.5.0 → llm_ide_rules-0.7.0}/src/llm_ide_rules/commands/download.py +146 -60
- llm_ide_rules-0.7.0/src/llm_ide_rules/commands/explode.py +268 -0
- llm_ide_rules-0.7.0/src/llm_ide_rules/commands/implode.py +214 -0
- llm_ide_rules-0.7.0/src/llm_ide_rules/commands/mcp.py +119 -0
- llm_ide_rules-0.7.0/src/llm_ide_rules/constants.py +13 -0
- llm_ide_rules-0.7.0/src/llm_ide_rules/log.py +9 -0
- llm_ide_rules-0.7.0/src/llm_ide_rules/markdown_parser.py +108 -0
- llm_ide_rules-0.7.0/src/llm_ide_rules/mcp/__init__.py +7 -0
- llm_ide_rules-0.7.0/src/llm_ide_rules/mcp/models.py +21 -0
- llm_ide_rules-0.5.0/pyproject.toml +0 -21
- llm_ide_rules-0.5.0/src/llm_ide_rules/__init__.py +0 -37
- llm_ide_rules-0.5.0/src/llm_ide_rules/commands/explode.py +0 -428
- llm_ide_rules-0.5.0/src/llm_ide_rules/commands/implode.py +0 -400
- llm_ide_rules-0.5.0/src/llm_ide_rules/constants.py +0 -36
- llm_ide_rules-0.5.0/src/llm_ide_rules/sections.json +0 -27
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: llm-ide-rules
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: CLI tool for managing LLM IDE prompts and rules
|
|
5
5
|
Keywords: llm,ide,prompts,cursor,copilot
|
|
6
6
|
Author: Michael Bianco
|
|
7
7
|
Author-email: Michael Bianco <mike@mikebian.co>
|
|
8
8
|
Requires-Dist: typer>=0.9.0
|
|
9
|
-
Requires-Dist: structlog>=
|
|
9
|
+
Requires-Dist: structlog-config>=0.6.0
|
|
10
10
|
Requires-Dist: requests>=2.25.0
|
|
11
|
-
Requires-
|
|
11
|
+
Requires-Dist: pydantic>=2.0.0
|
|
12
|
+
Requires-Dist: json5>=0.9.0
|
|
13
|
+
Requires-Dist: tomli-w>=1.0.0
|
|
14
|
+
Requires-Dist: markdown-it-py>=4.0.0
|
|
15
|
+
Requires-Python: >=3.11
|
|
12
16
|
Project-URL: Repository, https://github.com/iloveitaly/llm-ide-rules
|
|
13
17
|
Description-Content-Type: text/markdown
|
|
14
18
|
|
|
15
19
|
# Copilot, Cursor, Claude, Gemini, etc LLM Instructions
|
|
16
20
|
|
|
17
|
-
|
|
21
|
+
This project makes it easy to download prompts and implode/explode them so they can be used by various providers.
|
|
18
22
|
|
|
19
23
|
I don't want to be tied to a specific IDE and it's a pain to have to edit instructions for various languages across a ton of different files.
|
|
20
24
|
|
|
@@ -22,25 +26,28 @@ Additionally, it becomes challenging to copy these prompts into various projects
|
|
|
22
26
|
|
|
23
27
|
Some of the glob assumptions in this repo are specific to how I've chosen to organize python and typescript [in the python starter template](https://github.com/iloveitaly/python-starter-template) and what tooling (fastapi, etc) that I've chosen to use.
|
|
24
28
|
|
|
25
|
-
##
|
|
26
|
-
|
|
27
|
-
You can run the `llm-ide-rules` CLI tool using uvx:
|
|
29
|
+
## IDE Format Comparison
|
|
28
30
|
|
|
29
|
-
|
|
30
|
-
uvx llm-ide-rules
|
|
31
|
-
```
|
|
31
|
+
Different AI coding assistants use different formats for instructions and commands:
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
| IDE | type | folder | Notes |
|
|
34
|
+
|-----|------|--------|-------|
|
|
35
|
+
| **Cursor** | instructions | `.cursor/rules/*.mdc` | Multiple plain markdown files |
|
|
36
|
+
| **Cursor** | commands | `.cursor/commands/*.md` | Plain markdown, no frontmatter |
|
|
37
|
+
| **Claude Code** | instructions | `CLAUDE.md` | Single markdown file at root |
|
|
38
|
+
| **Claude Code** | instructions | `AGENT.md` | Single markdown file at root (agent-specific) |
|
|
39
|
+
| **Claude Code** | commands | `.claude/commands/*.md` | Plain markdown, no frontmatter |
|
|
40
|
+
| **GitHub Copilot** | instructions | `.github/copilot-instructions.md` | Single markdown file |
|
|
41
|
+
| **GitHub Copilot** | instructions | `.github/instructions/*.instructions.md` | Multiple instruction files |
|
|
42
|
+
| **GitHub Copilot** | prompts | `.github/prompts/*.prompt.md` | YAML frontmatter with `mode: 'agent'` |
|
|
43
|
+
| **Gemini CLI** | instructions | `GEMINI.md` | Single markdown file at root |
|
|
44
|
+
| **Gemini CLI** | commands | `.gemini/commands/*.toml` | TOML format, supports `{{args}}` and shell commands |
|
|
45
|
+
| **OpenCode** | commands | `.opencode/commands/*.md` | Plain markdown, no frontmatter |
|
|
34
46
|
|
|
35
|
-
|
|
36
|
-
uv tool install git+https://github.com/iloveitaly/llm-ide-rules.git
|
|
37
|
-
```
|
|
47
|
+
## Installation
|
|
38
48
|
|
|
39
49
|
```sh
|
|
40
|
-
|
|
41
|
-
cd llm-ide-rules
|
|
42
|
-
uv sync
|
|
43
|
-
source .venv/bin/activate
|
|
50
|
+
uvx llm-ide-rules@latest --help
|
|
44
51
|
```
|
|
45
52
|
|
|
46
53
|
## Usage
|
|
@@ -55,7 +62,10 @@ uvx llm-ide-rules explode [input_file]
|
|
|
55
62
|
|
|
56
63
|
# Bundle rule files back into a single instruction file
|
|
57
64
|
uvx llm-ide-rules implode cursor [output_file] # Bundle Cursor rules
|
|
58
|
-
uvx llm-ide-rules implode github [output_file]
|
|
65
|
+
uvx llm-ide-rules implode github [output_file] # Bundle GitHub/Copilot instructions
|
|
66
|
+
uvx llm-ide-rules implode claude [output_file] # Bundle Claude Code commands
|
|
67
|
+
uvx llm-ide-rules implode gemini [output_file] # Bundle Gemini CLI commands
|
|
68
|
+
uvx llm-ide-rules implode opencode [output_file] # Bundle OpenCode commands
|
|
59
69
|
|
|
60
70
|
# Download instruction files from repositories
|
|
61
71
|
uvx llm-ide-rules download [instruction_types] # Download everything by default
|
|
@@ -66,21 +76,26 @@ uvx llm-ide-rules download --repo other/repo # Download from different repo
|
|
|
66
76
|
uvx llm-ide-rules delete [instruction_types] # Delete everything by default
|
|
67
77
|
uvx llm-ide-rules delete cursor gemini # Delete specific types
|
|
68
78
|
uvx llm-ide-rules delete --yes # Skip confirmation prompt
|
|
69
|
-
|
|
70
79
|
```
|
|
71
80
|
|
|
72
81
|
### Examples
|
|
73
82
|
|
|
74
83
|
```sh
|
|
75
|
-
# Explode instructions.md into
|
|
84
|
+
# Explode instructions.md into all supported formats (cursor, github, claude, gemini, opencode)
|
|
76
85
|
uvx llm-ide-rules explode instructions.md
|
|
77
86
|
|
|
87
|
+
# Explode for a specific agent only
|
|
88
|
+
uvx llm-ide-rules explode instructions.md --agent opencode
|
|
89
|
+
|
|
78
90
|
# Bundle Cursor rules back into a single file
|
|
79
91
|
uvx llm-ide-rules implode cursor bundled-instructions.md
|
|
80
92
|
|
|
81
93
|
# Bundle GitHub instructions with verbose logging
|
|
82
94
|
uvx llm-ide-rules implode github --verbose instructions.md
|
|
83
95
|
|
|
96
|
+
# Bundle OpenCode commands into commands.md
|
|
97
|
+
uvx llm-ide-rules implode opencode
|
|
98
|
+
|
|
84
99
|
# Download everything from default repository
|
|
85
100
|
uvx llm-ide-rules download
|
|
86
101
|
|
|
@@ -100,44 +115,6 @@ uvx llm-ide-rules delete cursor gemini --target ./my-project
|
|
|
100
115
|
uvx llm-ide-rules delete --yes
|
|
101
116
|
```
|
|
102
117
|
|
|
103
|
-
### IDE Command Format Comparison
|
|
104
|
-
|
|
105
|
-
Different AI coding assistants use different formats for commands:
|
|
106
|
-
|
|
107
|
-
| IDE | Directory | Format | Notes |
|
|
108
|
-
|-----|-----------|--------|-------|
|
|
109
|
-
| **Cursor** | `.cursor/commands/` | `.md` (plain markdown) | Simple, no frontmatter |
|
|
110
|
-
| **Claude Code** | `.claude/commands/` | `.md` (plain markdown) | Simple, no frontmatter |
|
|
111
|
-
| **GitHub Copilot** | `.github/prompts/` | `.prompt.md` (YAML + markdown) | Requires frontmatter with `mode: 'agent'` |
|
|
112
|
-
| **Gemini CLI** | `.gemini/commands/` | `.toml` | Uses TOML format, supports `{{args}}` and shell commands |
|
|
113
|
-
|
|
114
|
-
## Development
|
|
115
|
-
|
|
116
|
-
### Using the CLI for Development
|
|
117
|
-
|
|
118
|
-
The CLI replaces the old standalone scripts. Use the CLI commands in your development workflow:
|
|
119
|
-
|
|
120
|
-
```shell
|
|
121
|
-
# Setup the environment
|
|
122
|
-
uv sync
|
|
123
|
-
|
|
124
|
-
# Explode instructions into separate rule files
|
|
125
|
-
uvx llm-ide-rules explode
|
|
126
|
-
|
|
127
|
-
# Bundle rules back into instructions
|
|
128
|
-
uvx llm-ide-rules implode cursor instructions.md
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### Building and Testing
|
|
132
|
-
|
|
133
|
-
```shell
|
|
134
|
-
# Build the package
|
|
135
|
-
uv build
|
|
136
|
-
|
|
137
|
-
# Run tests
|
|
138
|
-
pytest
|
|
139
|
-
```
|
|
140
|
-
|
|
141
118
|
## Extracting Changes
|
|
142
119
|
|
|
143
120
|
The idea of this repo is you'll copy prompts into your various projects. Then, if you improve a prompt in a project, you can pull that change into this upstream repo.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Copilot, Cursor, Claude, Gemini, etc LLM Instructions
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This project makes it easy to download prompts and implode/explode them so they can be used by various providers.
|
|
4
4
|
|
|
5
5
|
I don't want to be tied to a specific IDE and it's a pain to have to edit instructions for various languages across a ton of different files.
|
|
6
6
|
|
|
@@ -8,25 +8,28 @@ Additionally, it becomes challenging to copy these prompts into various projects
|
|
|
8
8
|
|
|
9
9
|
Some of the glob assumptions in this repo are specific to how I've chosen to organize python and typescript [in the python starter template](https://github.com/iloveitaly/python-starter-template) and what tooling (fastapi, etc) that I've chosen to use.
|
|
10
10
|
|
|
11
|
-
##
|
|
12
|
-
|
|
13
|
-
You can run the `llm-ide-rules` CLI tool using uvx:
|
|
11
|
+
## IDE Format Comparison
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
uvx llm-ide-rules
|
|
17
|
-
```
|
|
13
|
+
Different AI coding assistants use different formats for instructions and commands:
|
|
18
14
|
|
|
19
|
-
|
|
15
|
+
| IDE | type | folder | Notes |
|
|
16
|
+
|-----|------|--------|-------|
|
|
17
|
+
| **Cursor** | instructions | `.cursor/rules/*.mdc` | Multiple plain markdown files |
|
|
18
|
+
| **Cursor** | commands | `.cursor/commands/*.md` | Plain markdown, no frontmatter |
|
|
19
|
+
| **Claude Code** | instructions | `CLAUDE.md` | Single markdown file at root |
|
|
20
|
+
| **Claude Code** | instructions | `AGENT.md` | Single markdown file at root (agent-specific) |
|
|
21
|
+
| **Claude Code** | commands | `.claude/commands/*.md` | Plain markdown, no frontmatter |
|
|
22
|
+
| **GitHub Copilot** | instructions | `.github/copilot-instructions.md` | Single markdown file |
|
|
23
|
+
| **GitHub Copilot** | instructions | `.github/instructions/*.instructions.md` | Multiple instruction files |
|
|
24
|
+
| **GitHub Copilot** | prompts | `.github/prompts/*.prompt.md` | YAML frontmatter with `mode: 'agent'` |
|
|
25
|
+
| **Gemini CLI** | instructions | `GEMINI.md` | Single markdown file at root |
|
|
26
|
+
| **Gemini CLI** | commands | `.gemini/commands/*.toml` | TOML format, supports `{{args}}` and shell commands |
|
|
27
|
+
| **OpenCode** | commands | `.opencode/commands/*.md` | Plain markdown, no frontmatter |
|
|
20
28
|
|
|
21
|
-
|
|
22
|
-
uv tool install git+https://github.com/iloveitaly/llm-ide-rules.git
|
|
23
|
-
```
|
|
29
|
+
## Installation
|
|
24
30
|
|
|
25
31
|
```sh
|
|
26
|
-
|
|
27
|
-
cd llm-ide-rules
|
|
28
|
-
uv sync
|
|
29
|
-
source .venv/bin/activate
|
|
32
|
+
uvx llm-ide-rules@latest --help
|
|
30
33
|
```
|
|
31
34
|
|
|
32
35
|
## Usage
|
|
@@ -41,7 +44,10 @@ uvx llm-ide-rules explode [input_file]
|
|
|
41
44
|
|
|
42
45
|
# Bundle rule files back into a single instruction file
|
|
43
46
|
uvx llm-ide-rules implode cursor [output_file] # Bundle Cursor rules
|
|
44
|
-
uvx llm-ide-rules implode github [output_file]
|
|
47
|
+
uvx llm-ide-rules implode github [output_file] # Bundle GitHub/Copilot instructions
|
|
48
|
+
uvx llm-ide-rules implode claude [output_file] # Bundle Claude Code commands
|
|
49
|
+
uvx llm-ide-rules implode gemini [output_file] # Bundle Gemini CLI commands
|
|
50
|
+
uvx llm-ide-rules implode opencode [output_file] # Bundle OpenCode commands
|
|
45
51
|
|
|
46
52
|
# Download instruction files from repositories
|
|
47
53
|
uvx llm-ide-rules download [instruction_types] # Download everything by default
|
|
@@ -52,21 +58,26 @@ uvx llm-ide-rules download --repo other/repo # Download from different repo
|
|
|
52
58
|
uvx llm-ide-rules delete [instruction_types] # Delete everything by default
|
|
53
59
|
uvx llm-ide-rules delete cursor gemini # Delete specific types
|
|
54
60
|
uvx llm-ide-rules delete --yes # Skip confirmation prompt
|
|
55
|
-
|
|
56
61
|
```
|
|
57
62
|
|
|
58
63
|
### Examples
|
|
59
64
|
|
|
60
65
|
```sh
|
|
61
|
-
# Explode instructions.md into
|
|
66
|
+
# Explode instructions.md into all supported formats (cursor, github, claude, gemini, opencode)
|
|
62
67
|
uvx llm-ide-rules explode instructions.md
|
|
63
68
|
|
|
69
|
+
# Explode for a specific agent only
|
|
70
|
+
uvx llm-ide-rules explode instructions.md --agent opencode
|
|
71
|
+
|
|
64
72
|
# Bundle Cursor rules back into a single file
|
|
65
73
|
uvx llm-ide-rules implode cursor bundled-instructions.md
|
|
66
74
|
|
|
67
75
|
# Bundle GitHub instructions with verbose logging
|
|
68
76
|
uvx llm-ide-rules implode github --verbose instructions.md
|
|
69
77
|
|
|
78
|
+
# Bundle OpenCode commands into commands.md
|
|
79
|
+
uvx llm-ide-rules implode opencode
|
|
80
|
+
|
|
70
81
|
# Download everything from default repository
|
|
71
82
|
uvx llm-ide-rules download
|
|
72
83
|
|
|
@@ -86,44 +97,6 @@ uvx llm-ide-rules delete cursor gemini --target ./my-project
|
|
|
86
97
|
uvx llm-ide-rules delete --yes
|
|
87
98
|
```
|
|
88
99
|
|
|
89
|
-
### IDE Command Format Comparison
|
|
90
|
-
|
|
91
|
-
Different AI coding assistants use different formats for commands:
|
|
92
|
-
|
|
93
|
-
| IDE | Directory | Format | Notes |
|
|
94
|
-
|-----|-----------|--------|-------|
|
|
95
|
-
| **Cursor** | `.cursor/commands/` | `.md` (plain markdown) | Simple, no frontmatter |
|
|
96
|
-
| **Claude Code** | `.claude/commands/` | `.md` (plain markdown) | Simple, no frontmatter |
|
|
97
|
-
| **GitHub Copilot** | `.github/prompts/` | `.prompt.md` (YAML + markdown) | Requires frontmatter with `mode: 'agent'` |
|
|
98
|
-
| **Gemini CLI** | `.gemini/commands/` | `.toml` | Uses TOML format, supports `{{args}}` and shell commands |
|
|
99
|
-
|
|
100
|
-
## Development
|
|
101
|
-
|
|
102
|
-
### Using the CLI for Development
|
|
103
|
-
|
|
104
|
-
The CLI replaces the old standalone scripts. Use the CLI commands in your development workflow:
|
|
105
|
-
|
|
106
|
-
```shell
|
|
107
|
-
# Setup the environment
|
|
108
|
-
uv sync
|
|
109
|
-
|
|
110
|
-
# Explode instructions into separate rule files
|
|
111
|
-
uvx llm-ide-rules explode
|
|
112
|
-
|
|
113
|
-
# Bundle rules back into instructions
|
|
114
|
-
uvx llm-ide-rules implode cursor instructions.md
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
### Building and Testing
|
|
118
|
-
|
|
119
|
-
```shell
|
|
120
|
-
# Build the package
|
|
121
|
-
uv build
|
|
122
|
-
|
|
123
|
-
# Run tests
|
|
124
|
-
pytest
|
|
125
|
-
```
|
|
126
|
-
|
|
127
100
|
## Extracting Changes
|
|
128
101
|
|
|
129
102
|
The idea of this repo is you'll copy prompts into your various projects. Then, if you improve a prompt in a project, you can pull that change into this upstream repo.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "llm-ide-rules"
|
|
3
|
+
version = "0.7.0"
|
|
4
|
+
description = "CLI tool for managing LLM IDE prompts and rules"
|
|
5
|
+
keywords = ["llm", "ide", "prompts", "cursor", "copilot"]
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
requires-python = ">=3.11"
|
|
8
|
+
dependencies = [
|
|
9
|
+
"typer>=0.9.0",
|
|
10
|
+
"structlog-config>=0.6.0",
|
|
11
|
+
"requests>=2.25.0",
|
|
12
|
+
"pydantic>=2.0.0",
|
|
13
|
+
"json5>=0.9.0",
|
|
14
|
+
"tomli-w>=1.0.0",
|
|
15
|
+
"markdown-it-py>=4.0.0",
|
|
16
|
+
]
|
|
17
|
+
authors = [{ name = "Michael Bianco", email = "mike@mikebian.co" }]
|
|
18
|
+
urls = { "Repository" = "https://github.com/iloveitaly/llm-ide-rules" }
|
|
19
|
+
|
|
20
|
+
# additional packaging information: https://packaging.python.org/en/latest/specifications/core-metadata/#license
|
|
21
|
+
[project.scripts]
|
|
22
|
+
llm-ide-rules = "llm_ide_rules:main"
|
|
23
|
+
|
|
24
|
+
[build-system]
|
|
25
|
+
requires = ["uv_build>=0.9.0,<0.10.0"]
|
|
26
|
+
build-backend = "uv_build"
|
|
27
|
+
|
|
28
|
+
# [tool.uv.build-backend]
|
|
29
|
+
# # avoids the src/ directory structure
|
|
30
|
+
# module-root = ""
|
|
31
|
+
|
|
32
|
+
[dependency-groups]
|
|
33
|
+
dev = ["pytest>=8.3.3", "pyright[nodejs]>=1.1.380", "ruff>=0.8.0", "pytest-mock>=3.10.0"]
|
|
34
|
+
|
|
35
|
+
[tool.pyright]
|
|
36
|
+
exclude = ["examples/", "playground/", "tmp/", ".venv/", "tests/"]
|
|
37
|
+
|
|
38
|
+
[tool.ruff]
|
|
39
|
+
extend-exclude = ["playground.py", "playground/"]
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"""LLM Rules CLI package for managing IDE prompts and rules."""
|
|
2
|
+
|
|
3
|
+
import os
|
|
4
|
+
|
|
5
|
+
if "LOG_LEVEL" not in os.environ:
|
|
6
|
+
os.environ["LOG_LEVEL"] = "WARNING"
|
|
7
|
+
|
|
8
|
+
import typer
|
|
9
|
+
from typing_extensions import Annotated
|
|
10
|
+
|
|
11
|
+
from llm_ide_rules.commands.explode import explode_main
|
|
12
|
+
from llm_ide_rules.commands.implode import cursor, github, claude, gemini, opencode
|
|
13
|
+
from llm_ide_rules.commands.download import download_main
|
|
14
|
+
from llm_ide_rules.commands.delete import delete_main
|
|
15
|
+
from llm_ide_rules.commands.mcp import mcp_app
|
|
16
|
+
|
|
17
|
+
__version__ = "0.7.0"
|
|
18
|
+
|
|
19
|
+
app = typer.Typer(
|
|
20
|
+
name="llm_ide_rules",
|
|
21
|
+
help="CLI tool for managing LLM IDE prompts and rules",
|
|
22
|
+
no_args_is_help=True,
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@app.callback()
|
|
27
|
+
def main_callback(
|
|
28
|
+
verbose: Annotated[
|
|
29
|
+
bool,
|
|
30
|
+
typer.Option(
|
|
31
|
+
"--verbose", "-v", help="Enable verbose logging (sets LOG_LEVEL=DEBUG)"
|
|
32
|
+
),
|
|
33
|
+
] = False,
|
|
34
|
+
):
|
|
35
|
+
"""Global CLI options."""
|
|
36
|
+
if verbose:
|
|
37
|
+
os.environ["LOG_LEVEL"] = "DEBUG"
|
|
38
|
+
import structlog_config
|
|
39
|
+
|
|
40
|
+
structlog_config.configure_logger()
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# Add commands directly
|
|
44
|
+
app.command("explode", help="Convert instruction file to separate rule files")(
|
|
45
|
+
explode_main
|
|
46
|
+
)
|
|
47
|
+
app.command("download", help="Download LLM instruction files from GitHub repositories")(
|
|
48
|
+
download_main
|
|
49
|
+
)
|
|
50
|
+
app.command("delete", help="Remove downloaded LLM instruction files")(delete_main)
|
|
51
|
+
|
|
52
|
+
# Create implode sub-typer
|
|
53
|
+
implode_app = typer.Typer(help="Bundle rule files into a single instruction file")
|
|
54
|
+
implode_app.command(
|
|
55
|
+
"cursor", help="Bundle Cursor rules and commands into a single file"
|
|
56
|
+
)(cursor)
|
|
57
|
+
implode_app.command(
|
|
58
|
+
"github", help="Bundle GitHub/Copilot instructions and prompts into a single file"
|
|
59
|
+
)(github)
|
|
60
|
+
implode_app.command("claude", help="Bundle Claude Code commands into a single file")(
|
|
61
|
+
claude
|
|
62
|
+
)
|
|
63
|
+
implode_app.command("gemini", help="Bundle Gemini CLI commands into a single file")(
|
|
64
|
+
gemini
|
|
65
|
+
)
|
|
66
|
+
implode_app.command("opencode", help="Bundle OpenCode commands into a single file")(
|
|
67
|
+
opencode
|
|
68
|
+
)
|
|
69
|
+
app.add_typer(implode_app, name="implode")
|
|
70
|
+
|
|
71
|
+
# Add MCP configuration management
|
|
72
|
+
app.add_typer(mcp_app, name="mcp")
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def main():
|
|
76
|
+
"""Main entry point for the CLI."""
|
|
77
|
+
app()
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
if __name__ == "__main__":
|
|
81
|
+
main()
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""Agent registry for LLM IDE rules."""
|
|
2
|
+
|
|
3
|
+
from llm_ide_rules.agents.base import BaseAgent
|
|
4
|
+
from llm_ide_rules.agents.cursor import CursorAgent
|
|
5
|
+
from llm_ide_rules.agents.github import GitHubAgent
|
|
6
|
+
from llm_ide_rules.agents.claude import ClaudeAgent
|
|
7
|
+
from llm_ide_rules.agents.gemini import GeminiAgent
|
|
8
|
+
from llm_ide_rules.agents.opencode import OpenCodeAgent
|
|
9
|
+
|
|
10
|
+
AGENTS: dict[str, type[BaseAgent]] = {
|
|
11
|
+
"cursor": CursorAgent,
|
|
12
|
+
"github": GitHubAgent,
|
|
13
|
+
"claude": ClaudeAgent,
|
|
14
|
+
"gemini": GeminiAgent,
|
|
15
|
+
"opencode": OpenCodeAgent,
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def get_agent(name: str) -> BaseAgent:
|
|
20
|
+
"""Get an agent instance by name."""
|
|
21
|
+
if name not in AGENTS:
|
|
22
|
+
raise ValueError(f"Unknown agent: {name}. Available: {list(AGENTS.keys())}")
|
|
23
|
+
return AGENTS[name]()
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def get_all_agents() -> list[BaseAgent]:
|
|
27
|
+
"""Get instances of all registered agents."""
|
|
28
|
+
return [agent_cls() for agent_cls in AGENTS.values()]
|