Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 yukifoo
Copyright (c) 2024 Exafunction

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Claude Code SDK for Go

[![Go Reference](https://pkg.go.dev/badge/github.com/yukifoo/claude-code-sdk-go.svg)](https://pkg.go.dev/github.com/yukifoo/claude-code-sdk-go)
[![Go Report Card](https://goreportcard.com/badge/github.com/yukifoo/claude-code-sdk-go)](https://goreportcard.com/report/github.com/yukifoo/claude-code-sdk-go)
[![Go Reference](https://pkg.go.dev/badge/github.com/Exafunction/claude-code-sdk-go.svg)](https://pkg.go.dev/github.com/Exafunction/claude-code-sdk-go)
[![Go Report Card](https://goreportcard.com/badge/github.com/Exafunction/claude-code-sdk-go)](https://goreportcard.com/report/github.com/Exafunction/claude-code-sdk-go)

A Go SDK for Claude Code that provides programmatic access to Claude's agentic coding capabilities. This SDK wraps the Claude Code CLI and provides a Go-native interface compatible with the TypeScript and Python SDKs.

Expand All @@ -25,7 +25,7 @@ A Go SDK for Claude Code that provides programmatic access to Claude's agentic c
## Installation

```bash
go get github.com/yukifoo/claude-code-sdk-go
go get github.com/Exafunction/claude-code-sdk-go
```

## Quick Start
Expand All @@ -40,7 +40,7 @@ import (
"fmt"
"log"

claudecode "github.com/yukifoo/claude-code-sdk-go"
claudecode "github.com/Exafunction/claude-code-sdk-go"
)

func main() {
Expand Down Expand Up @@ -86,7 +86,7 @@ import (
"fmt"
"log"

claudecode "github.com/yukifoo/claude-code-sdk-go"
claudecode "github.com/Exafunction/claude-code-sdk-go"
)

func main() {
Expand Down Expand Up @@ -409,4 +409,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
- [Claude Code Documentation](https://docs.anthropic.com/en/docs/claude-code)
- [Claude Code CLI](https://www.npmjs.com/package/@anthropic-ai/claude-code)
- [Claude Code TypeScript SDK](https://www.npmjs.com/package/@anthropic-ai/claude-code)
- [Claude Code Python SDK](https://pypi.org/project/claude-code-sdk/)
- [Claude Code Python SDK](https://pypi.org/project/claude-code-sdk/)
4 changes: 2 additions & 2 deletions examples/advanced/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

claudecode "github.com/yukifoo/claude-code-sdk-go"
claudecode "github.com/Exafunction/claude-code-sdk-go"
)

func main() {
Expand Down Expand Up @@ -210,4 +210,4 @@ func boolPtr(b bool) *bool {

func outputFormatPtr(format claudecode.OutputFormat) *claudecode.OutputFormat {
return &format
}
}
4 changes: 2 additions & 2 deletions examples/basic/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

claudecode "github.com/yukifoo/claude-code-sdk-go"
claudecode "github.com/Exafunction/claude-code-sdk-go"
)

func main() {
Expand Down Expand Up @@ -69,4 +69,4 @@ func stringPtr(s string) *string {

func outputFormatPtr(format claudecode.OutputFormat) *claudecode.OutputFormat {
return &format
}
}
6 changes: 4 additions & 2 deletions examples/go.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module github.com/yukifoo/claude-code-sdk-go/examples
module github.com/Exafunction/claude-code-sdk-go/examples

go 1.21

require github.com/yukifoo/claude-code-sdk-go v0.0.0-20250618104949-578ca6b454e8
require github.com/Exafunction/claude-code-sdk-go v0.0.0-00010101000000-000000000000

replace github.com/Exafunction/claude-code-sdk-go => ../
8 changes: 4 additions & 4 deletions examples/quick_start.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

claudecode "github.com/yukifoo/claude-code-sdk-go"
claudecode "github.com/Exafunction/claude-code-sdk-go"
)

// basicExample demonstrates a simple question
Expand Down Expand Up @@ -88,8 +88,8 @@ func withToolsExample(ctx context.Context) {
}
}
case *claudecode.ResultMessage:
if msg.CostUSD > 0 {
fmt.Printf("\nCost: $%.4f\n", msg.CostUSD)
if msg.TotalCostUSD != nil && *msg.TotalCostUSD > 0 {
fmt.Printf("\nCost: $%.4f\n", *msg.TotalCostUSD)
}
}
}
Expand All @@ -115,4 +115,4 @@ func intPtr(i int) *int {

func stringPtr(s string) *string {
return &s
}
}
4 changes: 2 additions & 2 deletions examples/streaming/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"log"

claudecode "github.com/yukifoo/claude-code-sdk-go"
claudecode "github.com/Exafunction/claude-code-sdk-go"
)

func main() {
Expand Down Expand Up @@ -114,4 +114,4 @@ func boolPtr(b bool) *bool {

func outputFormatPtr(format claudecode.OutputFormat) *claudecode.OutputFormat {
return &format
}
}
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github.com/yukifoo/claude-code-sdk-go
module github.com/Exafunction/claude-code-sdk-go

go 1.21