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.49"
".": "0.1.0-alpha.50"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 19
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-5c1008fd27f64bcde1a146a4158f1c3113b4e13437a4d880bd6811fb063cfcd6.yml
openapi_spec_hash: 9583f62164b5dc15b10051dad6a7fca4
config_hash: e895f7992a607a15865ed026cbe5470d
configured_endpoints: 20
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-030e47a1bfd79a657974f5beddd685940ec04b1aa1786c3b2cb0f4610ad2b42c.yml
openapi_spec_hash: 33b337af28bcc1c9aa1a5218acf2a7fe
config_hash: 6b235571b537b4814a33a1008b443e36
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## 0.1.0-alpha.50 (2025-10-23)

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

### Features

* arguments now have defaults and descriptions ([9b8d534](https://github.com/stainless-api/stainless-api-cli/commit/9b8d534c8b92ae4f03dda9ac12e80c0574a0642d))
* Expose connection-specific decorated OAS ([abf1d87](https://github.com/stainless-api/stainless-api-cli/commit/abf1d87e0af1e8f77405873c1ddf36f5070f897c))


### Bug Fixes

* pass through context parameter correctly ([29182fd](https://github.com/stainless-api/stainless-api-cli/commit/29182fdae10f5f91e3b8d0f90234f4e330572c9d))


### Chores

* bump go sdk version ([358eed4](https://github.com/stainless-api/stainless-api-cli/commit/358eed41b58f7bacf6d5ce340795d251fa1803c3))
* bump Go version ([84c6127](https://github.com/stainless-api/stainless-api-cli/commit/84c612747d1a22ee69d3ffca48f7c538b9b44896))
* **internal:** codegen related update ([375ca6b](https://github.com/stainless-api/stainless-api-cli/commit/375ca6ba3c64a74577430abec867b1b9b7c2fe43))

## 0.1.0-alpha.49 (2025-10-06)

Full Changelog: [v0.1.0-alpha.48...v0.1.0-alpha.49](https://github.com/stainless-api/stainless-api-cli/compare/v0.1.0-alpha.48...v0.1.0-alpha.49)
Expand Down
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/stainless-api/stainless-api-cli

go 1.24.0
go 1.25

require (
github.com/charmbracelet/bubbles v0.21.0
Expand All @@ -14,13 +14,13 @@ require (
github.com/logrusorgru/aurora/v4 v4.0.0
github.com/muesli/reflow v0.3.0
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
github.com/stainless-api/stainless-api-go v0.25.0
github.com/stainless-api/stainless-api-go v0.26.0
github.com/tidwall/gjson v1.18.0
github.com/tidwall/pretty v1.2.1
github.com/tidwall/sjson v1.2.5
github.com/urfave/cli-docs/v3 v3.0.0-alpha6
github.com/urfave/cli/v3 v3.3.2
golang.org/x/term v0.35.0
golang.org/x/term v0.36.0
)

require (
Expand Down Expand Up @@ -55,6 +55,6 @@ require (
github.com/yuin/goldmark-emoji v1.0.5 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sync v0.13.0 // indirect
golang.org/x/sys v0.36.0 // indirect
golang.org/x/sys v0.37.0 // indirect
golang.org/x/text v0.24.0 // indirect
)
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/stainless-api/stainless-api-go v0.25.0 h1:zcKI6oXjvw7kK3LoLOwmIxAGT+KzxBlWRyeZUCZ4s4E=
github.com/stainless-api/stainless-api-go v0.25.0/go.mod h1:apIvLQZziUlztAHBzTCLwf2TepwlPV0fg7dy/HIrKf8=
github.com/stainless-api/stainless-api-go v0.26.0 h1:ujHAtKFexP6SbfZ3h6BpiFajo0e4IFu6C66RtPpOkQY=
github.com/stainless-api/stainless-api-go v0.26.0/go.mod h1:apIvLQZziUlztAHBzTCLwf2TepwlPV0fg7dy/HIrKf8=
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 Expand Up @@ -133,10 +133,10 @@ golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k=
golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/term v0.35.0 h1:bZBVKBudEyhRcajGcNc3jIfWPqV4y/Kt2XcoigOWtDQ=
golang.org/x/term v0.35.0/go.mod h1:TPGtkTLesOwf2DE8CgVYiZinHAOuy5AYUYT1lENIZnA=
golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ=
golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
golang.org/x/term v0.36.0 h1:zMPR+aF8gfksFprF/Nc/rd1wRS1EI6nDBGyWAvDzx2Q=
golang.org/x/term v0.36.0/go.mod h1:Qu394IJq6V6dCBRgwqshf3mPF85AqzYEzofzRdZkWss=
golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
76 changes: 50 additions & 26 deletions pkg/cmd/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,16 @@ var buildsCreate = cli.Command{
Usage: "Create a build, on top of a project branch, against a given input revision.",
Flags: []cli.Flag{
&jsonflag.JSONStringFlag{
Name: "project",
Name: "project",
Usage: "Project name",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Body,
Path: "project",
},
},
&jsonflag.JSONStringFlag{
Name: "revision",
Name: "revision",
Usage: `A branch name, commit SHA, or merge command in the format "base..head"`,
Config: jsonflag.JSONConfig{
Kind: jsonflag.Body,
Path: "revision",
Expand All @@ -260,29 +262,34 @@ var buildsCreate = cli.Command{
Usage: "Pull the build outputs after completion (only works with --wait)",
},
&jsonflag.JSONBoolFlag{
Name: "allow-empty",
Name: "allow-empty",
Usage: "Whether to allow empty commits (no changes). Defaults to false.",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Body,
Path: "allow_empty",
SetValue: true,
},
Value: false,
},
&jsonflag.JSONStringFlag{
Name: "branch",
Name: "branch",
Usage: "The project branch to use for the build. If not specified, the\nbranch is inferred from the `revision`, and will 400 when that\nis not possible.",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Body,
Path: "branch",
},
},
&jsonflag.JSONStringFlag{
Name: "commit-message",
Name: "commit-message",
Usage: "Optional commit message to use when creating a new commit.",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Body,
Path: "commit_message",
},
},
&jsonflag.JSONStringFlag{
Name: "targets",
Name: "targets",
Usage: "Optional list of SDK targets to build. If not specified, all configured\ntargets will be built.",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Body,
Path: "targets.#",
Expand All @@ -297,7 +304,8 @@ var buildsCreate = cli.Command{
Hidden: true,
},
&jsonflag.JSONStringFlag{
Name: "+target",
Name: "+target",
Usage: "Optional list of SDK targets to build. If not specified, all configured\ntargets will be built.",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Body,
Path: "targets.-1",
Expand All @@ -313,7 +321,8 @@ var buildsRetrieve = cli.Command{
Usage: "Retrieve a build by its ID.",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "build-id",
Name: "build-id",
Usage: "Build ID",
},
},
Action: handleBuildsRetrieve,
Expand All @@ -325,35 +334,41 @@ var buildsList = cli.Command{
Usage: "List user-triggered builds for a given project.",
Flags: []cli.Flag{
&jsonflag.JSONStringFlag{
Name: "project",
Name: "project",
Usage: "Project name",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Query,
Path: "project",
},
},
&jsonflag.JSONStringFlag{
Name: "branch",
Name: "branch",
Usage: "Branch name",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Query,
Path: "branch",
},
},
&jsonflag.JSONStringFlag{
Name: "cursor",
Name: "cursor",
Usage: "Pagination cursor from a previous response.",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Query,
Path: "cursor",
},
},
&jsonflag.JSONFloatFlag{
Name: "limit",
Name: "limit",
Usage: "Maximum number of builds to return, defaults to 10 (maximum: 100).",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Query,
Path: "limit",
},
Value: 10,
},
&jsonflag.JSONStringFlag{
Name: "revision",
Name: "revision",
Usage: "A config commit SHA used for the build",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Query,
Path: "revision",
Expand All @@ -369,63 +384,72 @@ var buildsCompare = cli.Command{
Usage: "Create two builds whose outputs can be directly compared with each other.",
Flags: []cli.Flag{
&jsonflag.JSONStringFlag{
Name: "base.branch",
Name: "base.branch",
Usage: "Branch to use. When using a branch name as revision, this must match or be\nomitted.",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Body,
Path: "base.branch",
},
},
&jsonflag.JSONStringFlag{
Name: "base.revision",
Name: "base.revision",
Usage: `A branch name, commit SHA, or merge command in the format "base..head"`,
Config: jsonflag.JSONConfig{
Kind: jsonflag.Body,
Path: "base.revision",
},
},
&jsonflag.JSONStringFlag{
Name: "base.commit_message",
Name: "base.commit_message",
Usage: "Optional commit message to use when creating a new commit.",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Body,
Path: "base.commit_message",
},
},
&jsonflag.JSONStringFlag{
Name: "head.branch",
Name: "head.branch",
Usage: "Branch to use. When using a branch name as revision, this must match or be\nomitted.",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Body,
Path: "head.branch",
},
},
&jsonflag.JSONStringFlag{
Name: "head.revision",
Name: "head.revision",
Usage: `A branch name, commit SHA, or merge command in the format "base..head"`,
Config: jsonflag.JSONConfig{
Kind: jsonflag.Body,
Path: "head.revision",
},
},
&jsonflag.JSONStringFlag{
Name: "head.commit_message",
Name: "head.commit_message",
Usage: "Optional commit message to use when creating a new commit.",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Body,
Path: "head.commit_message",
},
},
&jsonflag.JSONStringFlag{
Name: "project",
Name: "project",
Usage: "Project name",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Body,
Path: "project",
},
},
&jsonflag.JSONStringFlag{
Name: "targets",
Name: "targets",
Usage: "Optional list of SDK targets to build. If not specified, all configured\ntargets will be built.",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Body,
Path: "targets.#",
},
},
&jsonflag.JSONStringFlag{
Name: "+target",
Name: "+target",
Usage: "Optional list of SDK targets to build. If not specified, all configured\ntargets will be built.",
Config: jsonflag.JSONConfig{
Kind: jsonflag.Body,
Path: "targets.-1",
Expand Down Expand Up @@ -456,7 +480,7 @@ func handleBuildsCreate(ctx context.Context, cmd *cli.Command) error {
buildGroup := Info("Creating build...")
params := stainless.BuildNewParams{}
res, err := cc.client.Builds.New(
context.TODO(),
ctx,
params,
option.WithMiddleware(cc.AsMiddleware()),
)
Expand Down Expand Up @@ -505,7 +529,7 @@ func handleBuildsRetrieve(ctx context.Context, cmd *cli.Command) error {
}
var res []byte
_, err := cc.client.Builds.Get(
context.TODO(),
ctx,
cmd.Value("build-id").(string),
option.WithMiddleware(cc.AsMiddleware()),
option.WithResponseBodyInto(&res),
Expand Down Expand Up @@ -798,7 +822,7 @@ func handleBuildsList(ctx context.Context, cmd *cli.Command) error {
params := stainless.BuildListParams{}
var res []byte
_, err := cc.client.Builds.List(
context.TODO(),
ctx,
params,
option.WithMiddleware(cc.AsMiddleware()),
option.WithResponseBodyInto(&res),
Expand All @@ -822,7 +846,7 @@ func handleBuildsCompare(ctx context.Context, cmd *cli.Command) error {
params := stainless.BuildCompareParams{}
var res []byte
_, err := cc.client.Builds.Compare(
context.TODO(),
ctx,
params,
option.WithMiddleware(cc.AsMiddleware()),
option.WithResponseBodyInto(&res),
Expand Down
Loading