native-shortcuts-herd 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +160 -92
- package/dist/cli.js +31 -10
- package/dist/cli.js.map +1 -1
- package/dist/installer.js +15 -5
- package/dist/installer.js.map +1 -1
- package/dist/state.d.ts +1 -0
- package/dist/state.js +4 -1
- package/dist/state.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,29 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
make ghostty navigation feel like a real macos app.
|
|
4
4
|
|
|
5
|
-
ghostty is fast,
|
|
5
|
+
ghostty is fast, native, and powerful. herdr gives you workspaces, tabs, panes, and direct indexed jumps. the missing piece is the hand feel: `cmd+t`, `cmd+w`, `cmd+1..9`, `ctrl+tab`, and chrome-style tab cycling should work without thinking about terminal escape sequences.
|
|
6
6
|
|
|
7
|
-
`native-shortcuts-herd`
|
|
7
|
+
`native-shortcuts-herd` wires ghostty and herdr together with a safe, reusable installer so terminal navigation feels familiar for macos users coming from chrome, safari, arc, iterm, warp, or cmux-style workflows.
|
|
8
8
|
|
|
9
|
-
<video src="
|
|
9
|
+
<video src="https://raw.githubusercontent.com/yigitkonur/native-shortcuts-herd/main/docs/assets/native-shortcuts-herd-demo.mp4" controls width="100%"></video>
|
|
10
10
|
|
|
11
|
-
> demo
|
|
11
|
+
> demo: `docs/assets/native-shortcuts-herd-demo.mp4`
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## quick start
|
|
14
|
+
|
|
15
|
+
guided setup:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
npx native-shortcuts-herd@latest install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
fully scripted setup:
|
|
14
22
|
|
|
15
23
|
```sh
|
|
16
|
-
npx native-shortcuts-herd install
|
|
24
|
+
npx native-shortcuts-herd@latest install --yes --install-herdr --glass-theme
|
|
17
25
|
```
|
|
18
26
|
|
|
19
|
-
|
|
27
|
+
fully scripted uninstall:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
npx native-shortcuts-herd@latest uninstall --yes
|
|
31
|
+
```
|
|
20
32
|
|
|
21
|
-
|
|
33
|
+
same uninstall through the installer entrypoint:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
npx native-shortcuts-herd@latest install --uninstall --yes
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
the installer is intentionally reusable. run it again to change profiles, retarget `cmd+1..9`, repair config drift, update the glass preset, or remove every managed change.
|
|
22
40
|
|
|
23
41
|
## why this exists
|
|
24
42
|
|
|
25
|
-
terminal power users
|
|
43
|
+
terminal power users can always hand-roll keymaps. the problem is that terminals, multiplexers, and tui apps disagree on what a tab, space, workspace, split, pane, or session should mean.
|
|
26
44
|
|
|
27
|
-
macos users expect this:
|
|
45
|
+
macos users expect this kind of muscle memory:
|
|
28
46
|
|
|
29
47
|
| habit | expected feel |
|
|
30
48
|
|---|---|
|
|
@@ -35,175 +53,225 @@ macos users expect this:
|
|
|
35
53
|
| `ctrl+tab` | cycle through the main contexts |
|
|
36
54
|
| `ctrl+option+tab` | cycle through the secondary contexts |
|
|
37
55
|
|
|
38
|
-
ghostty already has excellent keybinding support. herdr already has
|
|
56
|
+
ghostty already has excellent keybinding support. herdr already has the right model. this package connects them without taking over your whole config.
|
|
39
57
|
|
|
40
|
-
## what
|
|
58
|
+
## what gets changed
|
|
41
59
|
|
|
42
60
|
| system | change |
|
|
43
61
|
|---|---|
|
|
44
|
-
| ghostty | adds one managed `config-file` include to
|
|
45
|
-
| ghostty sidecar | writes
|
|
62
|
+
| ghostty | adds one managed `config-file` include to each detected ghostty/cmux config |
|
|
63
|
+
| ghostty sidecar | writes owned key routes to `~/.config/native-shortcuts-herd/ghostty.conf` |
|
|
46
64
|
| optional glass preset | adds a purple catppuccin + macos liquid-glass visual layer when you opt in |
|
|
47
65
|
| herdr | updates `[keys]`, `[keys.indexed]`, and `ui.prompt_new_tab_name` |
|
|
48
|
-
| herdr installer |
|
|
49
|
-
| state | stores
|
|
66
|
+
| herdr installer | can install or update herdr into `~/.local/bin/herdr` when missing or below `0.5.10` |
|
|
67
|
+
| state | stores previous herdr values in `~/.config/native-shortcuts-herd/state.json` |
|
|
50
68
|
| backups | creates timestamped backups before writing |
|
|
51
|
-
|
|
|
69
|
+
| uninstall | removes the ghostty include/sidecar, restores tracked herdr values, and clears managed state |
|
|
52
70
|
|
|
53
71
|
## keybindings
|
|
54
72
|
|
|
55
|
-
the
|
|
73
|
+
the default profile is `chrome-spaces`: command keys target herdr workspaces/spaces, while `ctrl+option+tab` cycles herdr tabs. every ambiguous family can be changed.
|
|
56
74
|
|
|
57
|
-
| shortcut | default
|
|
75
|
+
| shortcut | default behavior | configurable |
|
|
58
76
|
|---|---|---|
|
|
59
77
|
| `cmd+t` | new herdr tab | yes |
|
|
60
78
|
| `cmd+n` | new herdr workspace / space | yes |
|
|
61
79
|
| `cmd+w` | close active herdr tab | yes |
|
|
62
80
|
| `cmd+k` | rename active herdr workspace | yes |
|
|
63
81
|
| `cmd+l` | rename active herdr tab | yes |
|
|
64
|
-
| `cmd+1..9` |
|
|
65
|
-
| `ctrl+tab` |
|
|
66
|
-
| `ctrl+shift+tab` | previous
|
|
67
|
-
| `ctrl+option+tab` |
|
|
68
|
-
| `ctrl+option+shift+tab` | previous
|
|
82
|
+
| `cmd+1..9` | jump to herdr workspace 1-9 | yes: spaces, tabs, off |
|
|
83
|
+
| `ctrl+tab` | next herdr workspace | yes: spaces, tabs, off |
|
|
84
|
+
| `ctrl+shift+tab` | previous herdr workspace | yes: spaces, tabs, off |
|
|
85
|
+
| `ctrl+option+tab` | next herdr tab | yes: tabs, spaces, off |
|
|
86
|
+
| `ctrl+option+shift+tab` | previous herdr tab | yes: tabs, spaces, off |
|
|
69
87
|
|
|
70
88
|
## ghostty behavior mappings
|
|
71
89
|
|
|
72
|
-
ghostty receives macos
|
|
90
|
+
ghostty receives macos shortcuts first. this package routes those keys into sequences herdr understands.
|
|
73
91
|
|
|
74
|
-
| ghostty trigger | managed action | herdr receives |
|
|
92
|
+
| ghostty trigger | managed ghostty action | herdr receives |
|
|
75
93
|
|---|---|---|
|
|
76
|
-
| `cmd+
|
|
77
|
-
| `cmd+
|
|
78
|
-
| `cmd+
|
|
79
|
-
| `cmd+
|
|
80
|
-
| `cmd+
|
|
94
|
+
| `cmd+KeyT` | `text:\x02t` | prefix + `t` |
|
|
95
|
+
| `cmd+KeyN` | `text:\x02n` | prefix + `n` |
|
|
96
|
+
| `cmd+KeyW` | `text:\x02W` | prefix + `shift+w` |
|
|
97
|
+
| `cmd+KeyK` | `text:\x02N` | prefix + `shift+n` |
|
|
98
|
+
| `cmd+KeyL` | `text:\x02T` | prefix + `shift+t` |
|
|
81
99
|
| `ctrl+tab` | `text:\x1b[9;5u` | enhanced `ctrl+tab` |
|
|
82
100
|
| `ctrl+shift+tab` | `text:\x1b[9;6u` | enhanced `ctrl+shift+tab` |
|
|
83
101
|
| `ctrl+option+tab` | `text:\x1b[9;7u` | enhanced `ctrl+alt+tab` |
|
|
102
|
+
| `ctrl+option+shift+tab` | `text:\x1b[9;8u` | enhanced `ctrl+alt+shift+tab` |
|
|
84
103
|
| `cmd+1..9` | generated per profile | indexed herdr jump |
|
|
85
104
|
|
|
86
|
-
for macos menu conflicts
|
|
87
|
-
|
|
88
|
-
## purple glass preset
|
|
89
|
-
|
|
90
|
-
the wizard can optionally add a visual preset inspired by a polished macos ghostty setup: catppuccin mocha colors, display-p3/native blending, transparent titlebar, `macos-glass-regular`, subtle split dimming, and retina-friendly jetbrains mono thickening.
|
|
91
|
-
|
|
92
|
-
| setting family | managed values |
|
|
93
|
-
|---|---|
|
|
94
|
-
| color | `theme = Catppuccin Mocha`, purple mocha background, matching cursor and selection |
|
|
95
|
-
| glass | `background-opacity = 0.85`, `background-blur = macos-glass-regular`, transparent titlebar |
|
|
96
|
-
| rendering | `window-colorspace = display-p3`, `alpha-blending = native`, `window-vsync = true` |
|
|
97
|
-
| typography | `JetBrains Mono`, 16pt, ligatures, light macos thickening |
|
|
98
|
-
| layout | 16x12 padding, balanced padding, dimmed unfocused splits |
|
|
99
|
-
|
|
100
|
-
it is opt-in. use the wizard prompt, `--glass-theme`, or `--no-glass-theme`.
|
|
105
|
+
for macos menu conflicts such as `cmd+w`, ghostty gets a physical-key route plus a normal `cmd+w=unbind`. that lets herdr receive the intended action instead of ghostty closing the whole window.
|
|
101
106
|
|
|
102
107
|
## herdr integration
|
|
103
108
|
|
|
104
|
-
herdr
|
|
109
|
+
herdr `0.5.10+` added the clean pieces this project uses: indexed keybind families and instant generated tab names.
|
|
105
110
|
|
|
106
111
|
| herdr config | purpose |
|
|
107
112
|
|---|---|
|
|
113
|
+
| `[keys].prefix` | keeps the herdr prefix at `ctrl+b` |
|
|
108
114
|
| `[keys].new_workspace` | target for `cmd+n` |
|
|
115
|
+
| `[keys].rename_workspace` | target for `cmd+k` |
|
|
109
116
|
| `[keys].new_tab` | target for `cmd+t` |
|
|
117
|
+
| `[keys].rename_tab` | target for `cmd+l` |
|
|
110
118
|
| `[keys].close_tab` | target for `cmd+w` |
|
|
111
|
-
| `[keys].previous_workspace` / `next_workspace` | direct
|
|
112
|
-
| `[keys].previous_tab` / `next_tab` | direct tab
|
|
119
|
+
| `[keys].previous_workspace` / `next_workspace` | direct workspace cycling |
|
|
120
|
+
| `[keys].previous_tab` / `next_tab` | direct tab cycling |
|
|
113
121
|
| `[keys.indexed].workspaces` | direct workspace jumps 1-9 |
|
|
114
122
|
| `[keys.indexed].tabs` | direct tab jumps 1-9 |
|
|
115
|
-
| `[ui].prompt_new_tab_name` |
|
|
123
|
+
| `[ui].prompt_new_tab_name` | defaults to `false` for instant tab creation |
|
|
116
124
|
|
|
117
|
-
## install
|
|
125
|
+
## install behavior
|
|
118
126
|
|
|
119
127
|
| command | use it when |
|
|
120
128
|
|---|---|
|
|
121
|
-
| `npx native-shortcuts-herd install` | guided
|
|
122
|
-
| `npx native-shortcuts-herd
|
|
123
|
-
| `npx native-shortcuts-herd
|
|
124
|
-
| `npx native-shortcuts-herd
|
|
125
|
-
| `npx native-shortcuts-herd
|
|
126
|
-
| `npx native-shortcuts-herd
|
|
127
|
-
| `npx native-shortcuts-herd
|
|
128
|
-
| `npx native-shortcuts-herd
|
|
129
|
+
| `npx native-shortcuts-herd@latest install` | guided first run |
|
|
130
|
+
| `npx native-shortcuts-herd@latest install --yes` | non-interactive install with safe defaults |
|
|
131
|
+
| `npx native-shortcuts-herd@latest install --yes --install-herdr` | non-interactive install and install/update herdr if needed |
|
|
132
|
+
| `npx native-shortcuts-herd@latest install --yes --no-install-herdr` | non-interactive install without downloading herdr |
|
|
133
|
+
| `npx native-shortcuts-herd@latest install --yes --glass-theme` | install shortcuts plus the glass preset |
|
|
134
|
+
| `npx native-shortcuts-herd@latest install --uninstall --yes` | uninstall through the install command |
|
|
135
|
+
| `npx native-shortcuts-herd@latest uninstall --yes` | remove managed changes without prompts |
|
|
136
|
+
| `npx native-shortcuts-herd@latest uninstall --dry-run --json` | machine-readable uninstall preview |
|
|
137
|
+
| `npx native-shortcuts-herd@latest apply --profile chrome-tabs --yes` | repeatable profile application |
|
|
138
|
+
| `npx native-shortcuts-herd@latest diff --profile chrome-spaces` | inspect planned writes |
|
|
139
|
+
| `npx native-shortcuts-herd@latest doctor --json` | inspect ghostty, herdr, and state |
|
|
140
|
+
| `npx native-shortcuts-herd@latest generate-installer` | print a tiny shell installer |
|
|
141
|
+
|
|
142
|
+
## herdr install options
|
|
143
|
+
|
|
144
|
+
| flag | behavior |
|
|
145
|
+
|---|---|
|
|
146
|
+
| no flag in guided mode | prompt to install/update herdr when needed |
|
|
147
|
+
| `--yes` | allow herdr install/update without prompts |
|
|
148
|
+
| `--install-herdr` | explicitly install/update herdr when needed |
|
|
149
|
+
| `--no-install-herdr` | never download herdr |
|
|
150
|
+
| `--skip-herdr-install` | legacy spelling for not offering automatic install/update |
|
|
151
|
+
| `--skip-herdr` | do not write herdr config at all |
|
|
129
152
|
|
|
130
|
-
|
|
153
|
+
automatic herdr install downloads the latest matching release asset from `ogulcancelik/herdr` into `~/.local/bin/herdr`. if the release asset exposes a sha256 digest, the binary is verified before it is written.
|
|
131
154
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
|
135
|
-
|
|
136
|
-
|
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
| custom keymaps | supported | use profile choices and `--ghostty-key` / `--herdr-key` |
|
|
140
|
-
| linux ghostty | best effort | key routing may vary by desktop environment |
|
|
141
|
-
| windows | not supported | ghostty/herdr target here is macos-first |
|
|
155
|
+
## profiles
|
|
156
|
+
|
|
157
|
+
| profile | `cmd+1..9` | `ctrl+tab` | `ctrl+option+tab` | best for |
|
|
158
|
+
|---|---|---|---|---|
|
|
159
|
+
| `chrome-spaces` | workspaces | workspaces | tabs | cmux-like spaces with browser-ish secondary tab cycling |
|
|
160
|
+
| `chrome-tabs` | tabs | tabs | workspaces | literal chrome tab muscle memory |
|
|
161
|
+
| `minimal` | off | workspaces | tabs | keep core shortcuts, skip indexed jumps |
|
|
142
162
|
|
|
143
|
-
##
|
|
163
|
+
## customization
|
|
144
164
|
|
|
145
|
-
|
|
165
|
+
change the target families:
|
|
146
166
|
|
|
147
167
|
```sh
|
|
148
|
-
npx native-shortcuts-herd apply
|
|
168
|
+
npx native-shortcuts-herd@latest apply \
|
|
169
|
+
--cmd-numbers tabs \
|
|
170
|
+
--ctrl-tab tabs \
|
|
171
|
+
--ctrl-opt-tab workspaces \
|
|
172
|
+
--yes
|
|
149
173
|
```
|
|
150
174
|
|
|
151
|
-
|
|
175
|
+
turn off indexed jumps:
|
|
152
176
|
|
|
153
177
|
```sh
|
|
154
|
-
npx native-shortcuts-herd apply
|
|
178
|
+
npx native-shortcuts-herd@latest apply \
|
|
179
|
+
--cmd-numbers off \
|
|
180
|
+
--ctrl-tab workspaces \
|
|
181
|
+
--ctrl-opt-tab tabs \
|
|
182
|
+
--yes
|
|
155
183
|
```
|
|
156
184
|
|
|
157
|
-
|
|
185
|
+
add a ghostty route:
|
|
158
186
|
|
|
159
187
|
```sh
|
|
160
|
-
npx native-shortcuts-herd apply
|
|
188
|
+
npx native-shortcuts-herd@latest apply \
|
|
189
|
+
--ghostty-key 'cmd+slash=text:\x02?' \
|
|
190
|
+
--yes
|
|
161
191
|
```
|
|
162
192
|
|
|
163
|
-
add a
|
|
193
|
+
add a herdr action:
|
|
164
194
|
|
|
165
195
|
```sh
|
|
166
|
-
npx native-shortcuts-herd apply
|
|
196
|
+
npx native-shortcuts-herd@latest apply \
|
|
197
|
+
--herdr-key reload_config=shift+r \
|
|
198
|
+
--yes
|
|
167
199
|
```
|
|
168
200
|
|
|
169
|
-
patch
|
|
201
|
+
patch one config explicitly:
|
|
170
202
|
|
|
171
203
|
```sh
|
|
172
|
-
npx native-shortcuts-herd apply
|
|
204
|
+
npx native-shortcuts-herd@latest apply \
|
|
205
|
+
--ghostty-config ~/.config/ghostty/config \
|
|
206
|
+
--yes
|
|
173
207
|
```
|
|
174
208
|
|
|
175
|
-
|
|
209
|
+
## purple glass preset
|
|
176
210
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
211
|
+
the glass preset is opt-in. it gives ghostty a richer macos look without making it the default behavior.
|
|
212
|
+
|
|
213
|
+
| setting family | managed values |
|
|
214
|
+
|---|---|
|
|
215
|
+
| color | `theme = Catppuccin Mocha`, purple mocha background, matching cursor and selection |
|
|
216
|
+
| glass | `background-opacity = 0.85`, `background-blur = macos-glass-regular`, transparent titlebar |
|
|
217
|
+
| rendering | `window-colorspace = display-p3`, `alpha-blending = native`, `window-vsync = true` |
|
|
218
|
+
| typography | `JetBrains Mono`, 16pt, ligatures, light macos thickening |
|
|
219
|
+
| layout | 16x12 padding, balanced padding, dimmed unfocused splits |
|
|
180
220
|
|
|
181
|
-
|
|
221
|
+
apply it:
|
|
182
222
|
|
|
183
223
|
```sh
|
|
184
|
-
npx native-shortcuts-herd
|
|
224
|
+
npx native-shortcuts-herd@latest apply --glass-theme --yes
|
|
185
225
|
```
|
|
186
226
|
|
|
187
|
-
|
|
227
|
+
remove only the package-managed include and state:
|
|
188
228
|
|
|
189
229
|
```sh
|
|
190
|
-
npx native-shortcuts-herd
|
|
230
|
+
npx native-shortcuts-herd@latest uninstall --yes
|
|
191
231
|
```
|
|
192
232
|
|
|
233
|
+
## supported workflows
|
|
234
|
+
|
|
235
|
+
| workflow | status | notes |
|
|
236
|
+
|---|---|---|
|
|
237
|
+
| ghostty on macos | supported | primary target |
|
|
238
|
+
| cmux ghostty config | supported | detected when the config file exists |
|
|
239
|
+
| herdr `0.5.10+` | supported | required for indexed jumps |
|
|
240
|
+
| re-running installer | supported | updates managed files idempotently |
|
|
241
|
+
| uninstall/reinstall | supported | uses saved state, best-effort cleanup, and clears managed state |
|
|
242
|
+
| scripted automation | supported | use `--yes`, `--install-herdr`, `--no-install-herdr`, `--uninstall`, and `--json` |
|
|
243
|
+
| custom keymaps | supported | use profile choices and `--ghostty-key` / `--herdr-key` |
|
|
244
|
+
| linux ghostty | best effort | key routing and global shortcuts vary by desktop environment |
|
|
245
|
+
| windows | not supported | this project is macos-first |
|
|
246
|
+
|
|
193
247
|
## safety model
|
|
194
248
|
|
|
195
249
|
this package is intentionally boring about file writes.
|
|
196
250
|
|
|
197
251
|
| safety feature | behavior |
|
|
198
252
|
|---|---|
|
|
199
|
-
| sidecar include | ghostty gets one include; owned
|
|
253
|
+
| sidecar include | ghostty gets one include; owned lines live in a separate file |
|
|
200
254
|
| backups | files are copied before writes |
|
|
201
|
-
| state file | previous herdr values are tracked for
|
|
202
|
-
| dry run | `diff` and `--dry-run`
|
|
255
|
+
| state file | previous herdr values are tracked for uninstall |
|
|
256
|
+
| dry run | `diff` and `--dry-run` preview planned changes |
|
|
257
|
+
| json output | `--json` writes machine-readable output to stdout |
|
|
203
258
|
| validation | ghostty config validation runs when the binary is available |
|
|
204
259
|
| reload | herdr reload is attempted when a server is running |
|
|
205
260
|
| no secret handling | npm/github tokens are never written into config |
|
|
206
261
|
|
|
262
|
+
uninstall only removes package-owned config. it does not delete manually written ghostty keybinds, custom shaders, or theme settings that already live in your main config files.
|
|
263
|
+
|
|
264
|
+
## troubleshooting
|
|
265
|
+
|
|
266
|
+
| symptom | check |
|
|
267
|
+
|---|---|
|
|
268
|
+
| ghostty still uses the old keymap | run `cmd+shift+,` in ghostty or restart ghostty |
|
|
269
|
+
| herdr shortcuts do not react | run `herdr --version` and make sure it is `0.5.10+` |
|
|
270
|
+
| `cmd+w` closes the window | run `native-shortcuts-herd doctor --json` and confirm the ghostty sidecar exists |
|
|
271
|
+
| install should not download herdr | use `--no-install-herdr` |
|
|
272
|
+
| automation needs stable output | add `--json` |
|
|
273
|
+
| you want to inspect first | run `diff` or add `--dry-run` |
|
|
274
|
+
|
|
207
275
|
## development
|
|
208
276
|
|
|
209
277
|
```sh
|
package/dist/cli.js
CHANGED
|
@@ -10,18 +10,37 @@ const program = new Command();
|
|
|
10
10
|
program
|
|
11
11
|
.name("native-shortcuts-herd")
|
|
12
12
|
.description("make ghostty + herdr navigation feel native to macos")
|
|
13
|
-
.version("0.1.
|
|
14
|
-
addSharedOptions(program.command("install"))
|
|
13
|
+
.version("0.1.4");
|
|
14
|
+
addSharedOptions(program.command("install").option("--uninstall", "remove managed changes instead of installing"))
|
|
15
15
|
.description("run the guided installer")
|
|
16
16
|
.action(async (options) => {
|
|
17
17
|
await run(async () => {
|
|
18
|
+
if (options.uninstall) {
|
|
19
|
+
const result = options.dryRun ? diffRevert() : revertConfig(Boolean(options.dryRun));
|
|
20
|
+
outputResult("uninstalled native shortcuts", result, options);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
18
23
|
const wizard = await promptForInstall(options);
|
|
19
24
|
const choices = await promptForChoices(options);
|
|
20
|
-
|
|
25
|
+
if (wizard.installHerdr !== undefined)
|
|
26
|
+
options.installHerdr = wizard.installHerdr;
|
|
21
27
|
const result = await applyConfig(toApplyRequest(choices, options));
|
|
22
28
|
outputResult("installed native shortcuts", result, options);
|
|
23
29
|
}, options);
|
|
24
30
|
});
|
|
31
|
+
program
|
|
32
|
+
.command("uninstall")
|
|
33
|
+
.alias("remove")
|
|
34
|
+
.description("remove managed ghostty/herdr changes")
|
|
35
|
+
.option("--dry-run", "preview the uninstall without writing")
|
|
36
|
+
.option("--yes", "run without prompts")
|
|
37
|
+
.option("--json", "print machine-readable json")
|
|
38
|
+
.action(async (options) => {
|
|
39
|
+
await run(async () => {
|
|
40
|
+
const result = options.dryRun ? diffRevert() : revertConfig(Boolean(options.dryRun));
|
|
41
|
+
outputResult("uninstalled native shortcuts", result, options);
|
|
42
|
+
}, options);
|
|
43
|
+
});
|
|
25
44
|
addSharedOptions(program.command("apply"))
|
|
26
45
|
.description("apply a profile non-interactively")
|
|
27
46
|
.action(async (options) => {
|
|
@@ -92,7 +111,7 @@ program
|
|
|
92
111
|
"#!/usr/bin/env sh",
|
|
93
112
|
"set -eu",
|
|
94
113
|
"command -v npm >/dev/null 2>&1 || { echo 'npm is required' >&2; exit 127; }",
|
|
95
|
-
"npx --yes native-shortcuts-herd install"
|
|
114
|
+
"npx --yes native-shortcuts-herd install --yes \"$@\""
|
|
96
115
|
].join("\n");
|
|
97
116
|
if (options.json)
|
|
98
117
|
jsonOk({ script });
|
|
@@ -119,6 +138,8 @@ function addSharedOptions(command) {
|
|
|
119
138
|
.option("--herdr-key <action=key...>", "extra managed herdr [keys] binding", collect, [])
|
|
120
139
|
.option("--skip-ghostty", "do not patch ghostty")
|
|
121
140
|
.option("--skip-herdr", "do not patch herdr")
|
|
141
|
+
.option("--install-herdr", "install/update herdr if missing or outdated without prompting")
|
|
142
|
+
.option("--no-install-herdr", "never install/update herdr")
|
|
122
143
|
.option("--skip-herdr-install", "do not offer automatic herdr install/update")
|
|
123
144
|
.option("--no-reload", "write config but skip live reload attempts")
|
|
124
145
|
.option("--dry-run", "preview without writing")
|
|
@@ -191,13 +212,13 @@ async function promptForChoices(options) {
|
|
|
191
212
|
};
|
|
192
213
|
}
|
|
193
214
|
async function promptForInstall(options) {
|
|
194
|
-
if (options.
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
options.skipHerdrInstall ||
|
|
198
|
-
!process.stdin.isTTY) {
|
|
215
|
+
if (options.installHerdr === true)
|
|
216
|
+
return { installHerdr: true };
|
|
217
|
+
if (options.installHerdr === false || options.skipHerdrInstall) {
|
|
199
218
|
return { installHerdr: false };
|
|
200
219
|
}
|
|
220
|
+
if (options.yes || options.dryRun || options.skipHerdr || !process.stdin.isTTY)
|
|
221
|
+
return {};
|
|
201
222
|
const herdr = detectHerdr();
|
|
202
223
|
if (herdr.ok)
|
|
203
224
|
return { installHerdr: false };
|
|
@@ -232,7 +253,7 @@ function toApplyRequest(choices, options) {
|
|
|
232
253
|
ghosttyConfigPaths: options.ghosttyConfig,
|
|
233
254
|
skipGhostty: Boolean(options.skipGhostty),
|
|
234
255
|
skipHerdr: Boolean(options.skipHerdr),
|
|
235
|
-
skipHerdrInstall: Boolean(options.skipHerdrInstall),
|
|
256
|
+
skipHerdrInstall: Boolean(options.skipHerdrInstall || options.installHerdr === false),
|
|
236
257
|
noReload: options.reload === false
|
|
237
258
|
};
|
|
238
259
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AACrF,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,SAAS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AE,OAAO,CAAC,OAAO,CAAC,gBAAgB,IAAI,OAAO,CAAC,YAAY,KAAK,KAAK,CAAC;QACrF,QAAQ,EAAE,OAAO,CAAC,MAAM,KAAK,KAAK;KACnC,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,GAAG,CAAC,IAAyB,EAAE,OAA2B;IACvE,IAAI,CAAC;QACH,MAAM,IAAI,EAAE,CAAC;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,IAAI,OAAO,CAAC,IAAI;YAAE,SAAS,CAAC,gBAAgB,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;;YACzD,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;QACpC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,SAAS,YAAY,CAAC,KAAa,EAAE,MAAiD,EAAE,OAA2B;IACjH,IAAI,OAAO,CAAC,IAAI;QAAE,MAAM,CAAC,MAAM,CAAC,CAAC;;QAC5B,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;AAC1D,CAAC"}
|
package/dist/installer.js
CHANGED
|
@@ -2,8 +2,8 @@ import { existsSync } from "node:fs";
|
|
|
2
2
|
import { generateConfig } from "./profiles.js";
|
|
3
3
|
import { applyGhosttyPatch, applyGhosttyRevert, discoverGhosttyConfigs, ghosttySidecarPath, planGhosttyPatch, planGhosttyRevert, reloadGhosttyIfRunning, validateGhosttyConfigs } from "./ghostty.js";
|
|
4
4
|
import { applyHerdrPatch, applyHerdrRevert, detectHerdr, discoverHerdrConfig, installOrUpdateHerdr, minimumHerdrVersion, planHerdrPatch, planHerdrRevert, reloadHerdr } from "./herdr.js";
|
|
5
|
-
import { readState, writeState } from "./state.js";
|
|
6
|
-
const packageVersion = "0.1.
|
|
5
|
+
import { deleteState, readState, writeState } from "./state.js";
|
|
6
|
+
const packageVersion = "0.1.4";
|
|
7
7
|
export async function applyConfig(request) {
|
|
8
8
|
const generated = generateConfig(request.choices);
|
|
9
9
|
const warnings = [];
|
|
@@ -16,9 +16,17 @@ export async function applyConfig(request) {
|
|
|
16
16
|
const message = herdr.path
|
|
17
17
|
? `herdr ${herdr.version ?? "unknown"} found, ${minimumHerdrVersion}+ recommended`
|
|
18
18
|
: "herdr not found";
|
|
19
|
-
if (!request.skipHerdrInstall && (request.yes || request.installHerdr)
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
if (!request.skipHerdrInstall && (request.yes || request.installHerdr)) {
|
|
20
|
+
if (request.dryRun) {
|
|
21
|
+
warnings.push(`${message}; would install/update herdr without --dry-run`);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const installed = await installOrUpdateHerdr();
|
|
25
|
+
warnings.push(`${message}; installed ${installed}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
else if (request.skipHerdrInstall) {
|
|
29
|
+
warnings.push(`${message}; skipped herdr install by request`);
|
|
22
30
|
}
|
|
23
31
|
else {
|
|
24
32
|
warnings.push(`${message}; rerun install and accept the herdr install prompt, or use --yes`);
|
|
@@ -79,6 +87,8 @@ export function revertConfig(dryRun) {
|
|
|
79
87
|
...applyGhosttyRevert(configPaths, dryRun),
|
|
80
88
|
...applyHerdrRevert(previousValues, dryRun)
|
|
81
89
|
];
|
|
90
|
+
if (!dryRun)
|
|
91
|
+
deleteState();
|
|
82
92
|
return {
|
|
83
93
|
changes,
|
|
84
94
|
warnings: state ? [] : ["no state file found; removed only discoverable managed ghostty include and sidecar"]
|
package/dist/installer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installer.js","sourceRoot":"","sources":["../src/installer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,WAAW,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"installer.js","sourceRoot":"","sources":["../src/installer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,WAAW,EACX,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,cAAc,EACd,eAAe,EACf,WAAW,EACZ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAGhE,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,OAAqB;IACrD,MAAM,SAAS,GAAG,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,MAAM,OAAO,GAAa,EAAE,CAAC;IA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AK,CAAC,cAAc,IAAI,EAAE,CAAC;IACzD,MAAM,OAAO,GAAG;QACd,GAAG,iBAAiB,CAAC,WAAW,CAAC;QACjC,GAAG,eAAe,CAAC,cAAc,CAAC;KACnC,CAAC;IACF,OAAO;QACL,OAAO;QACP,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,oDAAoD,CAAC;KAC9E,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,MAAM;IACpB,MAAM,cAAc,GAAG,sBAAsB,CAAC,SAAS,CAAC,CAAC;IACzD,MAAM,KAAK,GAAG,WAAW,EAAE,CAAC;IAC5B,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC;IAC1B,OAAO;QACL,QAAQ,EAAE,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,IAAI,EAAE;QAC/C,OAAO,EAAE;YACP,OAAO,EAAE,cAAc;YACvB,OAAO,EAAE,kBAAkB,EAAE;YAC7B,cAAc,EAAE,UAAU,CAAC,kBAAkB,EAAE,CAAC;YAChD,mBAAmB,EAAE,sBAAsB,CAAC,cAAc,CAAC;SAC5D;QACD,KAAK,EAAE;YACL,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,aAAa,EAAE,KAAK,CAAC,EAAE;YACvB,MAAM,EAAE,mBAAmB,EAAE;SAC9B;QACD,KAAK;KACN,CAAC;AACJ,CAAC"}
|
package/dist/state.d.ts
CHANGED
package/dist/state.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
|
-
import { statePath, readText, writeText } from "./fs-utils.js";
|
|
2
|
+
import { removeFile, statePath, readText, writeText } from "./fs-utils.js";
|
|
3
3
|
export function readState() {
|
|
4
4
|
const path = statePath();
|
|
5
5
|
if (!existsSync(path))
|
|
@@ -17,4 +17,7 @@ export function readState() {
|
|
|
17
17
|
export function writeState(state) {
|
|
18
18
|
writeText(statePath(), `${JSON.stringify(state, null, 2)}\n`);
|
|
19
19
|
}
|
|
20
|
+
export function deleteState() {
|
|
21
|
+
removeFile(statePath());
|
|
22
|
+
}
|
|
20
23
|
//# sourceMappingURL=state.js.map
|
package/dist/state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG3E,MAAM,UAAU,SAAS;IACvB,MAAM,IAAI,GAAG,SAAS,EAAE,CAAC;IACzB,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAiB,CAAC;QAC1D,IAAI,MAAM,CAAC,aAAa,KAAK,CAAC;YAAE,OAAO,MAAM,CAAC;IAChD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAmB;IAC5C,SAAS,CAAC,SAAS,EAAE,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,WAAW;IACzB,UAAU,CAAC,SAAS,EAAE,CAAC,CAAC;AAC1B,CAAC"}
|