it2 artifact append

Append data to a JSONL artifact

Synopsis

it2 artifact append <session-id> <artifact-name> <data> [flags]

Description

Append a JSON line to a JSONL (JSON Lines) artifact file.

JSONL files are newline-delimited JSON, where each line is a valid JSON object.
This is ideal for:

  • Event logs (command executions, notifications, state changes)
  • Time-series data
  • Append-only logs that can be streamed and processed line-by-line

If the artifact doesn't exist, it will be created.
Each line is automatically timestamped.

Examples:

Append a send-text event

$ it2 artifact append sess_abc123 it2_send-text \
'{"source":"sess_abc","dest":"sess_def","text":"echo hello"}'

Append a state change

$ it2 artifact append sess_abc123 state-changes \
'{"component":"session","old":"idle","new":"exec"}'

Append from stdin

$ echo '{"event":"completed"}' | it2 artifact append sess_abc123 events -

Append with auto-timestamp

$ it2 artifact append sess_abc123 commands \
'{"command":"session split","args":["--horizontal"]}'

Options

--timestamp (default true)

Automatically add timestamp field

Options inherited from parent commands

--format (default "text")

Output format (text, json, yaml) - affects how command results are displayed

--timeout

Timeout for API operations - how long to wait for iTerm2 to respond

--url

WebSocket URL for iTerm2 API - typically ws://localhost:1912 for local iTerm2

See Also