Skip to content

Commit 951a165

Browse files
paclaude
andcommitted
feat: lazygit-style actions, non-blocking execution, and UX improvements
- Replace two-step action system with lazygit-style Ctrl+key shortcuts and Shift+A interactive action menu with j/k navigation - Make action execution non-blocking by spawning CLI/HTTP actions in background tokio tasks, keeping the TUI responsive during long-running commands like kubectl delete with graceful termination - Show animated spinner in confirmation dialog while action executes, or top-right overlay for actions without confirmation - Add column-specific search with %column_name% delimiter syntax - Add --version flag to CLI - Update docs, examples, and skill config for new action key format Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 33c4f19 commit 951a165

File tree

14 files changed

+2462
-330
lines changed

14 files changed

+2462
-330
lines changed

.claude/skills/termstack-yaml-generator/SKILL.md

Lines changed: 21 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ pages:
6868
context:
6969
item_id: "$.id"
7070
actions:
71-
- key: "d"
71+
- key: "ctrl+d"
7272
name: "Details"
7373
page: "detail_page"
7474
context:
@@ -228,56 +228,36 @@ next:
228228

229229
### 4. Actions
230230

231-
Actions are triggered by pressing `a` then the action key:
231+
Actions are triggered via the Shift+A menu or direct Ctrl+key shortcuts:
232232

233233
```yaml
234234
actions:
235235
# Execute command
236-
- key: "d"
236+
- key: "ctrl+d"
237237
name: "Delete"
238238
description: "Delete this item"
239239
confirm: "Are you sure you want to delete {{ name }}?"
240240
command: "curl"
241241
args: ["-X", "DELETE", "{{ api_base }}/items/{{ id }}"]
242242
refresh: true
243-
243+
244244
# Navigate to page
245-
- key: "v"
245+
- key: "ctrl+v"
246246
name: "View Details"
247247
page: "detail_page"
248248
context:
249249
item_id: "$.id"
250-
250+
251251
# Open in external app
252-
- key: "o"
252+
- key: "ctrl+o"
253253
name: "Open in Browser"
254254
command: "open"
255255
args: ["{{ html_url }}"]
256-
257-
# Builtin actions
258-
- key: "y"
256+
257+
# Builtin action (yaml_view is useful as a custom action)
258+
- key: "ctrl+y"
259259
name: "YAML View"
260260
builtin: yaml_view
261-
262-
- key: "h"
263-
name: "Help"
264-
builtin: help
265-
266-
- key: "s"
267-
name: "Search"
268-
builtin: search
269-
270-
- key: "r"
271-
name: "Refresh"
272-
builtin: refresh
273-
274-
- key: "b"
275-
name: "Back"
276-
builtin: back
277-
278-
- key: "q"
279-
name: "Quit"
280-
builtin: quit
281261
```
282262

283263
### 5. Multiple Data Sources
@@ -333,12 +313,12 @@ detail:
333313
url: "{{ api_base }}/users/{{ user_id }}"
334314
```
335315

336-
#### B. Action Navigation (a + key) - Uses Templates
316+
#### B. Action Navigation (Shift+A menu / Ctrl+key) - Uses Templates
337317

338318
```yaml
339319
# Source page - action context ACCEPTS template expressions
340320
actions:
341-
- key: "d"
321+
- key: "ctrl+d"
342322
page: detail
343323
context:
344324
user_id: "{{ id }}" # ✅ Template - from current row
@@ -404,7 +384,7 @@ data:
404384
405385
# Navigate to logs
406386
actions:
407-
- key: "l"
387+
- key: "ctrl+l"
408388
page: pod_logs
409389
context:
410390
pod_name: "{{ metadata.name }}" # Template - from current pod
@@ -605,7 +585,7 @@ pages:
605585
breed_id: "$.id"
606586
breed_name: "$.attributes.name"
607587
actions:
608-
- key: "f"
588+
- key: "ctrl+f"
609589
name: "View Facts"
610590
page: "facts"
611591
@@ -703,7 +683,7 @@ pages:
703683
pod_name: "$.metadata.name" # JSONPath for next navigation
704684
pod_namespace: "$.metadata.namespace"
705685
actions:
706-
- key: "l"
686+
- key: "ctrl+l"
707687
name: "View Logs"
708688
page: "pod_logs"
709689
context:
@@ -946,11 +926,11 @@ curl -fsSL https://github.com/pa/termstack/releases/latest/download/termstack-li
946926

