Skip to content

Conversation

@avallete
Copy link
Member

Summary

Follow-up: #4598
Addresses PR review comments by refactoring IDE settings prompts and simplifying the API.

Changes

1. Replaced multiple flags with single --interactive flag

  • Removed --with-vscode-settings, --with-vscode-workspace, and --with-intellij-settings
  • Added --interactive (-i) flag (defaults to false for script compatibility)
  • Interactive mode only activates when both the flag is set and running in a TTY terminal

2. Simplified init.Run signature

  • Changed from Run(fsys, *bool, *bool, params) to Run(ctx, fsys, bool, params)
  • Replaced pointer booleans with a single interactive boolean parameter
  • Added context.Context parameter for proper cancellation support

3. Code reuse improvements

  • Replaced custom isFirstFunctionCreation() with deploy.GetFunctionSlugs() as suggested
  • Made PromptForIDESettings public and reusable from functions/new command
  • Removed duplicate prompting logic

4. UI consistency

  • Changed IDE extension/plugin links from utils.Aqua() to utils.Bold() for consistency

5. Updated tests

  • Updated all test cases to match new function signatures
  • Removed obsolete TestIsFirstFunctionCreation tests

Usage

# Non-interactive (default, suitable for scripts)
supabase init

# Interactive mode (prompts for IDE settings)
supabase init --interactive
supabase init -i

This follows the same pattern as supabase projects create for consistency across the CLI.

- Replace --with-vscode-settings and --with-intellij-settings with
  single --interactive flag (defaults to false)
- Simplify init.Run signature: remove pointer bools, add context
- Use deploy.GetFunctionSlugs() instead of custom isFirstFunctionCreation()
- Make PromptForIDESettings public for reuse in functions/new
- Change IDE links from Aqua to Bold for consistency
- Update tests to match new signatures
@avallete avallete requested a review from a team as a code owner December 10, 2025 16:00
@avallete avallete requested review from sweatybridge and removed request for a team December 10, 2025 16:06
@coveralls
Copy link

coveralls commented Dec 10, 2025

Pull Request Test Coverage Report for Build 20128715106

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 12 of 44 (27.27%) changed or added relevant lines in 4 files are covered.
  • 13 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.2%) to 56.046%

Changes Missing Coverage Covered Lines Changed/Added Lines %
internal/bootstrap/bootstrap.go 0 1 0.0%
internal/functions/new/new.go 4 6 66.67%
internal/init/init.go 8 16 50.0%
cmd/init.go 0 21 0.0%
Files with Coverage Reduction New Missed Lines %
cmd/init.go 1 0.0%
internal/gen/keys/keys.go 5 12.9%
internal/init/init.go 7 78.9%
Totals Coverage Status
Change from base Build 20098526635: -0.2%
Covered Lines: 6813
Relevant Lines: 12156

💛 - Coveralls

@sweatybridge sweatybridge changed the title refactor(cli): replace IDE flags with interactive mode in init feat(cli): replace IDE flags with interactive mode in init Dec 12, 2025
@sweatybridge sweatybridge merged commit 585a758 into develop Dec 12, 2025
17 checks passed
@sweatybridge sweatybridge deleted the avallete/devwf-30-improving-cli-initialization-process-follow-up branch December 12, 2025 11:24
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.

4 participants