sq
sq is a queue CLI and queue-native task/review substrate.
It manages review and task items in a JSONL queue file. You can use it directly from the shell, from agents, or as the queue layer for tools like sift.
Install sq skills in Pi / Claude
You can install this repo as a plugin source to get the sq skills.
Pi
Claude
Cargo
Build / Run
From repository root:
Queue path
By default, sq uses:
.sift/queue.jsonl
You can override it with:
-q, --queue <PATH>SQ_QUEUE_PATH=<PATH>SIFT_QUEUE_PATH=<PATH>(legacy compatibility)
Commands
sq add— create a single itemsq collect— create many items from piped stdinsq list— list itemssq show <id>— show item detailssq edit <id>— edit item fields/sourcessq close <id>— mark item as closedsq rm <id>— remove itemsq prime— output queue workflow context for AI agents
Use sq <command> --help for full options.
Common examples
# Add item with source text
# Add source-less task item
# Add item with metadata
# Collect one item per file from ripgrep JSON
|
# Include line numbers and surrounding context in each collected text source
|
# Add shared description to every created item
|
# Template titles using filepath / filename / match_count
|
# Attach shared metadata while collecting
|
# List open items (default excludes closed)
# Include closed too
# Machine-readable output
|
# Merge metadata patch
# Close item quickly
sq collect --by-file
sq collect --by-file is the bulk-ingestion workflow for turning search results into queue items.
A common pattern is:
- search the codebase with
rg --json - group results by file
- create one queue item per file
- review or process that queue with your preferred workflow
Example:
|
Supported input
Currently supported:
rg --json
Plain-text rg output is not supported.
If you want surrounding context in each created text source, pass ripgrep context flags such as:
-nfor line numbers-C2for two lines of context-A2/-B2for after / before context
What each collected item contains
For each file group, sq collect --by-file creates:
- a
filesource for the filepath - a
textsource containing the grouped ripgrep match/context lines
This makes the queue item easy to inspect later:
- the
filesource points at the file - the
textsource preserves the specific matches that caused the item to be created
Shared flags
These flags apply to every created item:
--title--description--title-template--metadata--blocked-by--json
Title behavior
If you do not provide --title or --title-template, the default title template is:
{{match_count}}:{{filepath}}
That keeps bulk-created queues scannable in sq list.
Examples:
# Static title for every item
|
# Templated titles per file
|
Title template variables
Available in --title-template:
{{filepath}}— full grouped file path{{filename}}— basename of{{filepath}}{{match_count}}— number of ripgrepmatchevents collected for that file
Suggested migration / cleanup workflow
When you want to build a queue from repeated occurrences across a codebase:
|
This is especially useful for:
- migrations
- API renames
- deprecations
- TODO / FIXME sweeps
- repeated code smell cleanup
Optional integration with sift
sq is useful on its own, but it also works well as the queue layer for sift.
A common pairing is:
Status values
Current statuses:
pendingin_progressclosed
Set explicit status via:
||
Or use convenience close command:
Development