Skip to content

feat: Bucket CLI 2.0#448

Merged
pavkam merged 12 commits intomainfrom
cleanup-cli
Jul 31, 2025
Merged

feat: Bucket CLI 2.0#448
pavkam merged 12 commits intomainfrom
cleanup-cli

Conversation

@pavkam
Copy link
Contributor

@pavkam pavkam commented Jul 23, 2025

  • Added --api-key option for non-interactive authentication,
  • Added a new --check-only flag for types generation,
  • Added a version check at startup,
  • (BREAKING) Removed unused and deprecated functionality,
  • Enhanced documentation for using the CLI in CI/CD pipelines.

pavkam added 3 commits July 23, 2025 09:56
- Added support for an API key option in the CLI, allowing users to authenticate without a personal token.
- Updated the `authStore` to handle API keys and modified the `getToken` method accordingly.
- Removed the `companies` command and related code as it was no longer needed.
- Cleaned up error handling in various commands to ensure consistent logging and user feedback.
- Improved the handling of API URLs and base URLs in the CLI commands.
…neration

- Integrated a background version check in the CLI to notify users of available updates.
- Added a `--check-only` option to the `generateTypesAction` for validating if types are up to date without generating them.
- Introduced a new utility function to check types in files, improving type management.
- Updated dependencies in `package.json` and `yarn.lock` to include `@types/semver` and `semver` version 7.7.2.
…on 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.
@pavkam pavkam self-assigned this Jul 23, 2025
@pavkam pavkam requested review from Swiftwork, Copilot and roncohen July 23, 2025 09:53
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces Bucket CLI 2.0 with significant breaking changes and new features focused on CI/CD integration. The major changes include adding non-interactive authentication via API keys, implementing a type checking system for validation, and removing deprecated functionality to streamline the codebase.

  • Added --api-key option for CI/CD authentication and --check-only flag for type validation
  • Implemented automatic version checking at startup to notify users of available updates
  • Removed deprecated commands and services including companies, users, feedback, and feature access management

Reviewed Changes

Copilot reviewed 25 out of 26 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
packages/cli/utils/version.ts New utility for version checking and NPM registry integration
packages/cli/utils/options.ts Added API key and check-only options, removed deprecated feature options
packages/cli/utils/gen.ts Added type checking functionality for CI/CD validation
packages/cli/utils/errors.ts Enhanced error handling with structured ResponseError class
packages/cli/utils/auth.ts Enhanced authentication to support API keys and improved error handling
packages/cli/stores/auth.ts Updated token management to support API key authentication
packages/cli/commands/features.ts Integrated check-only functionality and removed deprecated feature access commands
packages/cli/index.ts Added version checking and API key support to main CLI entry point
Multiple service files Removed deprecated services (companies, users, feedback, stages)
Comments suppressed due to low confidence (1)

packages/cli/utils/version.ts:7

  • [nitpick] The function name 'current' is ambiguous in this context. Consider renaming it to 'getCurrentVersion' or 'readCurrentVersion' to be more descriptive.
export async function current() {

pavkam and others added 6 commits July 23, 2025 10:56
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…handling and error messages

- Simplified token retrieval in `loginAction` and `logoutAction` for better readability.
- Added checks for existing tokens to prevent unnecessary login/logout attempts.
- Improved error handling in `waitForAccessToken` with more descriptive messages.
- Removed unused `loginUrl` utility function to streamline code.
- Introduced `getOAuthServerUrls` to fetch OAuth server metadata dynamically.
Copy link
Contributor

@roncohen roncohen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work!

pavkam added 3 commits July 25, 2025 16:22
…flow

- Removed the `checkOnly` option from `generateTypesAction` to simplify the type generation process.
- Improved error handling in `waitForAccessToken` with more descriptive messages and a consistent timeout mechanism.
- Introduced a new `registerClient` function to encapsulate client registration logic with the OAuth server.
- Added a `DEFAULT_AUTH_TIMEOUT` constant for configurable authentication timeout.
- Cleaned up unused code related to type checking in files to enhance maintainability.
…exchange

- Renamed variable for clarity from `jsonResponse` to `errorResponse` to better reflect its purpose.
- Consolidated response parsing to avoid multiple calls to `response.json()`, enhancing performance and readability.
- Improved error handling by ensuring a consistent structure for error messages returned during token exchange.
@pavkam pavkam enabled auto-merge July 31, 2025 07:38
@pavkam pavkam added this pull request to the merge queue Jul 31, 2025
Merged via the queue into main with commit e029fdf Jul 31, 2025
6 checks passed
@pavkam pavkam deleted the cleanup-cli branch July 31, 2025 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants