• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / cli / 21474811322

29 Jan 2026 10:34AM UTC coverage: 49.822% (-6.4%) from 56.176%
21474811322

Pull #4770

github

web-flow
Merge 46bfe9ba6 into 230667a9f
Pull Request #4770: feat: add `supabase dev` command

12 of 1573 new or added lines in 18 files covered. (0.76%)

7 existing lines in 2 files now uncovered.

6860 of 13769 relevant lines covered (49.82%)

5.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/cmd/dev.go
1
package cmd
2

3
import (
4
        "os"
5

6
        "github.com/spf13/afero"
7
        "github.com/spf13/cobra"
8
        "github.com/supabase/cli/internal/dev"
9
        "golang.org/x/term"
10
)
11

12
var skipOnboarding bool
13

14
var devCmd = &cobra.Command{
15
        GroupID: groupLocalDev,
16
        Use:     "dev",
17
        Short:   "Start reactive development mode with multiple workflows",
18
        Long: `Start a development session that watches for file changes and
19
automatically applies them to your local environment.
20

21
If no Supabase project exists, dev will guide you through setup:
22
  1. Initialize config.toml if missing
23
  2. Optionally link to a remote Supabase project
24
  3. Pull schema/functions from remote if linked
25
  4. Start local development environment
26

27
Use --skip-onboarding to bypass the setup wizard.
28

29
WORKFLOWS:
30

31
  schemas   Watch schema files and auto-apply changes to local database
32
            Configure via [dev.schemas] in config.toml
33

34
  seed      Auto-run seeds on startup and when seed files change
35
            Configure via [dev.seed] in config.toml
36

37
  functions (coming soon) Watch and auto-deploy edge functions
38

39
The dev command starts the local database if not running, then enables
40
all configured workflows. Schema changes are applied directly without
41
creating migration files - use 'supabase db diff -f' when ready to commit.
42

43
CONFIGURATION:
44

45
  [dev.schemas]
46
  enabled = true                    # Enable schema workflow (default: true)
47
  watch = ["schemas/**/*.sql"]      # Glob patterns to watch
48
  on_change = ""                    # Custom command (e.g., "npx drizzle-kit push")
49
  types = "src/types/database.ts"   # Auto-generate TypeScript types
50

51
  [dev.seed]
52
  enabled = true                    # Enable seed workflow (default: true)
53
  on_change = ""                    # Custom command (e.g., "npx prisma db seed")
54

55
DEBUG LOGGING:
56

57
  DEBUG=supabase:dev:*        All dev logs
58
  DEBUG=supabase:dev:timing   Timing information
59
  DEBUG=supabase:dev:watcher  File watcher logs
60
  DEBUG=supabase:dev:sql      SQL statements being executed
61

62
Press Ctrl+C to stop the development session.`,
NEW
63
        RunE: func(cmd *cobra.Command, args []string) error {
×
NEW
64
                opts := dev.RunOptions{
×
NEW
65
                        SkipOnboarding: skipOnboarding,
×
NEW
66
                        Interactive:    term.IsTerminal(int(os.Stdin.Fd())),
×
NEW
67
                }
×
NEW
68
                return dev.Run(cmd.Context(), afero.NewOsFs(), opts)
×
NEW
69
        },
×
70
}
71

NEW
72
func init() {
×
NEW
73
        devCmd.Flags().BoolVar(&skipOnboarding, "skip-onboarding", false, "Skip the interactive setup wizard")
×
NEW
74
        rootCmd.AddCommand(devCmd)
×
NEW
75
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc