Skip to content
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

Add supabase studio command #2945

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Add supabase studio command #2945

wants to merge 3 commits into from

Conversation

jsj
Copy link

@jsj jsj commented Dec 4, 2024

What kind of change does this PR introduce?

Feature - Adds a new CLI command supabase studio to open Supabase Studio directly from the terminal

What is the current behavior?

Currently, users need to manually open their browser and navigate to the Supabase Studio dashboard.

What is the new behavior?

This PR adds a new studio command that automatically opens the Supabase Studio dashboard in the user's default browser. The command:

  • Works cross-platform (macOS, Windows, and Linux)
  • Uses the appropriate system command to open the browser (open for macOS, start for Windows, xdg-open for Linux)
  • Provides feedback to the user by displaying the URL being opened
  • Handles errors gracefully with descriptive error messages

Example usage:

supabase studio

@coveralls
Copy link

coveralls commented Dec 4, 2024

Pull Request Test Coverage Report for Build 12833178237

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 7 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.02%) to 58.367%

Files with Coverage Reduction New Missed Lines %
internal/storage/rm/rm.go 2 89.53%
internal/gen/keys/keys.go 5 12.9%
Totals Coverage Status
Change from base Build 12825243990: -0.02%
Covered Lines: 7590
Relevant Lines: 13004

💛 - Coveralls

cmd/studio.go Outdated
Use: "studio",
Short: "Opens Supabase Studio in your browser",
RunE: func(cmd *cobra.Command, args []string) error {
url := utils.GetSupabaseDashboardURL()
Copy link
Contributor

Choose a reason for hiding this comment

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

This opens the hosted dashboard and not local studio. Is that your intention?

It might be a good idea to support --local and --linked flag to distinguish these use cases.

Copy link
Author

Choose a reason for hiding this comment

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

Yeah this was wrong the goal is to open the local studio url, this comes from using Windsurf, Cursor it will hallucinate this command to go adjust settings only available in the Studio

cmd/studio.go Show resolved Hide resolved
@jsj jsj requested a review from a team as a code owner January 17, 2025 16:33
@jsj jsj requested a review from sweatybridge January 17, 2025 16:55
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.

3 participants