947927
- `Enter` - Navigate to next page (defined by `next`)
948928
- `Esc` - Go back
949-
- `a` + key - Trigger action
929+
- `Shift+A` - Open action menu
950930
- `j`/`k` or arrows - Move up/down
951931
- `g` - Go to top
952932
- `G` - Go to bottom
953-
- `/` - Search
933+
- `/` - Search (use `%Column Name% term` for column-specific search)
954934
- `q` - Quit
955935
- `r` - Refresh data
956936
- `f` - Toggle filter (in logs view)
@@ -984,7 +964,7 @@ data:
984964

985965
# ✅ CORRECT - Pass namespace explicitly in context
986966
actions:
987-
- key: "l"
967+
- key: "ctrl+l"
988968
page: pod_logs
989969
context:
990970
pod_name: "{{ metadata.name }}"
@@ -1014,13 +994,13 @@ next:
1014994

1015995
# ❌ WRONG - JSONPath in action.context
1016996
actions:
1017-
- key: "d"
997+
- key: "ctrl+d"
1018998
context:
1019999
name: "$.metadata.name" # Won't work!
10201000

10211001
# ✅ CORRECT - Template in action.context
10221002
actions:
1023-
- key: "d"
1003+
- key: "ctrl+d"
10241004
context:
10251005
name: "{{ metadata.name }}"
10261006
```
@@ -1062,7 +1042,7 @@ title: "Pods in {{ namespace }}" # Use extracted value
10621042
10631043
# Check 1: Was it passed in context?
10641044
actions:
1065-
- key: "l"
1045+
- key: "ctrl+l"
10661046
context:
10671047
pod_name: "{{ metadata.name }}" # ✅ Passed
10681048

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Think of it as "k9s for anything" — Kubernetes, REST APIs, dog breeds (yes, re
3232

3333
## Demo
3434

35-
[![asciicast](https://asciinema.org/a/777358.svg)](https://asciinema.org/a/777358)
35+
[![asciicast](https://asciinema.org/a/ozYJrUw1VZIpptEI.svg)](https://asciinema.org/a/ozYJrUw1VZIpptEI)
3636

3737
*Click to view the interactive terminal recording - you can pause, copy text, and replay at your own pace!*
3838

@@ -396,17 +396,17 @@ next:
396396
397397
### Actions
398398
399-
Press `a` to enter action mode, then the action key:
399+
Press `Shift+A` to open the action menu, or use `Ctrl+key` shortcuts directly:
400400

401401
```yaml
402402
actions:
403-
- key: "d"
403+
- key: "ctrl+d"
404404
name: "Delete"
405405
confirm: "Really delete {{ name }}? (no undo!)"
406406
command: "kubectl"
407407
args: ["delete", "pod", "{{ name }}"]
408408
refresh: true
409-
- key: "v"
409+
- key: "ctrl+v"
410410
name: "View Details"
411411
page: "detail_page"
412412
```
@@ -451,8 +451,8 @@ transform: "{{ value | upper }}" # "SHOUTING"
451451
| `G` | Go to bottom |
452452
| `Enter` | Select / Navigate |
453453
| `Esc` | Go back |
454-
| `/` | Search |
455-
| `a` | Action mode |
454+
| `/` | Search (`%col% term` for column) |
455+
| `Shift+A` | Action menu |
456456
| `r` | Refresh |
457457
| `q` | Quit |
458458

@@ -527,7 +527,7 @@ A: Make sure your data source is accessible. Try `--verbose` for debug output.
527527

528528
**Q: Actions aren't triggering!**
529529

530-
A: Press `a` first to enter action mode, then your action key.
530+
A: Press `Shift+A` to open the action menu, or use `Ctrl+key` shortcuts directly.
531531

532532
**Q: Can I use this in production?**
533533

0 commit comments

Comments
 (0)