Skip to content

cli: add auth commands #211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 12, 2025
Merged

cli: add auth commands #211

merged 3 commits into from
Aug 12, 2025

Conversation

stordahl
Copy link
Collaborator

@stordahl stordahl commented Aug 10, 2025

Overview

This PR makes two major changes

  1. Adds a new command, auth, and three sub-commands
    a. enable - Sets CF_AUTH_ENABLED to true, checks if other auth secrets exist, and prompts the user for a password if they don't
    b. disable - Sets CF_AUTH_ENABLED to false, keeps other auth secrets in place
    c. roll - Allows the user to set a new password
  2. Restructures /packages/cli into lib and commands directories to keep things clean after adding more commands

@stordahl stordahl force-pushed the stordahl/auth-cli-helpers branch 2 times, most recently from 0a5495c to 1a46e9c Compare August 10, 2025 23:01
@stordahl stordahl force-pushed the stordahl/auth-cli-helpers branch from 1a46e9c to fb0ae8a Compare August 10, 2025 23:13
Copy link

codecov bot commented Aug 12, 2025

Codecov Report

❌ Patch coverage is 68.09524% with 67 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.11%. Comparing base (412a4e0) to head (337af04).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/cli/src/index.ts 0.00% 62 Missing ⚠️
packages/cli/scripts/generate-secrets.mjs 0.00% 3 Missing ⚠️
packages/cli/src/commands/install.ts 80.00% 1 Missing ⚠️
packages/cli/src/lib/ui.ts 96.55% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #211      +/-   ##
==========================================
- Coverage   78.64%   78.11%   -0.54%     
==========================================
  Files          49       50       +1     
  Lines        3695     3870     +175     
  Branches      483      507      +24     
==========================================
+ Hits         2906     3023     +117     
- Misses        780      838      +58     
  Partials        9        9              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stordahl stordahl marked this pull request as ready for review August 12, 2025 14:41
@benvinegar benvinegar requested a review from Copilot August 12, 2025 17:33
Copy link

@Copilot 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 adds authentication management commands to the CLI and restructures the codebase for better organization. The changes enable users to manage authentication settings through dedicated CLI commands while maintaining clean separation of concerns.

  • Adds new auth command with enable, disable, and role subcommands for managing authentication
  • Restructures the project by moving utilities into a lib directory and commands into a commands directory
  • Consolidates password prompting functionality into a reusable utility function

Reviewed Changes

Copilot reviewed 12 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/cli/src/lib/ui.ts Adds reusable password prompting function with validation
packages/cli/src/lib/config.ts Updates path resolution for new directory structure
packages/cli/src/commands/auth.ts Implements new authentication management commands
packages/cli/src/commands/install.ts Updates imports and uses new shared password prompt function
packages/cli/src/index.ts Adds auth command configuration and updates help behavior
Test files Updates test imports and adds comprehensive auth command tests
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@stordahl stordahl merged commit d8d3845 into main Aug 12, 2025
3 checks passed
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