LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

qo

Interactive minimalist TUI to query JSON and CSV using SQL

TLDR

Query a JSON file interactively
$ cat [file.json] | qo
copy
Query a CSV file passing it directly as an argument
$ qo [file.csv]
copy
Run a SQL query directly without entering the TUI
$ cat [file.json] | qo -q "SELECT [column] FROM tmp WHERE [condition]"
copy
Convert JSON to CSV using a direct query
$ qo -o csv [file.json] -q "SELECT * FROM [table]"
copy
Specify input and output formats
$ qo -i tsv -o json [file.tsv]
copy

SYNOPSIS

qo [options] [file...]command | qo [options]

DESCRIPTION

qo is a minimalist terminal UI for querying JSON and CSV data using SQL. It reads from standard input or file arguments and provides an interactive TUI for exploring structured data with SQL queries.The internal table is always named tmp. Results are sent to standard output on exit, allowing qo to be used in pipelines.

PARAMETERS

-i, --input format

Input format: `json`, `csv`, `tsv`, or `psv` (pipe-separated). Auto-detected from file extension if not specified.
-o, --output format
Output format: `json`, `jsonl`, `csv`, `tsv`, `psv`, or `table`.
-q, --query sql
Run a SQL query directly and skip the interactive TUI.
--no-header
Treat the first row as data rather than a header row.

KEYBOARD SHORTCUTS

Tab

Switch between query input and table view
Enter
Execute the current query
Esc
Output results to stdout and quit
Ctrl+C
Quit without producing output
j/k or ↑/↓
Scroll rows in table view
h/l or ←/→
Scroll columns in table view

HISTORY

qo was created by kiki-ki and is written in Go. The project is hosted as go-qo on GitHub.

SEE ALSO

jq(1), q(1), miller(1), trdsql(1), sqlite3(1)

Copied to clipboard
Kai