run-promptvault-tui
Run, test, screenshot, and interact with the PromptVault Python TUI (promptvault-tui). Use when asked to run, start, drive, screenshot, smoke-test, or verify the TUI app, or to create/search items programmatically.
- License 许可
- MIT
- 最近更新
- 2026-07-03
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- run-promptvault-tui
- description
- Run, test, screenshot, and interact with the PromptVault Python TUI (promptvault-tui). Use when asked to run, start, drive, screenshot, smoke-test, or verify the TUI app, or to create/search items programmatically.
02 资源文件 1
- 脚本driver.py4.9 KB
03 SKILL.md 正文
run-promptvault-tui
PromptVault TUI is a Textual-based interactive terminal app. The driver uses Textual's run_test() + Pilot API to drive the app headlessly — no terminal emulator, no tmux, no display server needed. All commands run from PromptVault.Tui/ using uv run.
Prerequisites
uv pip install -e ".[dev]"
Already satisfied if .venv/ exists in PromptVault.Tui/.
Run (agent path)
The driver lives at .claude/skills/run-promptvault-tui/driver.py, run from PromptVault.Tui/:
cd PromptVault.Tui
# Verify app boots and items load
uv run python ../.claude/skills/run-promptvault-tui/driver.py smoke
# OK: 24 items loaded, search focused
# Search items and print titles
uv run python ../.claude/skills/run-promptvault-tui/driver.py search "code review"
# Code Review Checklist
# Take an SVG screenshot of the running app
uv run python ../.claude/skills/run-promptvault-tui/driver.py screenshot out.svg
# Screenshot saved: out.svg
# Create a new item and verify it persists
uv run python ../.claude/skills/run-promptvault-tui/driver.py new-item "My Title" "Body text here"
# OK: created 'My Title' (24 -> 25 items)
All four commands exit 0 on success.
The driver uses the real data file (~/.promptvault/cartridges/default.json) by default — smoke, search, and screenshot are read-only; new-item does mutate it.
Run (human path)
cd PromptVault.Tui
uv run promptvault-tui
Opens the full interactive TUI in the current terminal. q to quit.
Non-interactive CLI modes that work in any shell:
uv run promptvault-tui --list
uv run promptvault-tui search "terraform"
Test suite
cd PromptVault.Tui
uv run python -m unittest discover -s tests
# Ran 61 tests in ~29s OK
Gotchas
-
nkey requires focus off search input. The searchInputconsumes all printable characters, sopress("n")with search focused types "n" into the field — it does not open the new-item modal. The driver works around this by callingresults_list.focus()before pressingn. This also means keyboard bindings (n,e,d,f,c,q) only fire when focus is on the results list or nothing. -
Modal queries need
pilot.app.screennotpilot.app. WhenFieldEditorScreenis pushed,pilot.app.query_one("#w-fld-title")raisesNoMatches— query frompilot.app.screeninstead (which is the active/top screen). -
SVG export raises
UnicodeEncodeErrorwith default file open. Always open withencoding="utf-8"— the SVG contains non-ASCII box-drawing and braille characters that CP1252 can't encode. -
Duplicate items after re-seed. If you call
_build_repo()on a file that already has items, seeds are not re-added. But the test data file may already contain the seed items, so--listoutput can show them twice if the file was populated from a prior version. Not a driver bug.
Troubleshooting
ModuleNotFoundError: No module named 'promptvault_tui' — run uv pip install -e ".[dev]" from PromptVault.Tui/, or ensure you're running uv run from inside PromptVault.Tui/ (not from repo root).
uv recreates .venv on every run — expected if the interpreter version changes. It only reinstalls packages once; subsequent runs are fast.
pilot.pause() not long enough for async handlers — _refresh_display() is async and triggered by Input.Changed. Add an extra await pilot.pause() if assertions run before the DOM updates.
04 同仓库更多 Skills
PDF Form Filler
Fill PDF form fields from structured data
git-helper
暂无简介
run-promptvault-app
Build, run, test, and screenshot the PromptBoy WPF app (PromptVault.App). Use when asked to run, start, build, test, screenshot, smoke-test, or verify the C# WPF desktop app.