ClaudeCodeSDK.Process (claude_code_sdk v0.0.1)

View Source

Handles spawning and communicating with the Claude Code CLI process using erlexec.

This module manages the lifecycle of Claude CLI subprocess execution:

  • Starting the CLI process with proper arguments
  • Capturing and parsing JSON output from stdout/stderr
  • Converting the output into a stream of ClaudeCodeSDK.Message structs
  • Handling errors and cleanup

The module uses erlexec's synchronous execution mode to capture all output at once, then converts it to a lazy stream for consumption.

Summary

Functions

Streams messages from Claude Code CLI using erlexec.

Functions

stream(args, options, stdin_input \\ nil)

Streams messages from Claude Code CLI using erlexec.

Parameters

Returns

A stream of ClaudeCodeSDK.Message.t/0 structs.

Examples

ClaudeCodeSDK.Process.stream(["--print", "Hello"], %ClaudeCodeSDK.Options{})