Linux command
qo 命令
文件
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Query a JSON file interactively
cat [file.json] | qo
Query a CSV file
qo [file.csv]
Run a SQL query directly
cat [file.json] | qo -q "SELECT [column] FROM tmp WHERE [condition]"
Convert JSON to CSV
qo -o csv [file.json] -q "SELECT * FROM [table]"
Specify input and output formats
qo -i tsv -o json [file.tsv]
说明
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.
参数
- -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.
FAQ
What is the qo command used for?
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.
How do I run a basic qo example?
Run `cat [file.json] | qo` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -i, --input _format_ do in qo?
Input format: `json`, `csv`, `tsv`, or `psv` (pipe-separated). Auto-detected from file extension if not specified.