refactor: extract shared auth and error-handling helpers#53
Merged
designcode merged 5 commits intomainfrom Mar 30, 2026
Merged
Conversation
Renames modules, fold configs where they belong. Uses tsconfig paths for cleaner imports
Consolidate ~250 lines of duplicated boilerplate across 35+ command files into 4 shared helpers: failWithError, getOAuthIAMConfig, getStorageConfigWithOrg, and requireOAuthLogin. Delete access-keys/config.ts (moved to auth/iam.ts). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
efirs
approved these changes
Mar 29, 2026
efirs
approved these changes
Mar 29, 2026
efirs
approved these changes
Mar 29, 2026
Define --json, --format, and --yes once in specs.yaml and auto-inject them into every leaf command via getEffectiveArguments(). Replace the repeated 3-line json/format boilerplate across 52 files with a single getFormat() call. Unify --force flags to --yes globally. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
|
🎉 This PR is included in version 2.14.0-beta.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
failWithError,getOAuthIAMConfig,getStorageConfigWithOrg, andrequireOAuthLogingetIAMConfigfromaccess-keys/config.tstoauth/iam.tsand delete the old filerefactor:commitsTest plan
npm run lintpassesnpm run buildpasses (tsc + tsup)npm run testpasses (476/476)npm run build:binary:current)🤖 Generated with Claude Code
Note
Medium Risk
Moderate risk because it changes authentication configuration plumbing and migrates the on-disk CLI config format (v1→v2), plus bumps core tooling dependencies; mistakes could break login/organization selection or command behavior.
Overview
Auth/config refactor: Adds shared IAM/auth helpers in
src/auth/iam.ts(OAuth-only and dual-mode IAM config, Fly-org guard) and moves Auth0 config/constants intosrc/auth/client.ts, deleting the oldsrc/auth/config.tsandsrc/auth/types.ts.Storage format change: Reworks
src/auth/storage.tsto a versionedconfig.jsonschema (v2) with a v1→v2 migration that preserves saved credentials, and makes selected-organization storage method-aware (OAuth vs credentials).Command + CLI plumbing updates: Updates multiple commands (e.g., access-keys) to use the shared IAM config/error helpers and adds support for injecting
definitions.global_argumentsinto per-command help/registration incli-core.ts.Tooling: Enables import sorting/type-import enforcement in ESLint, expands
npm testto includetest/auth, configures semantic-release to publish patch releases forrefactorcommits, and bumps various dependencies/devDependencies (includingvite,vitest,typescript-eslint, andjose).Written by Cursor Bugbot for commit c6cc371. This will update automatically on new commits. Configure here.