DocsCLI reference and snapshots
On this page

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 adb and a device. They read the current Android log buffers.
  • Command examples use tapsift. A source build runs as ./bin/tapsift.

Commands

CommandWhat it does
tapsift or tapsift tuiOpen the interactive workspace. Live capture happens here.
tapsift queryFinite snapshot as compact JSON: counts, top tags and recurring exact error messages.
tapsift logsFinite snapshot as bounded records. Text by default, JSON with --format json.
tapsift dumpWrite a replayable raw snapshot plus a metadata sidecar.
tapsift targetsList Android devices, Android Virtual Devices and iOS Simulators as JSON.
tapsift devicesList connected Android devices.
tapsift appsList installed apps for a device.
tapsift boot / tapsift wakeStart an emulator or simulator / send the Android wake key. See Devices.
tapsift historylist saved sessions or show --id ID. See History.
tapsift favoritesPrint your saved favorites and remembered selections as JSON. This is local data about your own devices and apps.
tapsift versionPrint 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:

SourceFlags
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

FlagMeaningDefault and range
--level LEVELMinimum severity: all, V, D, I, W, E or F. all also includes unparsed lines.V
--tag TAGExact tag. Repeat for OR.none
--text TEXTCase-insensitive substring of message or tag.none
--regex PATTERNGo regular expression on message or tag.none
--limit NLatest matching records returned.100 (2,000 for dump), range 1 to 2000
--max-bytes NOutput byte budget.16384 (4194304 for dump), range 1024 to 4194304
--format FORMATOutput format: text, json or raw.query: json. logs: text. dump: raw.
--summaryAggregate the retained matches.on for query
--output PATHWrite a new private file. Refuses to overwrite.none
--saveAlso 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 --demo

Bounded 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.log

In 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.

FieldMeaning
schema_versionVersion of this JSON shape. Currently 1.
sourceWhere records came from: demo, file, history and so on.
scopeWhat the records cover. synthetic for the demo, offline_unscoped for a file, and the app scope for a live capture.
complete_inputWhether the whole input was read.
records_readRecords read from the source.
matched_recordsRecords that passed your filters.
records_retained, matched_retained_recordsRecords held after the retention caps.
evicted_recordsRecords pushed out by the retention caps.
unparsed_recordsLines that were not valid threadtime records. Use --level all to include them.
truncated_recordsRecords cut at 64 KiB.
omitted_recordsMatching records left out of this output by --limit or --max-bytes.
output_truncatedTrue when the byte budget cut the output.
summaryquery only: totals, by_priority, top_tags, and error_groups with count, first and last.
eventslogs --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 5

The 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 runYou get
tapsift query with no sourcelive snapshots require --device SERIAL, exit 1
tapsift logs --demo --level Xunknown log priority "X", exit 1
tapsift logs --demo --limit 0--limit must be 1..2000, exit 1
tapsift query --file missing.logstat 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 PATH takes 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.