scorpiox-emit-session captures and transmits telemetry events from AI-assisted coding sessions. Each invocation emits a single structured message representing a user prompt, assistant response, tool call, or tool result. Events are tagged with session ID, sequence number, provider, model, project, and branch metadata. This enables full session replay, usage analytics, cost tracking, and audit logging across all supported AI providers.
| Flag | Short | Description | Takes Value |
|---|---|---|---|
--session |
-s |
Session ID (required) | Yes |
--seq |
— |
Message sequence number | Yes |
--type |
— |
Message type: user, assistant, tool_call, tool_result | Yes |
--text |
— |
Message text (inline) | Yes |
--file |
— |
Read message text from file (for large content) | Yes |
--provider |
— |
Provider name | Yes |
--model |
— |
Model name | Yes |
--project |
— |
Project name (default: basename of cwd) | Yes |
--branch |
— |
Git branch (default: auto-detect) | Yes |
# Emit a user prompt as event #1 in session abc-123
scorpiox-emit-session --session abc-123 --seq 1 --type user \
--text "Fix the null pointer dereference in parser.c"
# Record the assistant reply with provider and model info
scorpiox-emit-session --session abc-123 --seq 2 --type assistant \
--text "I found the issue on line 42..." \
--provider claude_code --model opus
# Record that the assistant invoked a tool
scorpiox-emit-session --session abc-123 --seq 3 --type tool_call \
--text '{"tool":"Bash","command":"grep -n NULL parser.c"}'
# For large tool outputs, read from a file instead of inline
scorpiox-emit-session --session abc-123 --seq 4 --type tool_result \
--file /tmp/grep_output.txt
# Emit with full metadata — project and branch auto-detected if omitted
scorpiox-emit-session --session ses_20260529_1005 --seq 1 \
--type user --text "Refactor the auth middleware" \
--provider claude_code --model opus \
--project my-api --branch feature/auth-refactor
# Generate a session ID and emit sequenced events in a script
SID="ses_$(date +%s)"
scorpiox-emit-session -s "$SID" --seq 1 --type user --text "$PROMPT"
scorpiox-emit-session -s "$SID" --seq 2 --type assistant --file /tmp/response.md
scorpiox-emit-session -s "$SID" --seq 3 --type tool_call --text "$TOOL_JSON"
scorpiox-emit-session -s "$SID" --seq 4 --type tool_result --file /tmp/result.txt
scorpiox/scorpiox-emit-session.clibcurl · libsxhttp · libsxutil