Lesson 13.1

CLI basics

The Arcsentry command line: commands and help, case and evidence UUIDs, output formats, exit codes and the ARCSENTRY_DATA_DIR data folder.

12 minExperienced analysts
At a glance for experienced analysts
  • Every command names its case with --case <uuid>. There is no current case. UUIDs come from case list and evidence list.
  • --format is json, jsonl, csv or table. Progress goes to stderr, so stdout stays parseable.
  • Exit codes say why a command failed: 2 refused command line, 3 needs confirmation, 13 query or arrow refused, 14 evidence not available, 17 case in use.
Command line
arcsentry case list --format table

Everything in the app can be done from the command line, except the AI investigator. That makes Arcsentry scriptable: triage at scale, scheduled checks, and pipelines that feed other tools.

Finding your way

arcsentry --help              # every command, grouped
arcsentry query --help        # one command, with worked examples
arcsentry --version

The full list, with every option and example, is in the command-line reference.

Cases and evidence by UUID

arcsentry case list --format table
arcsentry evidence list --case 4f9a2c18-3b7e-4d51-9a20-6c1f8e35b7d2 --format table

A case is identified only by its UUID. Paths and names can change; the UUID does not. In a script, keep it in a variable:

CASE=$(arcsentry case create --name "Portal breach" --path /cases/portal --format json | jq -r .id)

Output formats

--format Use it for
table Reading in a terminal
json One page as an object with items, total and a cursor for the next page
jsonl One record per line, every page, as it arrives: pipes and large exports
csv Spreadsheets and reports

Progress messages and notices go to stderr, so you can redirect stdout to a file without cleaning it.

Exit codes

Code Meaning
0 Done
1 Failed, cause not identified
2 The command line was refused: unknown command, flag or value
3 Needs your confirmation and did not get it; nothing changed
10 / 11 A file you named does not exist / cannot be read
12 The output could not be written
13 The query, arrow or arrow id was refused before it ran
14 The evidence or records the command needs are not in the case
15 Evidence is still being analysed
17 The case is in use by another Arcsentry program
20 / 21 Ran out of time / was stopped

The reference lists them all. A script should check the code, not parse the message.

The data folder

Arcsentry keeps its settings, case list and logs in a data folder named after the version: %APPDATA%\arcsentry-<version> on Windows, ~/.local/share/arcsentry-<version> on Linux. Set ARCSENTRY_DATA_DIR to use another one, for example a separate folder for automated runs:

export ARCSENTRY_DATA_DIR=/srv/arcsentry-automation

Check yourself

1. A script runs arcsentry query … and gets exit code 13. What happened?
2. How does the CLI know which case to work on?

Try it

List your cases, find the practice case's UUID, list its evidence, and run a query that names a field that does not exist. What exit code do you get, and what does the error suggest?

Show the answer

arcsentry case list --format table, then arcsentry evidence list --case <uuid> --format table shows db01 (24,927 records) and web01 (37,368). A query such as filter event_type == "bash_history" | select {command} exits with 13, and the message says command is not a field of Command History records and suggests process_command_line.

Progress is saved in this browser only.