@vocoder/cli 0.10.0 → 0.12.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 CHANGED
@@ -136,6 +136,142 @@ Patterns can also be set via env vars: `VOCODER_INCLUDE_PATTERN` and `VOCODER_EX
136
136
 
137
137
  ---
138
138
 
139
+ ## Project Management
140
+
141
+ These commands operate on an existing Vocoder project and require `VOCODER_API_KEY` in your environment (set it in `.env` or export it before running).
142
+
143
+ ### `vocoder locales`
144
+
145
+ Show the project's configured source locale and all target locales.
146
+
147
+ ```bash
148
+ vocoder locales
149
+ # Source locale: en
150
+ # Target locales: fr, de, pt-BR
151
+ ```
152
+
153
+ #### `vocoder locales add <codes...>`
154
+
155
+ Add one or more target locales to the project. Accepts variadic BCP 47 codes.
156
+
157
+ ```bash
158
+ vocoder locales add fr
159
+ vocoder locales add fr de pt-BR
160
+ ```
161
+
162
+ Returns an error with an upgrade link if the plan's locale limit is reached.
163
+
164
+ #### `vocoder locales remove <codes...>`
165
+
166
+ Remove one or more target locales from the project. Idempotent — silently skips locales that are not configured.
167
+
168
+ ```bash
169
+ vocoder locales remove fr
170
+ vocoder locales remove de pt-BR
171
+ ```
172
+
173
+ #### `vocoder locales supported`
174
+
175
+ List all locales supported by Vocoder. Useful for finding BCP 47 codes before calling `add`.
176
+
177
+ ```bash
178
+ vocoder locales supported
179
+ # Source locales:
180
+ # en English
181
+ # ...
182
+ # Target locales:
183
+ # ar Arabic (العربية)
184
+ # de German (Deutsch)
185
+ # es Spanish (Español)
186
+ # fr French (Français)
187
+ # ...
188
+ ```
189
+
190
+ ---
191
+
192
+ ### `vocoder project`
193
+
194
+ Display the full project configuration: name, organization, source locale, target locales, target branches, and sync policy.
195
+
196
+ ```bash
197
+ vocoder project
198
+ # ╭─ My App — project config ────────────────────╮
199
+ # │ Project: My App │
200
+ # │ Organization: Acme Corp │
201
+ # │ Source locale: en │
202
+ # │ Target locales: fr, de, pt-BR │
203
+ # │ Target branches: main │
204
+ # │ Primary branch: main │
205
+ # │ Sync policy: │
206
+ # │ Blocking branches: main, master │
207
+ # │ Blocking mode: required │
208
+ # │ Non-blocking mode: best-effort │
209
+ # │ Max wait: 60000 ms │
210
+ # ╰───────────────────────────────────────────────╯
211
+ ```
212
+
213
+ ---
214
+
215
+ ### `vocoder translations`
216
+
217
+ Download the current translation snapshot for a branch.
218
+
219
+ ```bash
220
+ vocoder translations
221
+ vocoder translations --branch main --locale fr
222
+ vocoder translations --output ./public/locales
223
+ ```
224
+
225
+ Without `--output`, prints the full snapshot as JSON to stdout (suitable for piping). With `--output <dir>`, writes one `<locale>.json` file per locale to the specified directory. Each file shape:
226
+
227
+ ```json
228
+ {
229
+ "Hello": "Bonjour",
230
+ "Goodbye": "Au revoir"
231
+ }
232
+ ```
233
+
234
+ **Options:**
235
+
236
+ | Flag | Description |
237
+ |---|---|
238
+ | `--branch <branch>` | Git branch (auto-detected from git/CI if omitted) |
239
+ | `--locale <locale>` | Fetch a single locale only |
240
+ | `--output <dir>` | Write locale JSON files to this directory |
241
+
242
+ ---
243
+
244
+ ### `vocoder create-project`
245
+
246
+ Create a new Vocoder project without the interactive `init` flow. Requires authentication (run `vocoder init` first).
247
+
248
+ ```bash
249
+ vocoder create-project \
250
+ --name "My App" \
251
+ --source-locale en \
252
+ --target-locales fr,de,pt-BR \
253
+ --target-branches main \
254
+ --workspace <org-id>
255
+ ```
256
+
257
+ On success, prints the generated `VOCODER_API_KEY`. The organization ID can be found with `vocoder whoami`.
258
+
259
+ Git repository is auto-detected from the current directory's git remote. Use `--repo github:owner/repo` to override, or omit to create the project without repo binding (push-based sync will not function until a repository is connected via the dashboard).
260
+
261
+ **Options:**
262
+
263
+ | Flag | Description |
264
+ |---|---|
265
+ | `--name <name>` | Project display name (required) |
266
+ | `--source-locale <code>` | Source language BCP 47 code, e.g. `en` (required) |
267
+ | `--workspace <org-id>` | Organization ID (required) |
268
+ | `--target-locales <codes>` | Comma-separated target locale codes, e.g. `fr,de,pt-BR` |
269
+ | `--target-branches <names>` | Comma-separated branch names to sync (default: `main`) |
270
+ | `--repo <canonical>` | Git repo canonical, e.g. `github:owner/repo` |
271
+ | `--app-dir <path>` | App directory within the repo for monorepos (default: `.`) |
272
+
273
+ ---
274
+
139
275
  ### `vocoder logout`
140
276
 
141
277
  Revoke the stored credentials and clear `~/.config/vocoder/auth.json`.
@@ -183,7 +319,7 @@ The CLI auto-detects repository context from the working directory:
183
319
 
184
320
  | Variable | Used by | Purpose |
185
321
  |---|---|---|
186
- | `VOCODER_API_KEY` | `sync`, MCP | Project API key (`vc_` prefix) |
322
+ | `VOCODER_API_KEY` | `sync`, `locales`, `project`, `translations`, MCP | Project API key (`vcp_` prefix) |
187
323
  | `VOCODER_AUTH_TOKEN` | `init` | Override stored user token (`vcu_` prefix) |
188
324
  | `VOCODER_API_URL` | All commands | Override API base URL (default: `https://vocoder.app`) |
189
325