DocsCLI and agents
CLI reference and snapshots
Get small, structured, bounded log evidence from a script or a terminal, and know exactly what it leaves out.
Before you start
- The demo needs nothing:
tapsift query --demo. - Live snapshots need
adband a device. They read the current Android log buffers. - Command examples use
tapsift. A source build runs as./bin/tapsift.
Commands
| Command | What it does |
|---|---|
tapsift or tapsift tui | Open the interactive workspace. Live capture happens here. |
tapsift query | Finite snapshot as compact JSON: counts, top tags and recurring exact error messages. |
tapsift logs | Finite snapshot as bounded records. Text by default, JSON with --format json. |
tapsift dump | Write a replayable raw snapshot plus a metadata sidecar. |
tapsift targets | List Android devices, Android Virtual Devices and iOS Simulators as JSON. |
tapsift devices | List connected Android devices. |
tapsift apps | List installed apps for a device. |
tapsift boot / tapsift wake | Start an emulator or simulator / send the Android wake key. See Devices. |
tapsift history | list saved sessions or show --id ID. See History. |
tapsift favorites | Print your saved favorites and remembered selections as JSON. This is local data about your own devices and apps. |
tapsift version | Print build metadata. --json for JSON. |
devices and apps need a real source. They do not support --demo.
Sources
Pick one source for query, logs and dump:
| Source | Flags |
|---|---|
| Offline demo (synthetic) | --demo |
| A threadtime log file | --file PATH |
| Standard input | --file - |
| A live Android app | --device SERIAL --app PACKAGE |
| A live iOS Simulator app | --device ios:UDID --app BUNDLE_ID (experimental) |
| All apps on a device | --device ... --all (explicit opt-in) |
| A saved session | --session ID, optionally --history-dir DIR |
An app-scoped snapshot never silently widens to all apps. An emulator snapshot also needs --app or --all, because emulator serials can be reassigned.
Filters and budgets
| Flag | Meaning | Default and range |
|---|---|---|
--level LEVEL | Minimum severity: all, V, D, I, W, E or F. all also includes unparsed lines. | V |
--tag TAG | Exact tag. Repeat for OR. | none |
--text TEXT | Case-insensitive substring of message or tag. | none |
--regex PATTERN | Go regular expression on message or tag. | none |
--limit N | Latest matching records returned. | 100 (2,000 for dump), range 1 to 2000 |
--max-bytes N | Output byte budget. | 16384 (4194304 for dump), range 1024 to 4194304 |
--format FORMAT | Output format: text, json or raw. | query: json. logs: text. dump: raw. |
--summary | Aggregate the retained matches. | on for query |
--output PATH | Write a new private file. Refuses to overwrite. | none |
--save | Also record the unfiltered source into history. | off |
Filters run before retention. At most 2,000 matching records and 16 MiB of text are retained. Summaries cover the retained matches with at most 10 tags and 10 error groups.
Examples
A compact summary on the demo:
tapsift query --demoBounded records with a text filter:
tapsift logs --demo --format json --text timeout --limit 20 --max-bytes 8192{"schema_version":1,"source":"demo","scope":"synthetic","complete_input":true,"records_read":18,"records_retained":2,"retained_text_bytes":306,"evicted_records":0,"matched_retained_records":2,"matched_records":2,"unparsed_records":0,"truncated_records":0,"omitted_records":0,"output_truncated":false,"events":[{"timestamp":"2026-11-18 12:04:13.001","pid":8102,"tid":8124,"priority":"E","tag":"Network","message":"GET /v1/search -\u003e timeout after 5000ms"},{"timestamp":"2026-11-18 12:04:13.101","pid":8102,"tid":8124,"priority":"E","tag":"Network","message":"GET /v1/search -\u003e timeout after 5000ms"}]}A file, or a pipe from adb:
tapsift query --file capture.log --tag Network
adb -s emulator-5554 logcat -d -v threadtime | tapsift query --file -A live app, and a replayable dump:
tapsift query --device emulator-5554 --app com.example.app --level E
tapsift dump --device emulator-5554 --app com.example.app --output capture.logIn JSON, > is written as \u003e, so -> in a message appears as -\u003e. That is standard JSON escaping, and every JSON parser decodes it back to >.
Reading the output
Every result starts with the same completeness fields. Text output carries them as one header line, for example source=demo scope=synthetic read=18 retained=2 evicted=0 matched=2 omitted=0 output_truncated=false.
| Field | Meaning |
|---|---|
schema_version | Version of this JSON shape. Currently 1. |
source | Where records came from: demo, file, history and so on. |
scope | What the records cover. synthetic for the demo, offline_unscoped for a file, and the app scope for a live capture. |
complete_input | Whether the whole input was read. |
records_read | Records read from the source. |
matched_records | Records that passed your filters. |
records_retained, matched_retained_records | Records held after the retention caps. |
evicted_records | Records pushed out by the retention caps. |
unparsed_records | Lines that were not valid threadtime records. Use --level all to include them. |
truncated_records | Records cut at 64 KiB. |
omitted_records | Matching records left out of this output by --limit or --max-bytes. |
output_truncated | True when the byte budget cut the output. |
summary | query only: totals, by_priority, top_tags, and error_groups with count, first and last. |
events | logs --format json only: timestamp, pid, tid, priority, tag, message. |
The first field to read is omitted_records. A small response is not proof that nothing relevant happened: check it, along with evicted_records and output_truncated, before you conclude.
A small budget in action
Asking for five records within 1,024 bytes on the demo:
tapsift logs --demo --format json --max-bytes 1024 --limit 5The real result, trimmed to show its fields:
{"schema_version":1,"source":"demo","scope":"synthetic","complete_input":true,"records_read":18,"records_retained":18,"retained_text_bytes":2692,"evicted_records":0,"matched_retained_records":18,"matched_records":18,"unparsed_records":0,"truncated_records":0,"omitted_records":14,"output_truncated":true,"events":[ ...4 events, the latest records ... ]}Only 4 of 18 matches fit. omitted_records is 14 and output_truncated is true. A tiny budget can omit a large record entirely. JSON output leaves out duplicate raw text and reports the omission.
Errors and exit codes
A source error prints a message on stderr and exits nonzero. Machine output stays on stdout.
| You run | You get |
|---|---|
tapsift query with no source | live snapshots require --device SERIAL, exit 1 |
tapsift logs --demo --level X | unknown log priority "X", exit 1 |
tapsift logs --demo --limit 0 | --limit must be 1..2000, exit 1 |
tapsift query --file missing.log | stat missing.log: no such file or directory, exit 1 |
Limits
- Snapshots are finite: current Android buffers, or the last five minutes of persisted iOS Simulator logs. Use the TUI for live capture.
- Live-source snapshots have a 30-second deadline.
--file PATHtakes a regular file. Directories and named pipes are rejected. Use--file -for stdin.- A snapshot is not complete history: retention, disconnects and producer-side loss apply.
- Output is deterministic data reduction. TapSift makes no claim about the size of the saving.