pb CLI
Query logs, explore metrics, tail live events, and manage Parseable from your terminal.
pb is the official command line interface for self-hosted Parseable and Parseable Cloud. It gives you a terminal-first way to connect to a server, run SQL and PromQL queries, tail live events, manage datasets, and work with users and roles.
You can use it in scripts and CI, or open the interactive terminal views when you want to explore logs and metrics without switching to the browser.
Quick start
# Connect to a Parseable server
pb login
# Open the interactive SQL table view
pb sql run -i
# Run SQL directly
pb sql run "SELECT * FROM backend WHERE status >= 500" --from=1h
# Open the interactive PromQL table view
pb promql run -i
# Run PromQL directly
pb promql run "rate(http_requests_total[5m])" --dataset otel_metrics --from=1h
# Stream live events
pb tail backendCommands
| Command | Description |
|---|---|
pb login | Start an interactive wizard to connect to a Parseable server and save the connection as a profile |
pb cloud profile | Add a Parseable Cloud profile with a Cloud API key |
pb profile | Add, list, switch, update, and remove saved server profiles |
pb status | Verify the active connection and display server version information |
pb sql | Run SQL queries, save SQL queries, and open the interactive SQL table view |
pb promql | Run PromQL range and instant queries, explore labels and series, and inspect cardinality |
pb tail | Stream live log events from a dataset in real time as newline-delimited JSON |
pb dataset | List, create, inspect, and delete log, metrics, and traces datasets |
pb user | Create users, assign roles, and manage user access |
pb role | Define roles with specific privilege levels and dataset scopes |
pb version | Print the CLI version and build commit |
Interactive mode
SQL and PromQL both support an interactive full-screen TUI with -i. In this mode, pb opens a panel-based interface where you can write a query, select a dataset, adjust the time range, and browse paginated results.
pb sql run -ipb promql run -iNavigate between panels with Tab and Shift+Tab. Press Ctrl+R to run the query. Results open in a scrollable table where you can move through rows, inspect columns, and filter what you see.
Output modes
Commands that return structured data support --output json, which makes them easier to use in scripts and automation. SQL queries without -i print directly in the terminal. Add -i when you want the interactive table view instead.
pb dataset list
pb dataset list --output json
pb sql run "SELECT * FROM logs LIMIT 50" --from=1h
pb sql run "SELECT * FROM logs LIMIT 50" --from=1h -i
pb sql run "SELECT level, count(*) FROM logs GROUP BY level" --from=1h --output json
pb promql run "up" --dataset otel_metrics --instant --output jsonGetting started
- Install pb - install with the script, Homebrew, or a release archive
- Connect to a server - authenticate and save a server profile
- Run a SQL query - query logs with
pb sql - Run a PromQL query - query metrics with
pb promql - Use aliases - learn the short command forms such as
ls,rm,stat, andset-url - Use pb with AI agents - configure safe, read-only agent access
Was this page helpful?