Skip to content

Commit 4e20ce8

Browse files
committed
feat!: change gobfile autostart default to false
Jobs now default to autostart=false, meaning they are created but not started when the TUI opens. Add autostart=true explicitly to jobs that should auto-start and auto-stop with the TUI lifecycle. This gives users manual control by default, which is safer for jobs that may have side effects or consume resources.
1 parent 9e2b7e6 commit 4e20ce8

File tree

3 files changed

+25
-17
lines changed

3 files changed

+25
-17
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
- **Version negotiation no longer auto-restarts daemon**: When client and daemon versions mismatch, the client now returns an error instead of auto-restarting the daemon. This prevents old TUIs from restarting the daemon with their old binary, undoing upgrades. Users must now run `gob shutdown` and restart their clients when upgrading.
1818
- **TUI quits on daemon disconnect**: The TUI no longer attempts to reconnect when the daemon stops. Instead, it quits with a message asking the user to restart. This complements the version negotiation change by preventing old TUIs from resurrecting the daemon.
1919
- **Daemon no longer auto-shuts down when idle**: The daemon now runs indefinitely until explicitly stopped with `gob shutdown`.
20+
- **BREAKING: Gobfile `autostart` now defaults to `false`**: Jobs in the gobfile no longer auto-start by default. Add `autostart = true` to jobs that should start when the TUI opens and stop when it exits. Jobs without `autostart` (or with `autostart = false`) are created but not started, giving you manual control over their lifecycle.
2021

2122
### Fixed
2223

2324
- **Runs panel column misalignment**: Fixed status column padding using byte length instead of visual width, causing misaligned columns when Unicode status icons (✓, ◉, ◼) were displayed.
2425
- **Gobfile descriptions not displayed**: Fixed job descriptions from gobfile not appearing in TUI when job already existed without a description.
25-
- **Gobfile auto-stop killing manually started jobs**: Jobs with `autostart = false` in the gobfile are no longer stopped when the TUI exits. Previously, if you defined a job with `autostart = false` and manually started it, it would be killed on TUI exit. Now only jobs with `autostart = true` (the default) are auto-stopped.
26+
- **Gobfile auto-stop killing manually started jobs**: Jobs with `autostart = false` in the gobfile are no longer stopped when the TUI exits. Previously, if you defined a job with `autostart = false` and manually started it, it would be killed on TUI exit. Now only jobs with `autostart = true` are auto-stopped.
2627

2728
## [3.0.0-rc.2] - 2026-01-25
2829

docs/gobfile.md

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,16 @@ A gobfile is a TOML configuration file that defines jobs for your project. When
1212
[[job]]
1313
command = "npm run dev"
1414
description = "Development server for the frontend app"
15+
autostart = true # Start when TUI opens, stop when TUI exits
1516

1617
[[job]]
1718
command = "npm run build:watch"
1819
description = "Watches TypeScript and rebuilds on change"
19-
autostart = false
20+
# autostart defaults to false - start manually, keeps running after TUI exits
2021

2122
[[job]]
2223
command = "docker compose up db"
23-
# description and autostart are optional
24+
# description is optional, autostart defaults to false
2425
```
2526

2627
## Fields
@@ -29,7 +30,7 @@ command = "docker compose up db"
2930
|-------|------|----------|---------|-------------|
3031
| `command` | string | Yes | - | The command to run |
3132
| `description` | string | No | - | Context about the job, shown in TUI and CLI |
32-
| `autostart` | boolean | No | `true` | Whether to auto-start when TUI opens and auto-stop when TUI exits |
33+
| `autostart` | boolean | No | `false` | Whether to auto-start when TUI opens and auto-stop when TUI exits |
3334

3435
## Behavior
3536

@@ -38,14 +39,13 @@ command = "docker compose up db"
3839
1. Gobfile is parsed from `.config/gobfile.toml`
3940
2. For each job in the file:
4041
- If a job with the same command exists and is running: update description if different
41-
- If a job with the same command exists and is stopped: restart it (if `autostart = true`)
42-
- If no matching job exists: create and start it (if `autostart = true`)
43-
- If `autostart = false`: create but don't start (shows as stopped)
42+
- If `autostart = true`: create and start the job (or restart if stopped)
43+
- If `autostart = false` (the default): create but don't start (shows as stopped)
4444
3. Jobs are started asynchronously (TUI doesn't wait for them)
4545

4646
### When TUI Exits
4747

48-
Jobs with `autostart = true` (the default) are stopped when the TUI exits:
48+
Jobs with `autostart = true` are stopped when the TUI exits:
4949
- Normal exit (pressing `q`)
5050
- Terminal close
5151
- SIGTERM/SIGINT signals
@@ -69,14 +69,17 @@ Define all services needed for local development:
6969
[[job]]
7070
command = "npm run dev"
7171
description = "Next.js dev server on port 3000"
72+
autostart = true
7273

7374
[[job]]
7475
command = "npm run api:dev"
7576
description = "API server on port 4000"
77+
autostart = true
7678

7779
[[job]]
7880
command = "docker compose up postgres redis"
7981
description = "Database and cache services"
82+
autostart = true
8083
```
8184

