How 0xsojalsec/pipet works
Pipet is a command-line scraper that reads a .pipet specification, fetches resources with curl or Playwright, extracts nested query results, and renders them as text, JSON, or a template. It also supports pagination, shell-pipe processing, and interval-based change notifications. The graph reflects the sampled call sites and documented capabilities; some README-described behavior, particularly Playwright installation details and monitoring semantics, is represented at the CLI level rather than as a separately inspected subsystem.
Main entry points: main.go CLI entry · common.go App data model · app.go Block executor · utils.go Curl execution
Components 21
CLI and orchestration
- CLI entry
cmd/pipet/main.go - Spec parser
internal/app/app.go - Block executor
internal/app/app.go - Pagination
internal/app/app.go
Scraping and extraction
- Curl execution
parsers/utils.go - Playwright execution
parsers/playwright.go - HTML queries
parsers/html.go - JSON queries
parsers/json.go - Shell pipe processing
parsers/utils.go
Shared data and utilities
- App data model
common/common.go - Query utilities
parsers/utils.go - Result formatting helpers
utils/utils.go
Result rendering
- Text output
outputs/text.go - JSON output
outputs/json.go - Template output
outputs/template.go
Other components
- CLI user
- curl command
- Headless browser
- Shell commands
- Template file
- Terminal output
Connections 31
- CLI user → CLI entry: runs
README.md - CLI entry → Spec parser: parses spec
cmd/pipet/main.go - CLI entry → Block executor: executes blocks
cmd/pipet/main.go - CLI entry → App data model: configures
cmd/pipet/main.go - Spec parser → App data model: fills blocks
internal/app/app.go - Block executor → App data model: reads blocks
internal/app/app.go - Block executor → Curl execution: dispatches curl
internal/app/app.go - Block executor → Playwright execution: dispatches browser
internal/app/app.go - Block executor → Pagination: resolves next page
internal/app/app.go - Pagination → App data model: updates command
internal/app/app.go - Curl execution → curl command: runs command
parsers/utils.go - Curl execution → HTML queries: parses HTML
parsers/utils.go - Curl execution → JSON queries: parses JSON
parsers/utils.go - HTML queries → Query utilities: uses indentation
parsers/html.go - JSON queries → Query utilities: uses indentation
parsers/json.go - HTML queries → Shell pipe processing: runs pipe
parsers/html.go - JSON queries → Shell pipe processing: runs pipe
parsers/json.go - Playwright execution → Headless browser: evaluates queries
parsers/playwright.go - Playwright execution → Shell pipe processing: runs pipe
parsers/playwright.go - Shell pipe processing → Shell commands: executes command
parsers/utils.go - CLI entry → Text output: selects text
cmd/pipet/main.go - CLI entry → JSON output: selects JSON
cmd/pipet/main.go - CLI entry → Template output: selects template
cmd/pipet/main.go - CLI entry → Result formatting helpers: detects template
cmd/pipet/main.go - Text output → Result formatting helpers: flattens results
outputs/text.go - Text output → App data model: reads results
outputs/text.go - JSON output → App data model: serializes results
outputs/json.go - Template output → App data model: renders results
outputs/template.go - Template output → Template file: reads template
outputs/template.go - CLI entry → Terminal output: prints result
cmd/pipet/main.go - CLI entry → Shell commands: runs change command
cmd/pipet/main.go