dotmd 0.1.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.
- dotmd-0.1.0/LICENSE +21 -0
- dotmd-0.1.0/PKG-INFO +336 -0
- dotmd-0.1.0/README.md +282 -0
- dotmd-0.1.0/dotmd/__init__.py +4 -0
- dotmd-0.1.0/dotmd/api.py +467 -0
- dotmd-0.1.0/dotmd/art.py +147 -0
- dotmd-0.1.0/dotmd/cli.py +545 -0
- dotmd-0.1.0/dotmd/formats.py +39 -0
- dotmd-0.1.0/dotmd/mascot.png +0 -0
- dotmd-0.1.0/dotmd.egg-info/PKG-INFO +336 -0
- dotmd-0.1.0/dotmd.egg-info/SOURCES.txt +17 -0
- dotmd-0.1.0/dotmd.egg-info/dependency_links.txt +1 -0
- dotmd-0.1.0/dotmd.egg-info/entry_points.txt +2 -0
- dotmd-0.1.0/dotmd.egg-info/requires.txt +7 -0
- dotmd-0.1.0/dotmd.egg-info/top_level.txt +1 -0
- dotmd-0.1.0/pyproject.toml +59 -0
- dotmd-0.1.0/setup.cfg +4 -0
- dotmd-0.1.0/tests/test_api.py +217 -0
- dotmd-0.1.0/tests/test_cli.py +393 -0
dotmd-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 dotmd contributors
|
|
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.
|
dotmd-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dotmd
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: CLI for the mydotmd.io AI rule registry — fetch and share .md instruction files.
|
|
5
|
+
Author: dotmd contributors
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2024 dotmd contributors
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
Project-URL: Homepage, https://mydotmd.io
|
|
28
|
+
Project-URL: Repository, https://github.com/dotmd/dotmd-cli
|
|
29
|
+
Project-URL: Bug Tracker, https://github.com/dotmd/dotmd-cli/issues
|
|
30
|
+
Project-URL: Changelog, https://github.com/dotmd/dotmd-cli/releases
|
|
31
|
+
Keywords: dotmd,ai,llm,cursor,claude,copilot,windsurf,rules,instructions,registry,cli
|
|
32
|
+
Classifier: Development Status :: 4 - Beta
|
|
33
|
+
Classifier: Environment :: Console
|
|
34
|
+
Classifier: Intended Audience :: Developers
|
|
35
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
36
|
+
Classifier: Operating System :: OS Independent
|
|
37
|
+
Classifier: Programming Language :: Python :: 3
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
42
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
43
|
+
Classifier: Topic :: Utilities
|
|
44
|
+
Requires-Python: >=3.9
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
License-File: LICENSE
|
|
47
|
+
Requires-Dist: typer[all]>=0.12.0
|
|
48
|
+
Requires-Dist: requests>=2.31.0
|
|
49
|
+
Requires-Dist: pyfiglet>=1.0.2
|
|
50
|
+
Requires-Dist: pillow>=10.0.0
|
|
51
|
+
Provides-Extra: dev
|
|
52
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
53
|
+
Dynamic: license-file
|
|
54
|
+
|
|
55
|
+
<div align="center">
|
|
56
|
+
|
|
57
|
+
# dotmd
|
|
58
|
+
|
|
59
|
+
**The open `.md` registry CLI**
|
|
60
|
+
|
|
61
|
+
Fetch and share the AI instruction files that power your coding assistants.
|
|
62
|
+
|
|
63
|
+
[](https://pypi.org/project/dotmd/)
|
|
64
|
+
[](https://pypi.org/project/dotmd/)
|
|
65
|
+
[](https://github.com/dotmd/dotmd-cli/actions/workflows/ci.yml)
|
|
66
|
+
[](LICENSE)
|
|
67
|
+
|
|
68
|
+
</div>
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
`dotmd` is a command-line tool for the [mydotmd.io](https://mydotmd.io) registry — like Docker Hub, but for `.md` instruction files. Browse, search, and pull the rules that configure AI coding assistants like Cursor, Claude, Windsurf, Copilot, and more.
|
|
73
|
+
|
|
74
|
+
```
|
|
75
|
+
╭──────────────────────────────────────────────────────────────────────╮
|
|
76
|
+
│ ____ _ _ │
|
|
77
|
+
│ | _ \ ___ | |_ _ __ ___ __| | │
|
|
78
|
+
│ | | | |/ _ \| __|| '_ ` _ \ / _` | │
|
|
79
|
+
│ | |_| | (_) | |_ | | | | | | (_| | │
|
|
80
|
+
│ |____/ \___/ \__||_| |_| |_|\__,_| │
|
|
81
|
+
│ │
|
|
82
|
+
│ Share your .md instruction files. │
|
|
83
|
+
╰──────────────────────────────────────────────────────────────────────╯
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## Table of Contents
|
|
89
|
+
|
|
90
|
+
- [Install](#install)
|
|
91
|
+
- [Quick Start](#quick-start)
|
|
92
|
+
- [Commands](#commands)
|
|
93
|
+
- [get](#dotmd-get)
|
|
94
|
+
- [search](#dotmd-search)
|
|
95
|
+
- [list](#dotmd-list)
|
|
96
|
+
- [info](#dotmd-info)
|
|
97
|
+
- [Output File Mapping](#output-file-mapping)
|
|
98
|
+
- [Configuration](#configuration)
|
|
99
|
+
- [LLM & Automation Usage](#llm--automation-usage)
|
|
100
|
+
- [Contributing](#contributing)
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Install
|
|
105
|
+
|
|
106
|
+
**Requires Python 3.8+**
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
pip install dotmd
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Verify the install:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
dotmd --version
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Quick Start
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# Browse what's available
|
|
124
|
+
dotmd list
|
|
125
|
+
|
|
126
|
+
# Search by keyword
|
|
127
|
+
dotmd search react typescript
|
|
128
|
+
|
|
129
|
+
# Fetch a rule into your project
|
|
130
|
+
dotmd get dotmd/react-best-practices
|
|
131
|
+
|
|
132
|
+
# See where it was written
|
|
133
|
+
dotmd info
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Commands
|
|
139
|
+
|
|
140
|
+
### `dotmd get`
|
|
141
|
+
|
|
142
|
+
Fetch a rule from the registry and write it to the correct local instruction file for your AI tool.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# Full slug: <username>/<title>
|
|
146
|
+
dotmd get dotmd/react-best-practices
|
|
147
|
+
|
|
148
|
+
# Bare title — auto-resolved when only one match exists
|
|
149
|
+
dotmd get react-best-practices
|
|
150
|
+
|
|
151
|
+
# Explicit username with bare title
|
|
152
|
+
dotmd get react-best-practices --username dotmd
|
|
153
|
+
|
|
154
|
+
# Preview destination without writing (dry run)
|
|
155
|
+
dotmd get dotmd/react-best-practices --dry-run
|
|
156
|
+
|
|
157
|
+
# Write to a custom path
|
|
158
|
+
dotmd get dotmd/react-best-practices --output .cursorrules
|
|
159
|
+
|
|
160
|
+
# Overwrite an existing file
|
|
161
|
+
dotmd get dotmd/react-best-practices --force
|
|
162
|
+
|
|
163
|
+
# Suppress all output (useful in scripts)
|
|
164
|
+
dotmd get dotmd/react-best-practices --quiet
|
|
165
|
+
|
|
166
|
+
# Machine-readable JSON output
|
|
167
|
+
dotmd get dotmd/react-best-practices --json
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Options:**
|
|
171
|
+
|
|
172
|
+
| Flag | Short | Description |
|
|
173
|
+
|------|-------|-------------|
|
|
174
|
+
| `--username USER` | `-u` | Registry username (use with bare title) |
|
|
175
|
+
| `--output PATH` | `-o` | Write to a specific path instead of the default |
|
|
176
|
+
| `--force` | `-f` | Overwrite destination if it already exists |
|
|
177
|
+
| `--dry-run` | | Preview destination without writing |
|
|
178
|
+
| `--quiet` | `-q` | Suppress non-error output |
|
|
179
|
+
| `--json` | | Emit JSON to stdout |
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
### `dotmd search`
|
|
184
|
+
|
|
185
|
+
Search the registry for rules by keyword. Matches against rule titles.
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# Single keyword
|
|
189
|
+
dotmd search python
|
|
190
|
+
|
|
191
|
+
# Multiple keywords (AND match)
|
|
192
|
+
dotmd search react typescript performance
|
|
193
|
+
|
|
194
|
+
# Limit results
|
|
195
|
+
dotmd search react --limit 5
|
|
196
|
+
|
|
197
|
+
# JSON output for scripting
|
|
198
|
+
dotmd search react --json
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**Options:**
|
|
202
|
+
|
|
203
|
+
| Flag | Short | Description |
|
|
204
|
+
|------|-------|-------------|
|
|
205
|
+
| `--limit N` | `-n` | Max results (default: 20, max: 100) |
|
|
206
|
+
| `--json` | | Emit JSON to stdout |
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
### `dotmd list`
|
|
211
|
+
|
|
212
|
+
List rules for a specific user, or all public rules in the registry.
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
# All public rules
|
|
216
|
+
dotmd list
|
|
217
|
+
|
|
218
|
+
# Rules for a specific user
|
|
219
|
+
dotmd list dotmd
|
|
220
|
+
|
|
221
|
+
# Limit results
|
|
222
|
+
dotmd list --limit 50
|
|
223
|
+
|
|
224
|
+
# JSON output
|
|
225
|
+
dotmd list dotmd --json
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
**Options:**
|
|
229
|
+
|
|
230
|
+
| Flag | Short | Description |
|
|
231
|
+
|------|-------|-------------|
|
|
232
|
+
| `--limit N` | `-n` | Max results (default: 100, max: 200) |
|
|
233
|
+
| `--json` | | Emit JSON to stdout |
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
### `dotmd info`
|
|
238
|
+
|
|
239
|
+
Show version, registry details, supported formats, and configuration.
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
dotmd info
|
|
243
|
+
|
|
244
|
+
# Skip the ASCII art banner
|
|
245
|
+
dotmd info --plain
|
|
246
|
+
|
|
247
|
+
# JSON output
|
|
248
|
+
dotmd info --json
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Output File Mapping
|
|
254
|
+
|
|
255
|
+
When you run `dotmd get`, the rule is written to the standard location for its format type:
|
|
256
|
+
|
|
257
|
+
| Format | Written to |
|
|
258
|
+
|--------|-----------|
|
|
259
|
+
| `claude.md` | `CLAUDE.md` |
|
|
260
|
+
| `cursorrules` | `.cursorrules` |
|
|
261
|
+
| `windsurfrules` | `.windsurfrules` |
|
|
262
|
+
| `agents.md` | `AGENTS.md` |
|
|
263
|
+
| `copilot` | `.github/copilot-instructions.md` |
|
|
264
|
+
| `gemini` | `GEMINI.md` |
|
|
265
|
+
| `cline` | `.clinerules` |
|
|
266
|
+
| `aider` | `.aider.conf.yml` |
|
|
267
|
+
| `continue` | `.continue/config.json` |
|
|
268
|
+
|
|
269
|
+
Use `--output PATH` to override the destination for any rule.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Configuration
|
|
274
|
+
|
|
275
|
+
`dotmd` works out of the box with no configuration. If your deployment requires authentication, set these environment variables:
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
# Supabase anon key (required for authenticated registries)
|
|
279
|
+
export DOTMD_SUPABASE_ANON_KEY="your-supabase-anon-key"
|
|
280
|
+
|
|
281
|
+
# Override the Supabase REST base URL (optional)
|
|
282
|
+
export DOTMD_SUPABASE_BASE_URL="https://your-project-ref.supabase.co/rest/v1"
|
|
283
|
+
|
|
284
|
+
# Aliases
|
|
285
|
+
export DOTMD_API_KEY="..." # alias for DOTMD_SUPABASE_ANON_KEY
|
|
286
|
+
export DOTMD_BASE_URL="..." # alias for DOTMD_SUPABASE_BASE_URL
|
|
287
|
+
|
|
288
|
+
# Disable color output (follows https://no-color.org/)
|
|
289
|
+
export NO_COLOR=1
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
**Auto-discovery:** If the default endpoint fails, `dotmd` automatically attempts to discover the current Supabase REST URL and anon key from `https://mydotmd.io` and retries.
|
|
293
|
+
|
|
294
|
+
---
|
|
295
|
+
|
|
296
|
+
## LLM & Automation Usage
|
|
297
|
+
|
|
298
|
+
`dotmd` is designed to work cleanly in automated pipelines and as a tool for AI agents:
|
|
299
|
+
|
|
300
|
+
**Pipe-friendly:** When stdout is not a TTY (piped, redirected, or called by an LLM), the ASCII art banner is automatically suppressed and only plain text is emitted.
|
|
301
|
+
|
|
302
|
+
**JSON output:** Every command supports `--json` for structured, machine-readable output:
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
# Get a rule and parse the result
|
|
306
|
+
dotmd get dotmd/react-best-practices --json | jq .destination
|
|
307
|
+
|
|
308
|
+
# Search and pipe to another tool
|
|
309
|
+
dotmd search react --json | jq '.results[].title'
|
|
310
|
+
|
|
311
|
+
# Dry run to check destination before writing
|
|
312
|
+
dotmd get dotmd/react-best-practices --dry-run --json
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
**Exit codes:**
|
|
316
|
+
|
|
317
|
+
| Code | Meaning |
|
|
318
|
+
|------|---------|
|
|
319
|
+
| `0` | Success |
|
|
320
|
+
| `1` | API or network error |
|
|
321
|
+
| `2` | Usage error (bad arguments, file exists without `--force`, ambiguous title) |
|
|
322
|
+
| `130` | Interrupted (Ctrl+C) |
|
|
323
|
+
|
|
324
|
+
**`NO_COLOR` support:** Set `NO_COLOR=1` to disable all ANSI color codes, following the [no-color.org](https://no-color.org/) convention.
|
|
325
|
+
|
|
326
|
+
---
|
|
327
|
+
|
|
328
|
+
## Contributing
|
|
329
|
+
|
|
330
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, testing, and pull request guidelines.
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
334
|
+
## License
|
|
335
|
+
|
|
336
|
+
[MIT](LICENSE) © dotmd contributors
|
dotmd-0.1.0/README.md
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# dotmd
|
|
4
|
+
|
|
5
|
+
**The open `.md` registry CLI**
|
|
6
|
+
|
|
7
|
+
Fetch and share the AI instruction files that power your coding assistants.
|
|
8
|
+
|
|
9
|
+
[](https://pypi.org/project/dotmd/)
|
|
10
|
+
[](https://pypi.org/project/dotmd/)
|
|
11
|
+
[](https://github.com/dotmd/dotmd-cli/actions/workflows/ci.yml)
|
|
12
|
+
[](LICENSE)
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
`dotmd` is a command-line tool for the [mydotmd.io](https://mydotmd.io) registry — like Docker Hub, but for `.md` instruction files. Browse, search, and pull the rules that configure AI coding assistants like Cursor, Claude, Windsurf, Copilot, and more.
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
╭──────────────────────────────────────────────────────────────────────╮
|
|
22
|
+
│ ____ _ _ │
|
|
23
|
+
│ | _ \ ___ | |_ _ __ ___ __| | │
|
|
24
|
+
│ | | | |/ _ \| __|| '_ ` _ \ / _` | │
|
|
25
|
+
│ | |_| | (_) | |_ | | | | | | (_| | │
|
|
26
|
+
│ |____/ \___/ \__||_| |_| |_|\__,_| │
|
|
27
|
+
│ │
|
|
28
|
+
│ Share your .md instruction files. │
|
|
29
|
+
╰──────────────────────────────────────────────────────────────────────╯
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## Table of Contents
|
|
35
|
+
|
|
36
|
+
- [Install](#install)
|
|
37
|
+
- [Quick Start](#quick-start)
|
|
38
|
+
- [Commands](#commands)
|
|
39
|
+
- [get](#dotmd-get)
|
|
40
|
+
- [search](#dotmd-search)
|
|
41
|
+
- [list](#dotmd-list)
|
|
42
|
+
- [info](#dotmd-info)
|
|
43
|
+
- [Output File Mapping](#output-file-mapping)
|
|
44
|
+
- [Configuration](#configuration)
|
|
45
|
+
- [LLM & Automation Usage](#llm--automation-usage)
|
|
46
|
+
- [Contributing](#contributing)
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Install
|
|
51
|
+
|
|
52
|
+
**Requires Python 3.8+**
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install dotmd
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Verify the install:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
dotmd --version
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## Quick Start
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Browse what's available
|
|
70
|
+
dotmd list
|
|
71
|
+
|
|
72
|
+
# Search by keyword
|
|
73
|
+
dotmd search react typescript
|
|
74
|
+
|
|
75
|
+
# Fetch a rule into your project
|
|
76
|
+
dotmd get dotmd/react-best-practices
|
|
77
|
+
|
|
78
|
+
# See where it was written
|
|
79
|
+
dotmd info
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Commands
|
|
85
|
+
|
|
86
|
+
### `dotmd get`
|
|
87
|
+
|
|
88
|
+
Fetch a rule from the registry and write it to the correct local instruction file for your AI tool.
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Full slug: <username>/<title>
|
|
92
|
+
dotmd get dotmd/react-best-practices
|
|
93
|
+
|
|
94
|
+
# Bare title — auto-resolved when only one match exists
|
|
95
|
+
dotmd get react-best-practices
|
|
96
|
+
|
|
97
|
+
# Explicit username with bare title
|
|
98
|
+
dotmd get react-best-practices --username dotmd
|
|
99
|
+
|
|
100
|
+
# Preview destination without writing (dry run)
|
|
101
|
+
dotmd get dotmd/react-best-practices --dry-run
|
|
102
|
+
|
|
103
|
+
# Write to a custom path
|
|
104
|
+
dotmd get dotmd/react-best-practices --output .cursorrules
|
|
105
|
+
|
|
106
|
+
# Overwrite an existing file
|
|
107
|
+
dotmd get dotmd/react-best-practices --force
|
|
108
|
+
|
|
109
|
+
# Suppress all output (useful in scripts)
|
|
110
|
+
dotmd get dotmd/react-best-practices --quiet
|
|
111
|
+
|
|
112
|
+
# Machine-readable JSON output
|
|
113
|
+
dotmd get dotmd/react-best-practices --json
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**Options:**
|
|
117
|
+
|
|
118
|
+
| Flag | Short | Description |
|
|
119
|
+
|------|-------|-------------|
|
|
120
|
+
| `--username USER` | `-u` | Registry username (use with bare title) |
|
|
121
|
+
| `--output PATH` | `-o` | Write to a specific path instead of the default |
|
|
122
|
+
| `--force` | `-f` | Overwrite destination if it already exists |
|
|
123
|
+
| `--dry-run` | | Preview destination without writing |
|
|
124
|
+
| `--quiet` | `-q` | Suppress non-error output |
|
|
125
|
+
| `--json` | | Emit JSON to stdout |
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### `dotmd search`
|
|
130
|
+
|
|
131
|
+
Search the registry for rules by keyword. Matches against rule titles.
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
# Single keyword
|
|
135
|
+
dotmd search python
|
|
136
|
+
|
|
137
|
+
# Multiple keywords (AND match)
|
|
138
|
+
dotmd search react typescript performance
|
|
139
|
+
|
|
140
|
+
# Limit results
|
|
141
|
+
dotmd search react --limit 5
|
|
142
|
+
|
|
143
|
+
# JSON output for scripting
|
|
144
|
+
dotmd search react --json
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Options:**
|
|
148
|
+
|
|
149
|
+
| Flag | Short | Description |
|
|
150
|
+
|------|-------|-------------|
|
|
151
|
+
| `--limit N` | `-n` | Max results (default: 20, max: 100) |
|
|
152
|
+
| `--json` | | Emit JSON to stdout |
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
### `dotmd list`
|
|
157
|
+
|
|
158
|
+
List rules for a specific user, or all public rules in the registry.
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# All public rules
|
|
162
|
+
dotmd list
|
|
163
|
+
|
|
164
|
+
# Rules for a specific user
|
|
165
|
+
dotmd list dotmd
|
|
166
|
+
|
|
167
|
+
# Limit results
|
|
168
|
+
dotmd list --limit 50
|
|
169
|
+
|
|
170
|
+
# JSON output
|
|
171
|
+
dotmd list dotmd --json
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
**Options:**
|
|
175
|
+
|
|
176
|
+
| Flag | Short | Description |
|
|
177
|
+
|------|-------|-------------|
|
|
178
|
+
| `--limit N` | `-n` | Max results (default: 100, max: 200) |
|
|
179
|
+
| `--json` | | Emit JSON to stdout |
|
|
180
|
+
|
|
181
|
+
---
|
|
182
|
+
|
|
183
|
+
### `dotmd info`
|
|
184
|
+
|
|
185
|
+
Show version, registry details, supported formats, and configuration.
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
dotmd info
|
|
189
|
+
|
|
190
|
+
# Skip the ASCII art banner
|
|
191
|
+
dotmd info --plain
|
|
192
|
+
|
|
193
|
+
# JSON output
|
|
194
|
+
dotmd info --json
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Output File Mapping
|
|
200
|
+
|
|
201
|
+
When you run `dotmd get`, the rule is written to the standard location for its format type:
|
|
202
|
+
|
|
203
|
+
| Format | Written to |
|
|
204
|
+
|--------|-----------|
|
|
205
|
+
| `claude.md` | `CLAUDE.md` |
|
|
206
|
+
| `cursorrules` | `.cursorrules` |
|
|
207
|
+
| `windsurfrules` | `.windsurfrules` |
|
|
208
|
+
| `agents.md` | `AGENTS.md` |
|
|
209
|
+
| `copilot` | `.github/copilot-instructions.md` |
|
|
210
|
+
| `gemini` | `GEMINI.md` |
|
|
211
|
+
| `cline` | `.clinerules` |
|
|
212
|
+
| `aider` | `.aider.conf.yml` |
|
|
213
|
+
| `continue` | `.continue/config.json` |
|
|
214
|
+
|
|
215
|
+
Use `--output PATH` to override the destination for any rule.
|
|
216
|
+
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
## Configuration
|
|
220
|
+
|
|
221
|
+
`dotmd` works out of the box with no configuration. If your deployment requires authentication, set these environment variables:
|
|
222
|
+
|
|
223
|
+
```bash
|
|
224
|
+
# Supabase anon key (required for authenticated registries)
|
|
225
|
+
export DOTMD_SUPABASE_ANON_KEY="your-supabase-anon-key"
|
|
226
|
+
|
|
227
|
+
# Override the Supabase REST base URL (optional)
|
|
228
|
+
export DOTMD_SUPABASE_BASE_URL="https://your-project-ref.supabase.co/rest/v1"
|
|
229
|
+
|
|
230
|
+
# Aliases
|
|
231
|
+
export DOTMD_API_KEY="..." # alias for DOTMD_SUPABASE_ANON_KEY
|
|
232
|
+
export DOTMD_BASE_URL="..." # alias for DOTMD_SUPABASE_BASE_URL
|
|
233
|
+
|
|
234
|
+
# Disable color output (follows https://no-color.org/)
|
|
235
|
+
export NO_COLOR=1
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
**Auto-discovery:** If the default endpoint fails, `dotmd` automatically attempts to discover the current Supabase REST URL and anon key from `https://mydotmd.io` and retries.
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## LLM & Automation Usage
|
|
243
|
+
|
|
244
|
+
`dotmd` is designed to work cleanly in automated pipelines and as a tool for AI agents:
|
|
245
|
+
|
|
246
|
+
**Pipe-friendly:** When stdout is not a TTY (piped, redirected, or called by an LLM), the ASCII art banner is automatically suppressed and only plain text is emitted.
|
|
247
|
+
|
|
248
|
+
**JSON output:** Every command supports `--json` for structured, machine-readable output:
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
# Get a rule and parse the result
|
|
252
|
+
dotmd get dotmd/react-best-practices --json | jq .destination
|
|
253
|
+
|
|
254
|
+
# Search and pipe to another tool
|
|
255
|
+
dotmd search react --json | jq '.results[].title'
|
|
256
|
+
|
|
257
|
+
# Dry run to check destination before writing
|
|
258
|
+
dotmd get dotmd/react-best-practices --dry-run --json
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
**Exit codes:**
|
|
262
|
+
|
|
263
|
+
| Code | Meaning |
|
|
264
|
+
|------|---------|
|
|
265
|
+
| `0` | Success |
|
|
266
|
+
| `1` | API or network error |
|
|
267
|
+
| `2` | Usage error (bad arguments, file exists without `--force`, ambiguous title) |
|
|
268
|
+
| `130` | Interrupted (Ctrl+C) |
|
|
269
|
+
|
|
270
|
+
**`NO_COLOR` support:** Set `NO_COLOR=1` to disable all ANSI color codes, following the [no-color.org](https://no-color.org/) convention.
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## Contributing
|
|
275
|
+
|
|
276
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, testing, and pull request guidelines.
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## License
|
|
281
|
+
|
|
282
|
+
[MIT](LICENSE) © dotmd contributors
|