You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add post-create hooks and config editor (v0.3.0)
- Add post-create hooks to run commands after creating worktrees (e.g., npm install)
- Add config editor (press 'c') to edit hooks from the TUI
- Add first-time setup prompt when no config exists
- Stream hook output to TUI in real-time
- Handle hook failures with option to continue or cancel
- Add .opencode-worktree.json config file support
- Update keybindings and documentation
3. Press `d` again to confirm and choose unlink/delete action
56
58
4. Press `Esc` to cancel and return to normal mode
57
59
60
+
## Configuration
61
+
62
+
You can configure per-repository settings by creating a `.opencode-worktree.json` file in your repository root.
63
+
64
+
### First-time setup
65
+
66
+
When you first run `opencode-worktree` in a repository without a configuration file, you'll be prompted to configure a post-create hook. You can also skip this step and configure it later by pressing `c`.
67
+
68
+
### Editing configuration
69
+
70
+
Press `c` at any time to edit your configuration. Currently, this allows you to set or modify the post-create hook command.
71
+
72
+
### Post-create hooks
73
+
74
+
Run a command automatically after creating a new worktree. Useful for installing dependencies.
75
+
76
+
```json
77
+
{
78
+
"postCreateHook": "npm install"
79
+
}
80
+
```
81
+
82
+
The hook output is streamed to the TUI in real-time. If the hook fails, you can choose to open opencode anyway or cancel.
83
+
84
+
**Examples:**
85
+
86
+
```json
87
+
{
88
+
"postCreateHook": "bun install"
89
+
}
90
+
```
91
+
92
+
```json
93
+
{
94
+
"postCreateHook": "npm install && npm run setup"
95
+
}
96
+
```
97
+
58
98
## Update notifications
59
99
60
100
When a new version is published to npm, the CLI will show a non-intrusive update message on the next run.
0 commit comments