Skip to content

Commit 8b33f04

Browse files
committed
chore: release CLI version 2.0.0 with API key support and documentation updates
- Bumped CLI version to 2.0.0 in package.json. - Added `--api-key` option for non-interactive authentication in README.md. - Enhanced documentation for using the CLI in CI/CD pipelines. - Updated success message in `generateTypesAction` for clarity. - Removed redundant success message in `generateTypesAction` to streamline output.
1 parent 54735ea commit 8b33f04

File tree

3 files changed

+47
-6
lines changed

3 files changed

+47
-6
lines changed

packages/cli/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ These options can be used with any command:
241241
- `--debug`: Enable debug mode for verbose output.
242242
- `--base-url <url>`: Set the base URL for Bucket API.
243243
- `--api-url <url>`: Set the API URL directly (overrides base URL).
244+
- `--api-key <key>`: Bucket API key for non-interactive authentication.
244245
- `--help`: Display help information for a command.
245246

246247
## AI-Assisted Development
@@ -297,6 +298,50 @@ The command will guide you through:
297298

298299
_**Note: The setup uses [mcp-remote](https://github.com/geelen/mcp-remote) as a compatibility layer allowing the remote hosted Bucket MCP server to work with all editors/clients that support MCP STDIO servers. If your editor/client supports HTTP Streaming with OAuth you can connect to the Bucket MCP server directly.**_
299300

301+
## Using in CI/CD Pipelines (Beta)
302+
303+
The Bucket CLI is designed to work seamlessly in CI/CD pipelines. For automated environments where interactive login is not possible, use the `--api-key` option.
304+
305+
```bash
306+
# Generate types in CI/CD
307+
npx bucket apps list --api-key $BUCKET_API_KEY
308+
```
309+
310+
**Important restrictions:**
311+
312+
- When using `--api-key`, the `login` and `logout` commands are disabled.
313+
- API keys bypass all interactive authentication flows.
314+
- Only _read-only_ access to Bucket API is granted at the moment.
315+
- API keys are bound to one app only. Commands such as `apps list` will only return the bound app.
316+
- Store API keys securely using your CI/CD platform's secret management.
317+
318+
### Primary Use Case: Type Validation in CI/CD
319+
320+
Use the `--check-only` flag with `features types` to validate that generated types are up-to-date:
321+
322+
```bash
323+
# Check if types are current (exits with non-zero code if not)
324+
npx bucket features types --check-only --api-key $BUCKET_API_KEY --app-id ap123456789
325+
```
326+
327+
This is particularly useful for:
328+
329+
- **Pull Request validation**: Ensure developers have regenerated types after feature changes.
330+
- **Build verification**: Confirm types are synchronized before deployment.
331+
- **Automated quality checks**: Catch type drift in your CI pipeline.
332+
333+
Example CI workflow:
334+
335+
```yaml
336+
# GitHub Actions example
337+
- name: Validate Bucket types
338+
run: npx bucket features types --check-only --api-key ${{ secrets.BUCKET_API_KEY }}
339+
340+
- name: Generate types if validation fails
341+
if: failure()
342+
run: npx bucket features types --api-key ${{ secrets.BUCKET_API_KEY }}
343+
```
344+
300345
## Development
301346
302347
```bash

packages/cli/commands/features.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ export const generateTypesAction = async ({
203203
handleError(`Type check failed.`, "Features Types");
204204
} else {
205205
spinner.succeed(
206-
`Validated ${output.format} types in ${chalk.cyan(relative(projectPath, fullPath))}.`,
206+
`All ${output.format} types are up to date in ${chalk.cyan(relative(projectPath, fullPath))}.`,
207207
);
208208
}
209209
} else {
@@ -213,10 +213,6 @@ export const generateTypesAction = async ({
213213
);
214214
}
215215
}
216-
217-
spinner.succeed(
218-
`${checkOnly ? "Checked" : "Generated"} types for app ${chalk.cyan(app.name)}.`,
219-
);
220216
} catch (error) {
221217
spinner?.fail("Type generation failed.");
222218
handleError(error, "Features Types");

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bucketco/cli",
3-
"version": "1.0.1",
3+
"version": "2.0.0",
44
"packageManager": "yarn@4.1.1",
55
"description": "CLI for Bucket service",
66
"main": "./dist/index.js",

0 commit comments

Comments
 (0)