feat: add pos bank — persistent command bank with parameterized templates
gates / consistency-and-conventions (push) Successful in 29s

This commit is contained in:
Your Name
2026-09-12 03:02:20 -04:00
parent 0b76d4d29e
commit 41efc91cf0
10 changed files with 886 additions and 16 deletions
+17 -14
View File
@@ -10,19 +10,19 @@
<!-- GEN:START docmap -->
| ## 1. Project Overview | 2843 |
| ## 2. Directory Structure | 44217 |
| ## 3. Installation Flow | 218276 |
| ## 4. The `pos` CLI System | 277365 |
| ## 5. Shared Library — `lib/common.sh` | 366397 |
| ## 6. Docker Compose / ScaleTail | 398440 |
| ## 7. Optional Apps (`apps/`) | 441470 |
| ## 8. Entertainment Module | 471484 |
| ## 9. Systemd Services | 485496 |
| ## 10. Configuration Files | 497523 |
| ## 11. Coding Conventions | 524556 |
| ## 12. Development Workflow | 557609 |
| ## 13. Key File Quick Reference | 610693 |
| ## 14. Common Tasks for Agents | 694727 |
| ## 2. Directory Structure | 44218 |
| ## 3. Installation Flow | 219277 |
| ## 4. The `pos` CLI System | 278367 |
| ## 5. Shared Library — `lib/common.sh` | 368399 |
| ## 6. Docker Compose / ScaleTail | 400442 |
| ## 7. Optional Apps (`apps/`) | 443472 |
| ## 8. Entertainment Module | 473486 |
| ## 9. Systemd Services | 487498 |
| ## 10. Configuration Files | 499525 |
| ## 11. Coding Conventions | 526558 |
| ## 12. Development Workflow | 559611 |
| ## 13. Key File Quick Reference | 612696 |
| ## 14. Common Tasks for Agents | 697730 |
<!-- GEN:END docmap -->
## 1. Project Overview
@@ -117,6 +117,7 @@ Linux_post_install/
│ ├── pos-system-schedule # Scheduled jobs: run a command on a timer; notify on threshold/change/error/always or silently
│ ├── pos-system-uninstall # Remove pos toolkit binaries, services, shell integration, config, and data
│ ├── pos-ai # AI assistant: ask, chat, sessions, capture, models, providers
│ ├── pos-bank # Persistent command bank for saving and running shell commands
│ ├── pos-config # Interactive editor for the tools' runtime config (reads # POS_CONFIG: registry)
│ ├── pos-tree # Show the pos CLI command tree: categories, commands, and subcommands
<!-- GEN:END tree -->
@@ -343,6 +344,7 @@ All non-interactive `pos` commands log output to `~/.local/share/linux_post_inst
| system | schedule | `pos-system-schedule` | Scheduled jobs: run a command on a timer; notify on threshold/change/error/always or silently | | |
| system | uninstall | `pos-system-uninstall` | Remove pos toolkit binaries, services, shell integration, config, and data | | |
| | ai | `pos-ai` | AI assistant: ask, chat, sessions, capture, models, providers | | |
| | bank | `pos-bank` | Persistent command bank for saving and running shell commands | | |
| | config | `pos-config` | Interactive editor for the tools' runtime config (reads # POS_CONFIG: registry) | | |
| | tree | `pos-tree` | Show the pos CLI command tree: categories, commands, and subcommands | | |
<!-- GEN:END dispatch -->
@@ -683,9 +685,10 @@ Use conventional prefixes: `feat:`, `fix:`, `docs:`, `refactor:`, `chore:`
| `bin/pos-system-schedule` | 151 | Scheduled jobs: run a command on a timer; notify on threshold/change/error/always or silently |
| `bin/pos-system-uninstall` | 517 | Remove pos toolkit binaries, services, shell integration, config, and data |
| `bin/pos-ai` | 714 | AI assistant: ask, chat, sessions, capture, models, providers |
| `bin/pos-bank` | 313 | Persistent command bank for saving and running shell commands |
| `bin/pos-config` | 80 | Interactive editor for the tools' runtime config (reads # POS_CONFIG: registry) |
| `bin/pos-tree` | 118 | Show the pos CLI command tree: categories, commands, and subcommands |
| `completions/pos.bash` | 317 | Dynamic bash completion |
| `completions/pos.bash` | 318 | Dynamic bash completion |
<!-- GEN:END filetable -->
| `apps/install.sh` | 171 | App install/uninstall picker/orchestrator |
+24
View File
@@ -534,6 +534,30 @@ Feature-flag management CLIs (see [SCRIPTS.md → lib/flags.sh](SCRIPTS.md#libfl
| `flag-set <name> [value]` | Set a flag, optionally with a value (requires sudo) |
| `flag-clear <name>` | Unset a flag (requires sudo) |
### bank
**File:** `bin/pos-bank`
Persistent command bank for saving and running shell commands. Commands are stored in `~/.config/linux_post_install/bank.env` (pipe-delimited: `name|description|command`). Supports parameterized templates with `{param}` placeholders that are substituted at run time (quoted for safe shell evaluation).
On a TTY with no arguments, `pos bank` opens an interactive menu (list / add / run / edit / remove).
| Command | Purpose |
|---------|---------|
| `pos bank list` | List all saved commands |
| `pos bank add <name> [desc] [cmd]` | Add a new command (interactive for missing args) |
| `pos bank show <name>` | Show command details and detected parameters |
| `pos bank run <name> [key=val …]` | Run a command (interactive for missing params) |
| `pos bank edit <name>` | Edit an existing command |
| `pos bank remove <name>` | Remove a command |
Example with parameters:
```
pos bank add convert "Convert video" "ffmpeg -i {input} -crf {quality} {output}"
pos bank run convert input=clip.mp4 quality=23 output=clip.mkv
```
### config
**File:** `bin/pos-config`