8285
### Build Watchers
@@ -87,11 +90,12 @@ Add watchers that rebuild on file changes:
8790
[[job]]
8891
command = "npm run typecheck:watch"
8992
description = "TypeScript type checking in watch mode"
93+
autostart = true # Always run type checking
9094

9195
[[job]]
9296
command = "npm run test:watch"
9397
description = "Jest tests in watch mode"
94-
autostart = false # Start manually, keeps running after TUI exits
98+
# autostart defaults to false - start manually when needed
9599
```
96100

97101
### AI Agent Context
@@ -102,15 +106,17 @@ Descriptions help AI agents understand what each job does:
102106
[[job]]
103107
command = "npm run dev"
104108
description = "Frontend dev server. Check this for UI errors. Runs on http://localhost:3000"
109+
autostart = true
105110

106111
[[job]]
107112
command = "npm run api"
108113
description = "Backend API. Check logs here for request/response debugging"
114+
autostart = true
109115

110116
[[job]]
111117
command = "npm run storybook"
112118
description = "Component library browser. Use for visual component testing"
113-
autostart = false
119+
# autostart defaults to false - start manually when needed
114120
```
115121

116122
When an AI agent runs `gob list`, it sees the descriptions and understands the purpose of each job.
@@ -155,14 +161,15 @@ echo ".config/gobfile.toml" >> .gitignore
155161

156162
### Jobs not starting
157163

158-
1. Check the file location: must be `.config/gobfile.toml` (not project root)
159-
2. Verify TOML syntax: use a TOML validator
160-
3. Check daemon logs: `$XDG_STATE_HOME/gob/daemon.log`
164+
1. Check `autostart = true` is set - jobs default to `autostart = false` (not auto-started)
165+
2. Check the file location: must be `.config/gobfile.toml` (not project root)
166+
3. Verify TOML syntax: use a TOML validator
167+
4. Check daemon logs: `$XDG_STATE_HOME/gob/daemon.log`
161168

162169
### Jobs restarting unexpectedly
163170

164171
Jobs are restarted if they were stopped and match a gobfile entry with `autostart = true`. To prevent this, either:
165-
- Set `autostart = false` for jobs you want to control manually
172+
- Remove `autostart = true` (jobs default to not auto-starting)
166173
- Remove the job from the gobfile
167174

168175
### Description not showing

internal/tui/gobfile.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ type GobfileConfig struct {
2222
type GobfileJob struct {
2323
Command string `toml:"command"`
2424
Description string `toml:"description"`
25-
Autostart *bool `toml:"autostart"` // nil defaults to true
25+
Autostart *bool `toml:"autostart"` // nil defaults to false
2626
}
2727

28-
// ShouldAutostart returns whether the job should be auto-started (defaults to true)
28+
// ShouldAutostart returns whether the job should be auto-started (defaults to false)
2929
func (j GobfileJob) ShouldAutostart() bool {
3030
if j.Autostart == nil {
31-
return true
31+
return false
3232
}
3333
return *j.Autostart
3434
}

0 commit comments

Comments
 (0)