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.3"
".": "0.1.0-alpha.4"
}
6 changes: 3 additions & 3 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-475d7467c6365b48df46bee77ff6a07d22601f7c3a269a0383473e4ebce1146d.yml
openapi_spec_hash: 4b9f1b89f983978e970133b5653fd0d8
config_hash: 28c1ddd1e9bdba67e018459acdfafc5b
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-cfef2e882e091dad51a5b53bc39cc251ecf3f71cc0328561cec6309e8bbac93a.yml
openapi_spec_hash: fac1531252a5b791107de8257fdcf3cb
config_hash: e6d0ab5c40b50d896cdcacb62260c926
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 0.1.0-alpha.4 (2025-05-23)

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

### Features

* **api:** change v0 path param projectName -> project ([f4d71d2](https://github.com/stainless-api/stainless-api-cli/commit/f4d71d2a7329db59b1a9fa6d341619ab0532db6b))
* **api:** manual updates ([ad21d1e](https://github.com/stainless-api/stainless-api-cli/commit/ad21d1e0ee263bda24f88823c31f998295c842a2))
* **api:** manual updates ([2539725](https://github.com/stainless-api/stainless-api-cli/commit/253972559414ee57ef40cfcfc989fd5ea4e4cc27))


### Refactors

* minor refactor of method bodies ([8a3745d](https://github.com/stainless-api/stainless-api-cli/commit/8a3745dd7415ac36eeba2ec8b54e695845ffc9b5))

## 0.1.0-alpha.3 (2025-05-22)

Full Changelog: [v0.1.0-alpha.2...v0.1.0-alpha.3](https://github.com/stainless-api/stainless-api-cli/compare/v0.1.0-alpha.2...v0.1.0-alpha.3)
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ stainless-api-cli [resource] [command] [flags]

```sh
stainless-api-cli builds create \
--project project \
--revision string
```

Expand Down
14 changes: 6 additions & 8 deletions build.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,12 @@ var buildsCompare = cli.Command{

func handleBuildsCreate(ctx context.Context, cmd *cli.Command) error {
cc := getAPICommandContext(ctx, cmd)

// Log to stderr that we're creating a build (using white text)
fmt.Fprintf(os.Stderr, "Creating build...\n")

params := stainlessv0.BuildNewParams{}
res, err := cc.client.Builds.New(
context.TODO(),
stainlessv0.BuildNewParams{},
params,
option.WithMiddleware(cc.AsMiddleware()),
option.WithRequestBody("application/json", cc.body),
)
Expand Down Expand Up @@ -338,7 +337,6 @@ func handleBuildsCreate(ctx context.Context, cmd *cli.Command) error {

func handleBuildsRetrieve(ctx context.Context, cmd *cli.Command) error {
cc := getAPICommandContext(ctx, cmd)

res, err := cc.client.Builds.Get(
context.TODO(),
cmd.Value("build-id").(string),
Expand Down Expand Up @@ -483,10 +481,10 @@ func pullOutput(output, url, ref, targetDir string) error {

func handleBuildsList(ctx context.Context, cmd *cli.Command) error {
cc := getAPICommandContext(ctx, cmd)

params := stainlessv0.BuildListParams{}
res, err := cc.client.Builds.List(
context.TODO(),
stainlessv0.BuildListParams{},
params,
option.WithMiddleware(cc.AsMiddleware()),
)
if err != nil {
Expand All @@ -499,10 +497,10 @@ func handleBuildsList(ctx context.Context, cmd *cli.Command) error {

func handleBuildsCompare(ctx context.Context, cmd *cli.Command) error {
cc := getAPICommandContext(ctx, cmd)

params := stainlessv0.BuildCompareParams{}
res, err := cc.client.Builds.Compare(
context.TODO(),
stainlessv0.BuildCompareParams{},
params,
option.WithMiddleware(cc.AsMiddleware()),
option.WithRequestBody("application/json", cc.body),
)
Expand Down
4 changes: 2 additions & 2 deletions buildtargetoutput.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ var buildTargetOutputsPull = cli.Command{

func handleBuildTargetOutputsRetrieve(ctx context.Context, cmd *cli.Command) error {
cc := getAPICommandContext(ctx, cmd)

params := stainlessv0.BuildTargetOutputGetParams{}
res, err := cc.client.BuildTargetOutputs.Get(
context.TODO(),
stainlessv0.BuildTargetOutputGetParams{},
params,
option.WithMiddleware(cc.AsMiddleware()),
)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ go 1.23.0
toolchain go1.23.9

require (
github.com/stainless-api/stainless-api-go v0.5.1
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.4.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 @@ -6,8 +6,8 @@ github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmd
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c/go.mod h1:7rwL4CYBLnjLxUqIJNnCWiEdr3bn6IUYi15bNlnbCCU=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stainless-api/stainless-api-go v0.4.0 h1:uRuRqXULJEllH3NES3YbCjLngUG8eoRxaFutA1e/wEs=
github.com/stainless-api/stainless-api-go v0.4.0/go.mod h1:9Q2t8xq6EFgw8HYOsVxqKEfSDVe9eqCoh1zC0HMRwTY=
github.com/stainless-api/stainless-api-go v0.5.1 h1:+y/D5G9x7aaPA7AAkXhYSwKUhftz2Mj3D1MzDCymt3k=
github.com/stainless-api/stainless-api-go v0.5.1/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
2 changes: 0 additions & 2 deletions org.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ var orgsList = cli.Command{

func handleOrgsRetrieve(ctx context.Context, cmd *cli.Command) error {
cc := getAPICommandContext(ctx, cmd)

res, err := cc.client.Orgs.Get(
context.TODO(),
cmd.Value("org-name").(string),
Expand All @@ -51,7 +50,6 @@ func handleOrgsRetrieve(ctx context.Context, cmd *cli.Command) error {

func handleOrgsList(ctx context.Context, cmd *cli.Command) error {
cc := getAPICommandContext(ctx, cmd)

res, err := cc.client.Orgs.List(context.TODO(), option.WithMiddleware(cc.AsMiddleware()))
if err != nil {
return err
Expand Down
23 changes: 14 additions & 9 deletions project.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var projectsRetrieve = cli.Command{
Usage: "Retrieve a project by name",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "project-name",
Name: "project",
},
},
Before: initAPICommand,
Expand All @@ -30,7 +30,7 @@ var projectsUpdate = cli.Command{
Usage: "Update a project's properties",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "project-name",
Name: "project",
},
&cli.StringFlag{
Name: "display-name",
Expand Down Expand Up @@ -66,10 +66,13 @@ var projectsList = cli.Command{

func handleProjectsRetrieve(ctx context.Context, cmd *cli.Command) error {
cc := getAPICommandContext(ctx, cmd)

params := stainlessv0.ProjectGetParams{}
if cmd.IsSet("project") {
params.Project = stainlessv0.String(cmd.Value("project").(string))
}
res, err := cc.client.Projects.Get(
context.TODO(),
cmd.Value("project-name").(string),
params,
option.WithMiddleware(cc.AsMiddleware()),
)
if err != nil {
Expand All @@ -82,11 +85,13 @@ func handleProjectsRetrieve(ctx context.Context, cmd *cli.Command) error {

func handleProjectsUpdate(ctx context.Context, cmd *cli.Command) error {
cc := getAPICommandContext(ctx, cmd)

params := stainlessv0.ProjectUpdateParams{}
if cmd.IsSet("project") {
params.Project = stainlessv0.String(cmd.Value("project").(string))
}
res, err := cc.client.Projects.Update(
context.TODO(),
cmd.Value("project-name").(string),
stainlessv0.ProjectUpdateParams{},
params,
option.WithMiddleware(cc.AsMiddleware()),
option.WithRequestBody("application/json", cc.body),
)
Expand All @@ -100,10 +105,10 @@ func handleProjectsUpdate(ctx context.Context, cmd *cli.Command) error {

func handleProjectsList(ctx context.Context, cmd *cli.Command) error {
cc := getAPICommandContext(ctx, cmd)

params := stainlessv0.ProjectListParams{}
res, err := cc.client.Projects.List(
context.TODO(),
stainlessv0.ProjectListParams{},
params,
option.WithMiddleware(cc.AsMiddleware()),
)
if err != nil {
Expand Down
17 changes: 10 additions & 7 deletions projectbranch.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ var projectsBranchesRetrieve = cli.Command{

func handleProjectsBranchesCreate(ctx context.Context, cmd *cli.Command) error {
cc := getAPICommandContext(ctx, cmd)

params := stainlessv0.ProjectBranchNewParams{}
if cmd.IsSet("project") {
params.Project = stainlessv0.String(cmd.Value("project").(string))
}
res, err := cc.client.Projects.Branches.New(
context.TODO(),
cmd.Value("project").(string),
stainlessv0.ProjectBranchNewParams{},
params,
option.WithMiddleware(cc.AsMiddleware()),
option.WithRequestBody("application/json", cc.body),
)
Expand All @@ -73,13 +75,14 @@ func handleProjectsBranchesCreate(ctx context.Context, cmd *cli.Command) error {

func handleProjectsBranchesRetrieve(ctx context.Context, cmd *cli.Command) error {
cc := getAPICommandContext(ctx, cmd)

params := stainlessv0.ProjectBranchGetParams{}
if cmd.IsSet("project") {
params.Project = stainlessv0.String(cmd.Value("project").(string))
}
res, err := cc.client.Projects.Branches.Get(
context.TODO(),
cmd.Value("branch").(string),
stainlessv0.ProjectBranchGetParams {
Project: cmd.Value("project").(string),
},
params,
option.WithMiddleware(cc.AsMiddleware()),
)
if err != nil {
Expand Down
17 changes: 10 additions & 7 deletions projectconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,14 @@ var projectsConfigsGuess = cli.Command{

func handleProjectsConfigsRetrieve(ctx context.Context, cmd *cli.Command) error {
cc := getAPICommandContext(ctx, cmd)


params := stainlessv0.ProjectConfigGetParams{}
if cmd.IsSet("project") {
params.Project = stainlessv0.String(cmd.Value("project").(string))
}
res := []byte{}
_, err := cc.client.Projects.Configs.Get(
context.TODO(),
cmd.Value("project").(string),
stainlessv0.ProjectConfigGetParams{},
params,
option.WithMiddleware(cc.AsMiddleware()),
option.WithResponseBodyInto(&res),
)
Expand All @@ -72,12 +73,14 @@ func handleProjectsConfigsRetrieve(ctx context.Context, cmd *cli.Command) error

func handleProjectsConfigsGuess(ctx context.Context, cmd *cli.Command) error {
cc := getAPICommandContext(ctx, cmd)

params := stainlessv0.ProjectConfigGuessParams{}
if cmd.IsSet("project") {
params.Project = stainlessv0.String(cmd.Value("project").(string))
}
res := []byte{}
_, err := cc.client.Projects.Configs.Guess(
context.TODO(),
cmd.Value("project").(string),
stainlessv0.ProjectConfigGuessParams{},
params,
option.WithMiddleware(cc.AsMiddleware()),
option.WithRequestBody("application/json", cc.body),
option.WithResponseBodyInto(&res),
Expand Down
16 changes: 10 additions & 6 deletions projectsnippet.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ var projectsSnippetsCreateRequest = cli.Command{
&cli.StringFlag{
Name: "project-name",
},
&cli.StringFlag{
Name: "language",
Action: getAPIFlagAction[string]("body", "language"),
},
&cli.StringFlag{
Name: "request.method",
Action: getAPIFlagAction[string]("body", "request.method"),
Expand Down Expand Up @@ -51,6 +47,14 @@ var projectsSnippetsCreateRequest = cli.Command{
Name: "request.body.filePath",
Action: getAPIFlagAction[string]("body", "request.body.filePath"),
},
&cli.BoolFlag{
Name: "har",
Action: getAPIFlagActionWithValue[bool]("body", "har", nil),
},
&cli.StringFlag{
Name: "language",
Action: getAPIFlagAction[string]("body", "language"),
},
&cli.StringFlag{
Name: "version",
Action: getAPIFlagAction[string]("body", "version"),
Expand All @@ -63,11 +67,11 @@ var projectsSnippetsCreateRequest = cli.Command{

func handleProjectsSnippetsCreateRequest(ctx context.Context, cmd *cli.Command) error {
cc := getAPICommandContext(ctx, cmd)

params := stainlessv0.ProjectSnippetNewRequestParams{}
res, err := cc.client.Projects.Snippets.NewRequest(
context.TODO(),
cmd.Value("project-name").(string),
stainlessv0.ProjectSnippetNewRequestParams{},
params,
option.WithMiddleware(cc.AsMiddleware()),
option.WithRequestBody("application/json", cc.body),
)
Expand Down