Skip to content

Add Supabase plugin for status line#30

Open
himattm wants to merge 4 commits intomainfrom
claude/supabase-prism-plugin-ideas-amRrf
Open

Add Supabase plugin for status line#30
himattm wants to merge 4 commits intomainfrom
claude/supabase-prism-plugin-ideas-amRrf

Conversation

@himattm
Copy link
Owner

@himattm himattm commented Mar 16, 2026

Shows local dev stack status (⚡ green=running, gray=stopped) and
pending migration count (↑N) when idle. Auto-detects Supabase projects
via supabase/config.toml. Configurable show_migrations and
show_when_stopped options.

https://claude.ai/code/session_01GC6HCBL4rVMGeffPXFQWin

claude added 4 commits March 16, 2026 20:45
Shows local dev stack status (⚡ green=running, gray=stopped) and
pending migration count (↑N) when idle. Auto-detects Supabase projects
via supabase/config.toml. Configurable show_migrations and
show_when_stopped options.

https://claude.ai/code/session_01GC6HCBL4rVMGeffPXFQWin
- Add SupabaseGreen color (#3ECF8E) using 24-bit true color
- Use supabase_green instead of emerald for the ⚡ icon
- Add supabase to default second line alongside spotify

https://claude.ai/code/session_01GC6HCBL4rVMGeffPXFQWin
Line 1 is the agent harness (dir, model, context, usage, git),
line 2 is project tooling (supabase, vercel, android, etc),
line 3 is auxiliary ambient info (spotify, etc).

https://claude.ai/code/session_01GC6HCBL4rVMGeffPXFQWin
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a new Supabase plugin designed to enhance the status line by providing real-time insights into local Supabase development environments. It aims to improve developer productivity by making the status of the local stack and pending migrations immediately visible, allowing for quicker identification of issues or pending tasks without manual checks.

Highlights

  • New Supabase Plugin: Introduced a new plugin to display the status of local Supabase development stacks and pending database migrations in the status line.
  • Visual Status Indicators: Implemented visual cues (⚡ green for running, gray for stopped) to quickly convey the state of Supabase services.
  • Migration Count Display: Added functionality to show the number of pending database migrations (e.g., ↑N) when the stack is running.
  • Automatic Project Detection: Enabled automatic detection of Supabase projects by checking for the presence of supabase/config.toml.
  • Configurable Options: Provided configuration options to control whether migrations are shown (show_migrations) and if the status is displayed when the stack is stopped (show_when_stopped).
  • Performance Optimization: Integrated caching mechanisms for Supabase project detection, output, and migration counts to improve performance and ensure data freshness, especially when idle.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • internal/cache/cache.go
    • Added SupabaseTTL constant to manage caching duration for Supabase plugin data.
  • internal/colors/colors.go
    • Introduced SupabaseGreen color constant for Supabase branding.
    • Registered SupabaseGreen in the ColorMap for use in the plugin.
  • internal/config/config.go
    • Updated DefaultSectionLines to include the new "supabase" plugin in the default status line configuration.
  • internal/plugins/interface.go
    • Registered the new SupabasePlugin with the central plugin registry.
  • internal/plugins/supabase.go
    • Created a new file implementing the core logic for the SupabasePlugin, including methods for status checks, migration counting, project detection, and caching.
  • internal/plugins/supabase_test.go
    • Added a new file containing comprehensive unit tests for the SupabasePlugin, covering its functionality, configuration parsing, and cache invalidation logic.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new Supabase plugin to display local development stack status and pending migrations in the status line. The implementation is well-structured, with good use of caching to optimize performance and thoughtful integration into the existing plugin framework. The changes also include necessary additions to colors, configuration defaults, and plugin registration. I have one high-severity suggestion for internal/plugins/supabase.go to improve the robustness and testability of the logic that checks the Supabase stack status. The accompanying tests are comprehensive for the parts of the code that don't rely on external command execution.

Comment on lines +144 to +158
// checkLocalStatus runs `supabase status --output json` to determine if the local stack is running
func (p *SupabasePlugin) checkLocalStatus(ctx context.Context, supabasePath, projectDir string) bool {
cmd := exec.CommandContext(ctx, supabasePath, "status", "--output", "json")
cmd.Dir = projectDir
var out bytes.Buffer
cmd.Stdout = &out
cmd.Stderr = &bytes.Buffer{}

if err := cmd.Run(); err != nil {
return false
}

// If the command succeeds and produces output, the stack is running
return out.Len() > 0
}

Choose a reason for hiding this comment

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

high

The current implementation of checkLocalStatus has two areas for improvement:

  1. Robustness: Checking out.Len() > 0 is not a reliable way to determine if the service is running, especially when requesting JSON output. The supabase CLI might return null or an empty JSON object ({}) when stopped, both of which have a length greater than 0 and would lead to an incorrect status.
  2. Testability: The function mixes command execution with output parsing, making it difficult to unit test.

I recommend refactoring this to separate the parsing logic into its own function, similar to the pattern you've used for countPendingMigrations and parseMigrationOutput. This would allow you to add unit tests for the parsing logic to cover various outputs from the supabase CLI (e.g., empty string, null, valid JSON) and make the status detection more resilient.

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