Skip to content

Commit 7840ca6

Browse files
authored
Merge pull request #129 from stainless-api/release-please--branches--main--changes--next
release: 0.1.0-alpha.89
2 parents 6b1d87b + 13f7134 commit 7840ca6

52 files changed

Lines changed: 2739 additions & 332 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Setup Go
2+
description: 'Sets up Go environment with private modules'
3+
inputs:
4+
stainless-api-key:
5+
required: false
6+
description: the value of the STAINLESS_API_KEY secret
7+
runs:
8+
using: composite
9+
steps:
10+
- uses: stainless-api/retrieve-github-access-token@1f03f929b746c5b03dcdafa2bebbb18ca5672e1a # v1.0.0
11+
if: github.repository == 'stainless-sdks/stainless-v0-cli'
12+
id: get_token
13+
with:
14+
repo: stainless-sdks/stainless-v0-go
15+
stainless-api-key: ${{ inputs.stainless-api-key }}
16+
17+
- name: Configure Git for access to the Go SDK's staging repo
18+
if: github.repository == 'stainless-sdks/stainless-v0-cli'
19+
shell: bash
20+
run: git config --global url."https://x-access-token:${{ steps.get_token.outputs.github_access_token }}@github.com/stainless-sdks/stainless-v0-go".insteadOf "https://github.com/stainless-sdks/stainless-v0-go"
21+
22+
- name: Setup go
23+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
24+
with:
25+
go-version-file: ./go.mod
26+
27+
- name: Bootstrap
28+
shell: bash
29+
run: ./scripts/bootstrap

.github/workflows/ci.yml

Lines changed: 39 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,40 @@
11
name: CI
22
on:
33
push:
4-
branches-ignore:
5-
- 'generated'
6-
- 'codegen/**'
7-
- 'integrated/**'
8-
- 'stl-preview-head/**'
9-
- 'stl-preview-base/**'
4+
branches:
5+
- '**'
6+
- '!integrated/**'
7+
- '!stl-preview-head/**'
8+
- '!stl-preview-base/**'
9+
- '!generated'
10+
- '!codegen/**'
11+
- 'codegen/stl/**'
1012
pull_request:
1113
branches-ignore:
1214
- 'stl-preview-head/**'
1315
- 'stl-preview-base/**'
1416

17+
env:
18+
GOPRIVATE: github.com/stainless-api/stainless-api-go,github.com/stainless-sdks/stainless-v0-go
19+
1520
jobs:
1621
lint:
1722
timeout-minutes: 10
1823
name: lint
1924
runs-on: ${{ github.repository == 'stainless-sdks/stainless-v0-cli' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20-
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
25+
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
2126

2227
steps:
23-
- uses: actions/checkout@v6
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2429

25-
- name: Setup go
26-
uses: actions/setup-go@v5
30+
- uses: ./.github/actions/setup-go
2731
with:
28-
go-version-file: ./go.mod
32+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
33+
34+
- name: Link staging branch
35+
if: github.repository == 'stainless-sdks/stainless-v0-cli'
36+
run: |
37+
./scripts/link 'github.com/stainless-sdks/stainless-v0-go@${{ github.ref_name }}' || true
2938
3039
- name: Bootstrap
3140
run: ./scripts/bootstrap
@@ -40,20 +49,24 @@ jobs:
4049
contents: read
4150
id-token: write
4251
runs-on: ${{ github.repository == 'stainless-sdks/stainless-v0-cli' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
43-
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
52+
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
4453
steps:
45-
- uses: actions/checkout@v6
54+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
4655

47-
- name: Setup go
48-
uses: actions/setup-go@v5
56+
- uses: ./.github/actions/setup-go
4957
with:
50-
go-version-file: ./go.mod
58+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
59+
60+
- name: Link staging branch
61+
if: github.repository == 'stainless-sdks/stainless-v0-cli'
62+
run: |
63+
./scripts/link 'github.com/stainless-sdks/stainless-v0-go@${{ github.ref_name }}' || true
5164
5265
- name: Bootstrap
5366
run: ./scripts/bootstrap
5467

5568
- name: Run goreleaser
56-
uses: goreleaser/goreleaser-action@v6.1.0
69+
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
5770
with:
5871
version: latest
5972
args: release --snapshot --clean --skip=publish
@@ -65,7 +78,7 @@ jobs:
6578
github.repository == 'stainless-sdks/stainless-v0-cli' &&
6679
!startsWith(github.ref, 'refs/heads/stl/')
6780
id: github-oidc
68-
uses: actions/github-script@v8
81+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
6982
with:
7083
script: core.setOutput('github_token', await core.getIDToken());
7184

@@ -85,12 +98,16 @@ jobs:
8598
runs-on: ${{ github.repository == 'stainless-sdks/stainless-v0-cli' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
8699
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
87100
steps:
88-
- uses: actions/checkout@v6
101+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
89102

90-
- name: Setup go
91-
uses: actions/setup-go@v5
103+
- uses: ./.github/actions/setup-go
92104
with:
93-
go-version-file: ./go.mod
105+
stainless-api-key: ${{ secrets.STAINLESS_API_KEY }}
106+
107+
- name: Link staging branch
108+
if: github.repository == 'stainless-sdks/stainless-v0-cli'
109+
run: |
110+
./scripts/link 'github.com/stainless-sdks/stainless-v0-go@${{ github.ref_name }}' || true
94111
95112
- name: Bootstrap
96113
run: ./scripts/bootstrap

.github/workflows/publish-release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,21 @@ on:
1010
push:
1111
tags:
1212
- "v*"
13+
workflow_dispatch: {}
1314
jobs:
1415
goreleaser:
1516
runs-on: ubuntu-latest
1617
steps:
1718
- name: Checkout
18-
uses: actions/checkout@v6
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1920
with:
2021
fetch-depth: 0
2122
- name: Set up Go
22-
uses: actions/setup-go@v5
23+
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
2324
with:
2425
go-version-file: "go.mod"
2526
- name: Run GoReleaser
26-
uses: goreleaser/goreleaser-action@v6.1.0
27+
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
2728
with:
2829
version: latest
2930
args: release --clean

.github/workflows/release-doctor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
if: github.repository == 'stainless-api/stainless-api-cli' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')
1313

1414
steps:
15-
- uses: actions/checkout@v6
15+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1616

1717
- name: Check release environment
1818
run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.prism.log
2+
.stdy.log
23
dist/
34
/stl
45
*.exe

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.1.0-alpha.88"
2+
".": "0.1.0-alpha.89"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 22
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless%2Fstainless-v0-ef33241ec003fafbf4f2ffe434c3d8c2ac0ba929137942185663ff59974d2138.yml
3-
openapi_spec_hash: 87bd0d9c684517522cbbbd48bbe8ad83
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/stainless/stainless-v0-4ec3b12ce6b2e1e2eb800fab7dea5fc272c8c7aaf364a5305af5f4eda95e07b3.yml
3+
openapi_spec_hash: 8e661d2611da4f7d874cafe22cda765d
44
config_hash: 63178ec4b1d2ea5636c8619cffcf129b

CHANGELOG.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,76 @@
11
# Changelog
22

3+
## 0.1.0-alpha.89 (2026-05-30)
4+
5+
Full Changelog: [v0.1.0-alpha.88...v0.1.0-alpha.89](https://github.com/stainless-api/stainless-api-cli/compare/v0.1.0-alpha.88...v0.1.0-alpha.89)
6+
7+
### Features
8+
9+
* add default description for enum CLI flags without an explicit description ([5b91b33](https://github.com/stainless-api/stainless-api-cli/commit/5b91b33fd7cf5b97dda36bd1d3e17c2ec8bf29c7))
10+
* allow `-` as value representing stdin to binary-only file parameters in CLIs ([0d07ef3](https://github.com/stainless-api/stainless-api-cli/commit/0d07ef3b5ef233f4ab4b8c44c91d40d791ca86ac))
11+
* allow direct upload of spec/config to v0 builds api when merging/rebasing ([4e9115f](https://github.com/stainless-api/stainless-api-cli/commit/4e9115f6074ad2c6356ed330a15b245452962112))
12+
* better error message if scheme forgotten in CLI `*_BASE_URL`/`--base-url` ([c2f424c](https://github.com/stainless-api/stainless-api-cli/commit/c2f424c416c494f32903a2147f3b20902162b6f8))
13+
* binary-only parameters become CLI flags that take filenames only ([deb778e](https://github.com/stainless-api/stainless-api-cli/commit/deb778e2d68de2f0461925b7f59cff667d126dd9))
14+
* **cli:** add `--raw-output`/`-r` option to print raw (non-JSON) strings ([fa6f042](https://github.com/stainless-api/stainless-api-cli/commit/fa6f042c21023d4f6dcc4f6df9df82ceff7b4731))
15+
* **cli:** alias parameters in data with `x-stainless-cli-data-alias` ([63cb8c6](https://github.com/stainless-api/stainless-api-cli/commit/63cb8c6985f63d0656eebe89be59491d626591a0))
16+
* **cli:** send filename and content type when reading input from files ([be7af23](https://github.com/stainless-api/stainless-api-cli/commit/be7af2356960c8d613279eac15c1ed7321aa3c9a))
17+
* do not require body in rebase api ([24c4223](https://github.com/stainless-api/stainless-api-cli/commit/24c42236b5a44bddb8696f398762cec0d6484fe4))
18+
* set CLI flag constant values automatically where `x-stainless-const` is set ([a7447d3](https://github.com/stainless-api/stainless-api-cli/commit/a7447d3650e8baa2f54aeae4e59fc1c70e997ead))
19+
* support passing path and query params over stdin ([503519c](https://github.com/stainless-api/stainless-api-cli/commit/503519cf40c2632a63ec8c1b24163a6f12d0648b))
20+
21+
22+
### Bug Fixes
23+
24+
* avoid reading from stdin unless request body is form encoded or json ([33b0f1d](https://github.com/stainless-api/stainless-api-cli/commit/33b0f1d41027491119bfa33f8c05009ff16123c4))
25+
* better support passing client args in any position ([48b8a0f](https://github.com/stainless-api/stainless-api-cli/commit/48b8a0fd934dc1dd5c5277b5a2cbe676e0c505c4))
26+
* cli no longer hangs when stdin is attached to a pipe with empty input ([d3a9a3a](https://github.com/stainless-api/stainless-api-cli/commit/d3a9a3a13fd0385200be8a2bc55790125b05ff2a))
27+
* **cli:** correctly load zsh autocompletion ([2f444ad](https://github.com/stainless-api/stainless-api-cli/commit/2f444ad356dfbae90a363961e66db94773823378))
28+
* fall back to main branch if linking fails in CI ([4591b75](https://github.com/stainless-api/stainless-api-cli/commit/4591b751a10f61ced5dcb19a32a70dfbc55f6cde))
29+
* fix for failing to drop invalid module replace in link script ([6ba8953](https://github.com/stainless-api/stainless-api-cli/commit/6ba895335b12daccae3436502281a80c1d983f05))
30+
* fix for off-by-one error in pagination logic ([932831c](https://github.com/stainless-api/stainless-api-cli/commit/932831c499057abe2267435af9ec544891a8f524))
31+
* fix quoting typo ([8a951e7](https://github.com/stainless-api/stainless-api-cli/commit/8a951e7103fa64a4779f36b370d9cf8e406d5563))
32+
* flags for nullable body scalar fields are strictly typed ([3e2b538](https://github.com/stainless-api/stainless-api-cli/commit/3e2b538ab43a89f8303031ed4b7afd6062f02e30))
33+
* handle empty data set using `--format explore` ([1bd23c5](https://github.com/stainless-api/stainless-api-cli/commit/1bd23c553d2da507110ddb92dafed6605964389c))
34+
* improve linking behavior when developing on a branch not in the Go SDK ([e1a2e8f](https://github.com/stainless-api/stainless-api-cli/commit/e1a2e8f9ab17c10fa176dd853c2f9b83715c667e))
35+
* improved workflow for developing on branches ([e116763](https://github.com/stainless-api/stainless-api-cli/commit/e116763b576de1dbacfa49fbeb337636dbd814af))
36+
* no longer require an API key when building on production repos ([c4a11f2](https://github.com/stainless-api/stainless-api-cli/commit/c4a11f27d8c75b42a0afb1a14508fcd0bce5958a))
37+
* use `RawJSON` when iterating items with `--format explore` in the CLI ([c9283e7](https://github.com/stainless-api/stainless-api-cli/commit/c9283e7b273a26f598f52ccfceceebf17ff838b1))
38+
39+
40+
### Chores
41+
42+
* add documentation for ./scripts/link ([5f4af84](https://github.com/stainless-api/stainless-api-cli/commit/5f4af84a3b348a96988684eb8db58535a4e968f3))
43+
* **ci:** skip lint on metadata-only changes ([532af1e](https://github.com/stainless-api/stainless-api-cli/commit/532af1e097a9b6e1c303b1f09f06662d6313091c))
44+
* **ci:** support manually triggering release workflow ([f665af7](https://github.com/stainless-api/stainless-api-cli/commit/f665af793fed0157b4adbe2a6a3c36bb03aa1ff6))
45+
* **cli:** additional test cases for `ShowJSONIterator` ([be6d172](https://github.com/stainless-api/stainless-api-cli/commit/be6d172a673b6fc6d58381711c1ddde0ebda5128))
46+
* **cli:** fall back to JSON when using default "explore" with non-TTY ([a9a6a1d](https://github.com/stainless-api/stainless-api-cli/commit/a9a6a1d16dbd1971fa9cc0c22b406e4219b21e53))
47+
* **cli:** let `--format raw` be used in conjunction with `--transform` ([7e45d32](https://github.com/stainless-api/stainless-api-cli/commit/7e45d32f9b41414118bdc985c10d38d64018573c))
48+
* **cli:** switch long lists of positional args over to param structs ([ec1ee78](https://github.com/stainless-api/stainless-api-cli/commit/ec1ee78ef6be529f67cc9ba3e535017dc389d1f7))
49+
* **cli:** use `ShowJSONOpts` as argument to `formatJSON` instead of many positionals ([21ecd6d](https://github.com/stainless-api/stainless-api-cli/commit/21ecd6d9964b446e4c2405b88b5c6f90868efc9f))
50+
* **internal:** more robust bootstrap script ([206705e](https://github.com/stainless-api/stainless-api-cli/commit/206705ead34ef60c147e00cc5a3bcb15a9ed5039))
51+
* **internal:** tweak CI branches ([f5fb149](https://github.com/stainless-api/stainless-api-cli/commit/f5fb1499119ac2015543bdc9f99aa72034e4c208))
52+
* **internal:** update gitignore ([0a84430](https://github.com/stainless-api/stainless-api-cli/commit/0a84430b8aad63364cdcee82d1f5689d28ca2a68))
53+
* **internal:** update multipart form array serialization ([3adb010](https://github.com/stainless-api/stainless-api-cli/commit/3adb0104a167e7ee2a4cdf0b5cfeec23db4f2c03))
54+
* **internal:** version bump ([cceccaf](https://github.com/stainless-api/stainless-api-cli/commit/cceccaf70b219006380894bcf5cb0035259356c0))
55+
* **internal:** version bump ([834431c](https://github.com/stainless-api/stainless-api-cli/commit/834431c2a7c08757a3ee5a67bbecca79fe75f80e))
56+
* mark all CLI-related tests in Go with `t.Parallel()` ([26689ee](https://github.com/stainless-api/stainless-api-cli/commit/26689eec3deec8fe015a01987c8d4fc8cdf6ef16))
57+
* modify CLI tests to inject stdout so mutating `os.Stdout` isn't necessary ([30d9e9b](https://github.com/stainless-api/stainless-api-cli/commit/30d9e9b68316523fad66ed6ffa3d3fa6d2b50b0d))
58+
* omit full usage information when missing required CLI parameters ([b0d3a36](https://github.com/stainless-api/stainless-api-cli/commit/b0d3a36c8e9d3847c499a22fb8917429a4446cb9))
59+
* redact api-key headers in debug logs ([9df85a2](https://github.com/stainless-api/stainless-api-cli/commit/9df85a24388bc904ebb20e4bb367f3a498200911))
60+
* switch some CLI Go tests from `os.Chdir` to `t.Chdir` ([e0e0b53](https://github.com/stainless-api/stainless-api-cli/commit/e0e0b53524eee473bac15575e9adb50ccc0fe307))
61+
* **tests:** bump steady to v0.19.4 ([21efcef](https://github.com/stainless-api/stainless-api-cli/commit/21efcef05c6197083b846ac521ae1f8e29bcced9))
62+
* **tests:** bump steady to v0.19.5 ([1941229](https://github.com/stainless-api/stainless-api-cli/commit/1941229a54a7a1ded0764344d52ace32b2ddd71d))
63+
* **tests:** bump steady to v0.19.6 ([9002467](https://github.com/stainless-api/stainless-api-cli/commit/9002467d9ae56a6bcece9a101a26d4a90b86dc97))
64+
* **tests:** bump steady to v0.19.7 ([7091164](https://github.com/stainless-api/stainless-api-cli/commit/70911642b35cb4323f55832f6c892bb5d9f8c3d7))
65+
* **tests:** bump steady to v0.20.1 ([836db0e](https://github.com/stainless-api/stainless-api-cli/commit/836db0e56b8c69082b9c0511bd48dd2c107a3833))
66+
* **tests:** bump steady to v0.20.2 ([5bc29b4](https://github.com/stainless-api/stainless-api-cli/commit/5bc29b497e3e4c9c95d644636cda015b48880f56))
67+
* **tests:** bump steady to v0.22.1 ([ca2efc2](https://github.com/stainless-api/stainless-api-cli/commit/ca2efc2dc92aaeb48a609eea383e1b0a2d78fd08))
68+
69+
70+
### Refactors
71+
72+
* **tests:** switch from prism to steady ([0bf70b1](https://github.com/stainless-api/stainless-api-cli/commit/0bf70b1840a41227c7e7a7c15f36c42cdeb4c2a9))
73+
374
## 0.1.0-alpha.88 (2026-04-09)
475

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

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,27 @@ base64-encoding). Note that absolute paths will begin with `@file://` or
125125
```bash
126126
stl <command> --arg @data://file.txt
127127
```
128+
129+
## Linking different Go SDK versions
130+
131+
You can link the CLI against a different version of the Stainless Go SDK
132+
for development purposes using the `./scripts/link` script.
133+
134+
To link to a specific version from a repository (version can be a branch,
135+
git tag, or commit hash):
136+
137+
```bash
138+
./scripts/link github.com/org/repo@version
139+
```
140+
141+
To link to a local copy of the SDK:
142+
143+
```bash
144+
./scripts/link ../path/to/stainless-go
145+
```
146+
147+
If you run the link script without any arguments, it will default to `../stainless-go`.
148+
128149
## Workspace Configuration
129150

130151
The CLI supports workspace configuration to avoid repeatedly specifying the project name. When you run a command, the CLI will:

cmd/stl/main.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ func main() {
2626
prepareForAutocomplete(app)
2727
}
2828

29+
if baseURL, ok := os.LookupEnv("STAINLESS_BASE_URL"); ok {
30+
if err := cmd.ValidateBaseURL(baseURL, "STAINLESS_BASE_URL"); err != nil {
31+
fmt.Fprintf(os.Stderr, "%s\n", err.Error())
32+
os.Exit(1)
33+
}
34+
}
2935
checkVersionUpdate(updateCheck)
3036

3137
if err := app.Run(context.Background(), os.Args); err != nil {
@@ -41,7 +47,12 @@ func main() {
4147
fmt.Fprintf(os.Stderr, "%s %q: %d %s\n", apierr.Request.Method, apierr.Request.URL, apierr.Response.StatusCode, http.StatusText(apierr.Response.StatusCode))
4248
format := app.String("format-error")
4349
json := gjson.Parse(apierr.RawJSON())
44-
show_err := cmd.ShowJSON(os.Stdout, "Error", json, format, app.String("transform-error"))
50+
show_err := cmd.ShowJSON(json, cmd.ShowJSONOpts{
51+
ExplicitFormat: app.IsSet("format-error"),
52+
Format: format,
53+
Title: "Error",
54+
Transform: app.String("transform-error"),
55+
})
4556
if show_err != nil {
4657
// Just print the original error:
4758
fmt.Fprintf(os.Stderr, "%s\n", err.Error())

0 commit comments

Comments
 (0)