@braid-cloud/cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,283 @@
1
+ # @braid-cloud/cli
2
+
3
+ Install [braid](https://braid.cloud) rules as agent skills to your local development environment.
4
+
5
+ ## Overview
6
+
7
+ `@braid-cloud/cli` is a CLI that syncs your braid rules to local AI coding agents like Claude Code, OpenCode, Cursor, and 15+ others. Once installed, skills work offline and are automatically picked up by your agents.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ # Run directly with npx
13
+ npx @braid-cloud/cli --help
14
+
15
+ # Or install globally
16
+ npm install -g @braid-cloud/cli
17
+ ```
18
+
19
+ ## Quick Start
20
+
21
+ ```bash
22
+ # 1. Authenticate with your braid API key
23
+ braid auth
24
+
25
+ # 2. Install skills from a profile
26
+ braid install --profile coding-standards
27
+
28
+ # 3. View installed skills
29
+ braid list
30
+ ```
31
+
32
+ ## Commands
33
+
34
+ ### `braid auth`
35
+
36
+ Configure your braid API key for authentication.
37
+
38
+ ```bash
39
+ # Interactive login
40
+ braid auth
41
+
42
+ # Check auth status
43
+ braid auth status
44
+
45
+ # Logout (remove stored key)
46
+ braid auth logout
47
+
48
+ # Use a different server (review apps, local dev)
49
+ braid auth --server https://my-branch.braid.cloud
50
+ ```
51
+
52
+ #### Token Configuration
53
+
54
+ The CLI looks for your API token in the following order:
55
+
56
+ 1. **`BRAID_API_KEY` environment variable** - Best for CI/CD
57
+ 2. **`braid.user.json` in your project** - Recommended for teams
58
+ 3. **`~/.config/braid/config.json`** - Global fallback
59
+
60
+ **Recommended: Project-level configuration**
61
+
62
+ Create two files in your project root:
63
+
64
+ **`braid.json`** (committed to git, shared with team):
65
+
66
+ ```json
67
+ {
68
+ "project": "my-project",
69
+ "org": "my-org"
70
+ }
71
+ ```
72
+
73
+ **`braid.user.json`** (gitignored, personal token):
74
+
75
+ ```json
76
+ {
77
+ "token": "br_your_personal_access_token"
78
+ }
79
+ ```
80
+
81
+ Add `braid.user.json` to your `.gitignore`:
82
+
83
+ ```bash
84
+ echo "braid.user.json" >> .gitignore
85
+ ```
86
+
87
+ This approach allows:
88
+
89
+ - Team members share the same project/org configuration
90
+ - Each developer uses their own personal access token
91
+ - No credentials are committed to git
92
+
93
+ You can override any setting in `braid.user.json`:
94
+
95
+ ```json
96
+ {
97
+ "token": "br_your_token",
98
+ "serverUrl": "https://my-branch.braid.cloud",
99
+ "profile": "my-custom-profile"
100
+ }
101
+ ```
102
+
103
+ ### `braid install`
104
+
105
+ Install skills from a braid profile or project.
106
+
107
+ ```bash
108
+ # Install from a profile
109
+ braid install --profile coding-standards
110
+ braid install -p coding-standards
111
+
112
+ # Install from a project
113
+ braid install --project frontend --org acme-corp
114
+
115
+ # Specify agents manually
116
+ braid install -p coding-standards --agents claude-code,opencode
117
+
118
+ # Install to global directories (not project-local)
119
+ braid install -p coding-standards --global
120
+
121
+ # Preview skills without installing
122
+ braid install -p coding-standards --list
123
+
124
+ # Skip confirmation prompts
125
+ braid install -p coding-standards --yes
126
+
127
+ # Use a different server
128
+ braid install -p coding-standards --server https://localhost:3000
129
+ ```
130
+
131
+ **Options:**
132
+
133
+ | Flag | Description |
134
+ | ---------------------- | ----------------------------------- |
135
+ | `-p, --profile <name>` | Profile name to install from |
136
+ | `--project <name>` | Project name (requires `--org`) |
137
+ | `-o, --org <slug>` | Organization slug |
138
+ | `-a, --agents <list>` | Comma-separated agent list |
139
+ | `-g, --global` | Install to global agent directories |
140
+ | `-y, --yes` | Skip confirmation prompts |
141
+ | `-l, --list` | Preview skills without installing |
142
+ | `-s, --server <url>` | braid server URL |
143
+
144
+ ### `braid list`
145
+
146
+ List installed skills across all detected agents.
147
+
148
+ ```bash
149
+ # List project-local skills
150
+ braid list
151
+
152
+ # List global skills only
153
+ braid list --global
154
+ ```
155
+
156
+ ### `braid update`
157
+
158
+ Update installed skills to the latest version from braid.
159
+
160
+ ```bash
161
+ # Update all installed skills
162
+ braid update
163
+
164
+ # Update global skills only
165
+ braid update --global
166
+
167
+ # Skip confirmation
168
+ braid update --yes
169
+ ```
170
+
171
+ ## Supported Agents
172
+
173
+ `@braid-cloud/cli` automatically detects and supports these AI coding agents:
174
+
175
+ | Agent | Project Path | Global Path |
176
+ | -------------- | ------------------------- | ---------------------------------- |
177
+ | Claude Code | `.claude/skills/` | `~/.claude/skills/` |
178
+ | OpenCode | `.opencode/skills/` | `~/.config/opencode/skills/` |
179
+ | Cursor | `.cursor/skills/` | `~/.cursor/skills/` |
180
+ | Windsurf | `.windsurf/skills/` | `~/.windsurf/skills/` |
181
+ | Cline | `.cline/skills/` | `~/.cline/skills/` |
182
+ | Roo Code | `.roo/skills/` | `~/.roo/skills/` |
183
+ | Augment | `.augment/skills/` | `~/.augment/skills/` |
184
+ | Aider | `.aider/skills/` | `~/.aider/skills/` |
185
+ | GitHub Copilot | `.github/copilot/skills/` | `~/.config/github-copilot/skills/` |
186
+ | Continue | `.continue/skills/` | `~/.continue/skills/` |
187
+ | Void | `.void/skills/` | `~/.void/skills/` |
188
+ | Codex | `.codex/skills/` | `~/.codex/skills/` |
189
+ | Amp | `.amp/skills/` | `~/.amp/skills/` |
190
+ | Trae | `.trae/skills/` | `~/.trae/skills/` |
191
+ | Kilo Code | `.kilo/skills/` | `~/.kilo/skills/` |
192
+ | Gemini CLI | `.gemini/skills/` | `~/.gemini/skills/` |
193
+ | Witsy | `.witsy/skills/` | `~/.witsy/skills/` |
194
+ | Zed | `.zed/skills/` | `~/.config/zed/skills/` |
195
+
196
+ ## Configuration
197
+
198
+ ### Configuration Files
199
+
200
+ The CLI uses two configuration files in your project:
201
+
202
+ | File | Purpose | Git |
203
+ | ----------------- | ------------------------------------------ | ------ |
204
+ | `braid.json` | Shared team config (project, org, profile) | Commit |
205
+ | `braid.user.json` | Personal token and overrides | Ignore |
206
+
207
+ ### `braid.json` Format (shared)
208
+
209
+ ```json
210
+ {
211
+ "project": "my-project",
212
+ "org": "my-org",
213
+ "serverUrl": "https://braid.cloud"
214
+ }
215
+ ```
216
+
217
+ ### `braid.user.json` Format (personal)
218
+
219
+ ```json
220
+ {
221
+ "token": "br_your_personal_access_token"
222
+ }
223
+ ```
224
+
225
+ You can override any `braid.json` setting in `braid.user.json`.
226
+
227
+ ### Resolution Order
228
+
229
+ Settings are resolved in this order (later sources override earlier):
230
+
231
+ 1. `braid.json` (shared team config)
232
+ 2. `braid.user.json` (personal overrides)
233
+ 3. Environment variables (`BRAID_API_KEY`, `BRAID_SERVER_URL`)
234
+ 4. CLI flags (`--server`, `--profile`, etc.)
235
+
236
+ ### Environment Variables
237
+
238
+ | Variable | Description |
239
+ | ------------------ | ------------------------------------------- |
240
+ | `BRAID_API_KEY` | API key (highest priority) |
241
+ | `BRAID_SERVER_URL` | Server URL (default: `https://braid.cloud`) |
242
+
243
+ ## SKILL.md Format
244
+
245
+ Skills are installed as directories containing a `SKILL.md` file with YAML frontmatter:
246
+
247
+ ```
248
+ my-skill/
249
+ ├── SKILL.md
250
+ └── references/
251
+ ├── style-guide.md
252
+ └── diagram.png
253
+ ```
254
+
255
+ **SKILL.md example:**
256
+
257
+ ```markdown
258
+ ---
259
+ name: code-quality
260
+ description: Modern TypeScript/React development standards
261
+ category: coding-standards
262
+ tags:
263
+ - typescript
264
+ - react
265
+ - code-style
266
+ ---
267
+
268
+ # Code Quality
269
+
270
+ Instructions for the agent to follow...
271
+ ```
272
+
273
+ ## Metadata Tracking
274
+
275
+ Installed skills are tracked in `.braid-skills-metadata.json` within each agent's skills directory. This enables:
276
+
277
+ - Knowing which skills came from braid
278
+ - Tracking the source profile/project
279
+ - Detecting when updates are available
280
+
281
+ ## License
282
+
283
+ MIT
@@ -0,0 +1,2 @@
1
+
2
+ export { }