Skip to content

Commit 2a7b932

Browse files
authored
Merge pull request #362 from depot/billy/feat/depot-claude
feat: initial implementation of the `depot claude` command
2 parents aff9200 + b7d68a1 commit 2a7b932

File tree

7 files changed

+1490
-1
lines changed

7 files changed

+1490
-1
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ require (
2525
github.com/docker/go-connections v0.4.0
2626
github.com/docker/go-units v0.5.0
2727
github.com/erikgeiser/promptkit v0.9.0
28+
github.com/fsnotify/fsnotify v1.6.0
2829
github.com/getsentry/sentry-go v0.13.0
2930
github.com/gogo/protobuf v1.3.2
3031
github.com/hashicorp/go-cty-funcs v0.0.0-20200930094925-2721b1e36840
@@ -89,7 +90,6 @@ require (
8990
github.com/docker/go-metrics v0.0.1 // indirect
9091
github.com/fatih/color v1.13.0 // indirect
9192
github.com/felixge/httpsnoop v1.0.4 // indirect
92-
github.com/fsnotify/fsnotify v1.6.0 // indirect
9393
github.com/fvbommel/sortorder v1.0.1 // indirect
9494
github.com/go-logr/logr v1.3.0 // indirect
9595
github.com/go-logr/stdr v1.2.2 // indirect

pkg/api/rpc.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"buf.build/gen/go/depot/api/connectrpc/go/depot/core/v1/corev1connect"
88
"connectrpc.com/connect"
9+
"github.com/depot/cli/pkg/proto/depot/agent/v1/agentv1connect"
910
"github.com/depot/cli/pkg/proto/depot/cli/v1/cliv1connect"
1011
"github.com/depot/cli/pkg/proto/depot/cli/v1beta1/cliv1beta1connect"
1112
)
@@ -50,6 +51,14 @@ func NewPushClient() cliv1connect.PushServiceClient {
5051
return cliv1connect.NewPushServiceClient(http.DefaultClient, baseURL, WithUserAgent())
5152
}
5253

54+
func NewClaudeClient() agentv1connect.ClaudeServiceClient {
55+
baseURL := os.Getenv("DEPOT_API_URL")
56+
if baseURL == "" {
57+
baseURL = "https://api.depot.dev"
58+
}
59+
return agentv1connect.NewClaudeServiceClient(http.DefaultClient, baseURL, WithUserAgent())
60+
}
61+
5362
func WithAuthentication[T any](req *connect.Request[T], token string) *connect.Request[T] {
5463
req.Header().Add("Authorization", "Bearer "+token)
5564
return req

0 commit comments

Comments
 (0)