ClaudeWrapper.Config (ClaudeWrapper v0.4.0)

Copy Markdown View Source

Shared client configuration for the Claude CLI.

Equivalent to the Rust Claude struct — holds binary path, working directory, environment variables, and default options that apply across all commands.

Usage

config = ClaudeWrapper.Config.new()
config = ClaudeWrapper.Config.new(working_dir: "/path/to/project")

Summary

Functions

Build the base command args from config (global flags).

Build the cmd options (working dir, env) for System.cmd/Port.

Find the claude binary path.

Create a new config from keyword options.

Types

t()

@type t() :: %ClaudeWrapper.Config{
  binary: String.t(),
  debug: boolean(),
  env: [{String.t(), String.t()}],
  timeout: pos_integer() | nil,
  verbose: boolean(),
  working_dir: String.t() | nil
}

Functions

base_args(config)

@spec base_args(t()) :: [String.t()]

Build the base command args from config (global flags).

cmd_opts(config)

@spec cmd_opts(t()) :: keyword()

Build the cmd options (working dir, env) for System.cmd/Port.

find_binary()

@spec find_binary() :: String.t()

Find the claude binary path.

Checks in order:

  1. CLAUDE_CLI environment variable
  2. System PATH

new(opts \\ [])

@spec new(keyword()) :: t()

Create a new config from keyword options.

Options

  • :binary - Path to the claude binary (default: auto-discover)
  • :working_dir - Working directory for the subprocess
  • :env - List of {key, value} environment variable tuples
  • :timeout - Command timeout in milliseconds
  • :verbose - Enable verbose output
  • :debug - Enable debug output