claude

package
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

internal/claude/invoker.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Invoker

type Invoker struct {
	// contains filtered or unexported fields
}

Invoker spawns Claude CLI processes. It is stateless and safe for concurrent use.

func NewInvoker

func NewInvoker(binary, mcpBaseURL, apiKey string) *Invoker

NewInvoker creates an Invoker. mcpBaseURL is joined with "/mcp/sse".

func (*Invoker) Run

func (inv *Invoker) Run(ctx context.Context, workDir, prompt string, opts RunOptions) (*Process, <-chan Output, error)

Run starts a Claude CLI process and returns a Process handle and an output channel. The channel is closed after the process exits; the last message is OutputDone or OutputError.

type Output

type Output struct {
	Type    OutputType `json:"type"`
	Content string     `json:"content"`
}

Output is a single output event from a Claude CLI process.

type OutputType

type OutputType string

OutputType classifies a line of output from a Claude CLI process.

const (
	OutputStdout OutputType = "stdout"
	OutputStderr OutputType = "stderr"
	OutputDone   OutputType = "done"
	OutputError  OutputType = "error"
)

type Process

type Process struct {
	// contains filtered or unexported fields
}

Process represents a running Claude CLI invocation.

func (*Process) PID

func (p *Process) PID() int

PID returns the process ID, or 0 if the process has not started.

func (*Process) Stop

func (p *Process) Stop() error

Stop kills the process.

type RunOptions

type RunOptions struct {
	SessionID string
	Resume    bool
}

RunOptions controls session behaviour for a Claude CLI invocation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL