ClaudeCode.Message.SystemMessage.LocalCommandOutput (ClaudeCode v0.36.3)

View Source

Represents a local command output message from the Claude CLI.

Emitted when the CLI produces output from a local command execution.

Fields

  • :content - The command output content string
  • :uuid - Message UUID
  • :session_id - Session identifier

JSON Format

{
  "type": "system",
  "subtype": "local_command_output",
  "content": "command output here",
  "uuid": "...",
  "session_id": "..."
}

Summary

Functions

Type guard to check if a value is a LocalCommandOutput.

Creates a new LocalCommandOutput from JSON data.

Types

t()

@type t() :: %ClaudeCode.Message.SystemMessage.LocalCommandOutput{
  content: String.t(),
  session_id: String.t(),
  subtype: :local_command_output,
  type: :system,
  uuid: String.t() | nil
}

Functions

local_command_output?(arg1)

@spec local_command_output?(any()) :: boolean()

Type guard to check if a value is a LocalCommandOutput.

new(json)

@spec new(map()) :: {:ok, t()} | {:error, atom()}

Creates a new LocalCommandOutput from JSON data.

Examples

iex> LocalCommandOutput.new(%{
...>   "type" => "system",
...>   "subtype" => "local_command_output",
...>   "content" => "output text",
...>   "session_id" => "session-1"
...> })
{:ok, %LocalCommandOutput{type: :system, subtype: :local_command_output, ...}}

iex> LocalCommandOutput.new(%{"type" => "assistant"})
{:error, :invalid_message_type}