How seruman/px works
px is a terminal picker that reads piped text, finds selectable spans, displays the original formatted lines interactively, and prints confirmed selections to stdout. Its main workflow is input scanning and optional wrapped-line rejoining, matcher resolution and span discovery, interactive navigation/selection, then output. Built-in matchers and executable extensions are distinct discovery paths. Source excerpts are incomplete, so the graph omits uncertain UI-internal wiring and focuses on documented capabilities and supported calls.
Main entry points: main.go CLI entry · extension.go Matcher execution · picker.go Picker interface · match.go Built-in matchers
Components 17
Input handling
- CLI entry
main.go - Line scanning
paths.go - Wrapped-line joining
paths.go
Match discovery
- Matcher resolution
main.go - Built-in matchers
match.go - Path matcher
paths.go - Custom regex
match.go - Matcher execution
extension.go - px extension
- Span validation
extension.go - Styled input
extension.go
Interactive picker
- Picker interface
picker.go - Navigate and select
picker.go - Search and hints
picker.go
Output
- Selection consumer
Other components
- Piped command
- Terminal user
Connections 21
- Piped command → CLI entry: pipes text
- CLI entry → Line scanning: scans input
- CLI entry → Wrapped-line joining: rejoins lines
- CLI entry → Matcher resolution: resolves options
- Matcher resolution → Built-in matchers: selects built-ins
- Matcher resolution → px extension: locates executable
- CLI entry → Custom regex: compiles regex
- CLI entry → Matcher execution: starts matchers
- Matcher execution → Built-in matchers: runs functions
- Built-in matchers → Path matcher: matches paths
- Matcher execution → px extension: sends lines
- px extension → Matcher execution: returns spans
- Matcher execution → Span validation: validates spans
- Matcher execution → Styled input: styles lines
- CLI entry → Picker interface: runs interface
- Matcher execution → Picker interface: posts match data
- Terminal user → Picker interface: sends keys
- Picker interface → Navigate and select: handles navigation
- Picker interface → Search and hints: handles search
- Picker interface → CLI entry: returns selection
- CLI entry → Selection consumer: prints selection