Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.20"
".": "0.1.0-alpha.21"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 15
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-ddcc03297d5649ca543ccff5be72ca1c148696cdddf63cb640e3f8a9b86ab59e.yml
openapi_spec_hash: 2870606e51060e9080104b1089f28b83
config_hash: 3390d0ac1f2bb2f8e759f7758d1312c7
configured_endpoints: 16
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-0eed0c3c47bb630ed692f2de1c5228e3e1a29f52489851aecc0b9f9f3b5bce61.yml
openapi_spec_hash: c62aa08b1662b81b6ede9e298e4f1882
config_hash: 8a921dfc8d183e865a02718de6783412
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.1.0-alpha.21 (2025-06-23)

Full Changelog: [v0.1.0-alpha.20...v0.1.0-alpha.21](https://github.com/stainless-api/stainless-api-cli/compare/v0.1.0-alpha.20...v0.1.0-alpha.21)

### Features

* **api:** add diagnostics endpoint ([5bb2beb](https://github.com/stainless-api/stainless-api-cli/commit/5bb2beb07061e9699818db4858c1634223bcaf3d))


### Chores

* bump go sdk version ([a72a797](https://github.com/stainless-api/stainless-api-cli/commit/a72a79734aa7afd8fe25ae80ff963e688a55ede0))

## 0.1.0-alpha.20 (2025-06-23)

Full Changelog: [v0.1.0-alpha.19...v0.1.0-alpha.20](https://github.com/stainless-api/stainless-api-cli/compare/v0.1.0-alpha.19...v0.1.0-alpha.20)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/charmbracelet/lipgloss v1.1.0
github.com/logrusorgru/aurora/v4 v4.0.0
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
github.com/stainless-api/stainless-api-go v0.9.0
github.com/stainless-api/stainless-api-go v0.10.0
github.com/tidwall/gjson v1.17.0
github.com/tidwall/pretty v1.2.1
github.com/tidwall/sjson v1.2.5
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/stainless-api/stainless-api-go v0.9.0 h1:HlPcGQT6FX1/oPhpJTo46uBAjgwmUdzW7S97fMD0Gp0=
github.com/stainless-api/stainless-api-go v0.9.0/go.mod h1:9Q2t8xq6EFgw8HYOsVxqKEfSDVe9eqCoh1zC0HMRwTY=
github.com/stainless-api/stainless-api-go v0.10.0 h1:OYfOwfvAmGtr+7aaV8WaxYoYtVIcj8nzQBQyuTocHOc=
github.com/stainless-api/stainless-api-go v0.10.0/go.mod h1:9Q2t8xq6EFgw8HYOsVxqKEfSDVe9eqCoh1zC0HMRwTY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tidwall/gjson v1.14.2/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
Expand Down
78 changes: 78 additions & 0 deletions pkg/cmd/builddiagnostic.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

package cmd

import (
"context"
"fmt"
"os"

"github.com/stainless-api/stainless-api-cli/pkg/jsonflag"
"github.com/stainless-api/stainless-api-go"
"github.com/stainless-api/stainless-api-go/option"
"github.com/urfave/cli/v3"
)

var buildsDiagnosticsList = cli.Command{
Name: "list",
Usage: "Get diagnostics for a build",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "build-id",
},
&jsonflag.JSONStringFlag{
Name: "cursor",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Query,
Path: "cursor",
},
},
&jsonflag.JSONFloatFlag{
Name: "limit",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Query,
Path: "limit",
},
},
&jsonflag.JSONStringFlag{
Name: "severity",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Query,
Path: "severity",
},
},
&jsonflag.JSONStringFlag{
Name: "targets",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Query,
Path: "targets.#",
},
},
&jsonflag.JSONStringFlag{
Name: "+target",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Query,
Path: "targets.-1",
},
},
},
Action: handleBuildsDiagnosticsList,
HideHelpCommand: true,
}

func handleBuildsDiagnosticsList(ctx context.Context, cmd *cli.Command) error {
cc := getAPICommandContext(cmd)
params := stainlessv0.BuildDiagnosticListParams{}
res, err := cc.client.Builds.Diagnostics.List(
context.TODO(),
cmd.Value("build-id").(string),
params,
option.WithMiddleware(cc.AsMiddleware()),
)
if err != nil {
return err
}

fmt.Printf("%s\n", ColorizeJSON(res.RawJSON(), os.Stdout))
return nil
}
7 changes: 7 additions & 0 deletions pkg/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ var Command = cli.Command{
},
},

{
Name: "builds:diagnostics",
Commands: []*cli.Command{
&buildsDiagnosticsList,
},
},

{
Name: "builds:target_outputs",
Commands: []*cli.Command{
Expand Down