Skip to content

Commit 669ca74

Browse files
committed
Revert "docs: improve custom commands spec clarity"
This reverts commit 3fdd29b.
1 parent 3fdd29b commit 669ca74

File tree

1 file changed

+9
-23
lines changed

1 file changed

+9
-23
lines changed

docs/spec/custom-commands.md

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,24 @@ Same variables as repository/worktree templates:
2929

3030
| Variable | Value |
3131
|---|---|
32-
| `{name}` | Branch name, or `HEAD` if detached |
33-
| `{branch}` | Full branch name (empty if detached HEAD) |
34-
| `{ref}` | Branch name or short commit hash (always non-empty) |
32+
| `{name}` | Worktree folder name |
33+
| `{branch}` | Git branch (empty if detached HEAD) |
34+
| `{ref}` | Branch or short commit hash (always non-empty) |
3535
| `{head}` | Short commit hash (8 chars) |
36-
| `{path}` | Absolute worktree directory path |
36+
| `{path}` | Filesystem path |
3737

3838
### Workspace items (`customCommands.workspace`)
3939

4040
Same variables as worktree workspace templates, plus `{dir}`:
4141

4242
| Variable | Value |
4343
|---|---|
44-
| `{name}` | File name (without `.code-workspace` extension) |
44+
| `{name}` | File name (without `.code-workspace`) |
4545
| `{branch}` | Parent worktree branch (empty if detached HEAD) |
46-
| `{ref}` | Branch name or short commit hash (always non-empty) |
46+
| `{ref}` | Branch or short commit hash (always non-empty) |
4747
| `{head}` | Short commit hash (8 chars) |
48-
| `{path}` | Absolute workspace file path |
49-
| `{dir}` | Absolute parent directory of workspace file |
48+
| `{path}` | Workspace file path |
49+
| `{dir}` | Parent directory of workspace file path |
5050
| `{worktree}` | Parent worktree folder name |
5151

5252
Template syntax (fallback, conditional) is the same as display templates. See [templates.md](../../docs/templates.md) for syntax reference.
@@ -107,7 +107,7 @@ Same logic as Open in Terminal (see [open-in-terminal.md](open-in-terminal.md)):
107107

108108
- **Spawn failure** (synchronous): try/catch around `spawn()` — shows error via `showErrorMessage`
109109
- **Process error** (asynchronous): `child.on("error")` — shows error with "Show Logs" action
110-
- **Settings validation**: Invalid entries are skipped with a log message. Checks: `label` must be a non-empty string, `command` must be a non-empty string array, and `env` values (if present) must all be strings
110+
- **Settings validation**: Invalid entries (missing `label`, empty `command`) are skipped with a log message
111111
- **Template rendering**: Uses the same `renderTemplate` function as display templates — unknown variables remain as-is
112112

113113
## Examples
@@ -175,20 +175,6 @@ Common terminal emulators:
175175
}
176176
```
177177

178-
### Using environment variables
179-
180-
```json
181-
{
182-
"git-work-grove.customCommands.directory": [
183-
{
184-
"command": ["open", "-a", "Ghostty", "--args", "--working-directory={path}"],
185-
"env": { "GHOSTTY_TITLE": "{ref}" },
186-
"label": "Open in Ghostty"
187-
}
188-
]
189-
}
190-
```
191-
192178
### Multiple commands
193179

194180
```json

0 commit comments

Comments
 (0)