Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
665e431
feat: better error message if scheme forgotten in CLI `*_BASE_URL`/`-…
stainless-app[bot] Apr 3, 2026
40329ac
feat: allow `-` as value representing stdin to binary-only file param…
stainless-app[bot] Apr 3, 2026
2f49e45
chore: switch some CLI Go tests from `os.Chdir` to `t.Chdir`
stainless-app[bot] Apr 3, 2026
5fc2402
chore: mark all CLI-related tests in Go with `t.Parallel()`
stainless-app[bot] Apr 3, 2026
07389a5
feat(api): api update
stainless-app[bot] Apr 3, 2026
b7fd553
chore: modify CLI tests to inject stdout so mutating `os.Stdout` isn'…
stainless-app[bot] Apr 4, 2026
28b2498
fix: fall back to main branch if linking fails in CI
stainless-app[bot] Apr 7, 2026
d4f3537
fix: fix quoting typo
stainless-app[bot] Apr 7, 2026
2f69100
feat(api): api update
stainless-app[bot] Apr 8, 2026
61bdeb0
codegen metadata
stainless-app[bot] Apr 8, 2026
78f8725
codegen metadata
stainless-app[bot] Apr 9, 2026
d9c0c77
chore(cli): let `--format raw` be used in conjunction with `--transform`
stainless-app[bot] Apr 9, 2026
5784e71
chore(cli): additional test cases for `ShowJSONIterator`
stainless-app[bot] Apr 10, 2026
ad3cbf1
fix: fix for failing to drop invalid module replace in link script
stainless-app[bot] Apr 10, 2026
a95a486
fix(cli): fix incompatible Go types for flag generated as array of maps
stainless-app[bot] Apr 10, 2026
62e382b
docs: update examples
stainless-app[bot] Apr 11, 2026
2586047
chore: add documentation for ./scripts/link
stainless-app[bot] Apr 14, 2026
1b5c7e9
chore(cli): fall back to JSON when using default "explore" with non-TTY
stainless-app[bot] Apr 15, 2026
fc1ebc7
feat(cli): alias parameters in data with `x-stainless-cli-data-alias`
stainless-app[bot] Apr 15, 2026
4a9e250
chore(cli): switch long lists of positional args over to param structs
stainless-app[bot] Apr 16, 2026
05fc238
feat(api): api update
stainless-app[bot] Apr 16, 2026
b5836aa
chore(ci): support manually triggering release workflow
stainless-app[bot] Apr 17, 2026
4b76c79
feat(cli): send filename and content type when reading input from files
stainless-app[bot] Apr 17, 2026
4222549
feat(cli): add `--raw-output`/`-r` option to print raw (non-JSON) str…
stainless-app[bot] Apr 17, 2026
6ea47ba
feat(api): api update
stainless-app[bot] Apr 18, 2026
9e0c109
chore(cli): use `ShowJSONOpts` as argument to `formatJSON` instead of…
stainless-app[bot] Apr 18, 2026
522092e
chore(tests): bump steady to v0.22.1
stainless-app[bot] Apr 18, 2026
e08b27e
codegen metadata
stainless-app[bot] Apr 22, 2026
7ee8632
codegen metadata
stainless-app[bot] Apr 22, 2026
878ee7b
codegen metadata
stainless-app[bot] Apr 22, 2026
7bd511f
codegen metadata
stainless-app[bot] Apr 22, 2026
1fb3c19
codegen metadata
stainless-app[bot] Apr 22, 2026
86e522e
codegen metadata
stainless-app[bot] Apr 22, 2026
014bf27
chore(internal): more robust bootstrap script
stainless-app[bot] Apr 23, 2026
f752384
codegen metadata
stainless-app[bot] Apr 23, 2026
317503c
codegen metadata
stainless-app[bot] Apr 24, 2026
f8df59b
codegen metadata
stainless-app[bot] Apr 25, 2026
9a73f60
codegen metadata
stainless-app[bot] Apr 25, 2026
ca5609b
codegen metadata
stainless-app[bot] Apr 25, 2026
15efdbc
feat(api): api update
stainless-app[bot] Apr 26, 2026
75c6ac1
codegen metadata
stainless-app[bot] Apr 27, 2026
4b771ee
codegen metadata
stainless-app[bot] Apr 28, 2026
357c382
codegen metadata
stainless-app[bot] Apr 29, 2026
c419250
fix(cli): correctly load zsh autocompletion
stainless-app[bot] Apr 30, 2026
fb3478d
codegen metadata
stainless-app[bot] Apr 30, 2026
c983439
fix: flags for nullable body scalar fields are strictly typed
stainless-app[bot] Apr 30, 2026
14f99ef
feat: support passing path and query params over stdin
stainless-app[bot] Apr 30, 2026
95294ce
codegen metadata
stainless-app[bot] May 1, 2026
c472cd1
codegen metadata
stainless-app[bot] May 1, 2026
cde57e6
feat(api): api update
stainless-app[bot] May 5, 2026
80481cf
codegen metadata
stainless-app[bot] May 6, 2026
5341977
codegen metadata
stainless-app[bot] May 6, 2026
2a72087
codegen metadata
stainless-app[bot] May 7, 2026
e11fbd3
feat(api): api update
stainless-app[bot] May 8, 2026
6347635
chore: redact api-key headers in debug logs
stainless-app[bot] May 8, 2026
56f8b6d
codegen metadata
stainless-app[bot] May 8, 2026
d4c66b4
codegen metadata
stainless-app[bot] May 8, 2026
4b6dd92
ci: pin GitHub Actions to commit SHAs
stainless-app[bot] May 13, 2026
dd11f74
codegen metadata
stainless-app[bot] May 13, 2026
60e0eee
codegen metadata
stainless-app[bot] May 13, 2026
1213ec6
codegen metadata
stainless-app[bot] May 15, 2026
6388fc3
feat(api): api update
stainless-app[bot] May 18, 2026
9e041b0
feat(api): api update
stainless-app[bot] May 20, 2026
a47645b
feat(api): api update
stainless-app[bot] May 20, 2026
d315406
codegen metadata
stainless-app[bot] May 27, 2026
2bbe3de
codegen metadata
stainless-app[bot] May 28, 2026
7758b23
codegen metadata
stainless-app[bot] May 28, 2026
4e73766
feat(api): api update
stainless-app[bot] May 29, 2026
a0e47e8
feat(api): api update
stainless-app[bot] Jun 3, 2026
5ab6153
codegen metadata
stainless-app[bot] Jun 4, 2026
1912859
codegen metadata
stainless-app[bot] Jun 4, 2026
a76a2e8
codegen metadata
stainless-app[bot] Jun 4, 2026
6f6afd5
codegen metadata
stainless-app[bot] Jun 10, 2026
d47a16c
feat(api): manual updates
stainless-app[bot] Jun 10, 2026
909c9b0
feat(api): manual updates
stainless-app[bot] Jun 10, 2026
70666fe
codegen metadata
stainless-app[bot] Jun 11, 2026
d567ebf
feat(api): api update
stainless-app[bot] Jun 11, 2026
89d332f
codegen metadata
stainless-app[bot] Jun 13, 2026
81dbe0c
feat(api): api update
stainless-app[bot] Jun 17, 2026
7e9d222
feat(api): api update
stainless-app[bot] Jun 17, 2026
29214de
codegen metadata
stainless-app[bot] Jun 18, 2026
30679c9
codegen metadata
stainless-app[bot] Jun 18, 2026
6a5c716
chore(internal): codegen related update
stainless-app[bot] Jun 18, 2026
77be77c
codegen metadata
stainless-app[bot] Jun 18, 2026
3192b40
codegen metadata
stainless-app[bot] Jun 23, 2026
7101f8f
feat(api): api update
stainless-app[bot] Jun 23, 2026
dabdb21
codegen metadata
stainless-app[bot] Jun 24, 2026
e8c96ea
codegen metadata
stainless-app[bot] Jun 24, 2026
f243336
codegen metadata
stainless-app[bot] Jun 24, 2026
4cfd3cc
codegen metadata
stainless-app[bot] Jun 24, 2026
58ca36f
feat(api): api update
stainless-app[bot] Jun 24, 2026
1af8e9e
codegen metadata
stainless-app[bot] Jun 25, 2026
3bc8c65
release: 0.2.0
stainless-app[bot] Jun 25, 2026
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
4 changes: 2 additions & 2 deletions .github/actions/setup-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
runs:
using: composite
steps:
- uses: stainless-api/retrieve-github-access-token@v1
- uses: stainless-api/retrieve-github-access-token@1f03f929b746c5b03dcdafa2bebbb18ca5672e1a # v1.0.0
if: github.repository == 'stainless-sdks/hyperspell-cli'
id: get_token
with:
Expand All @@ -20,7 +20,7 @@ runs:
run: git config --global url."https://x-access-token:${{ steps.get_token.outputs.github_access_token }}@github.com/stainless-sdks/hyperspell-go".insteadOf "https://github.com/stainless-sdks/hyperspell-go"

- name: Setup go
uses: actions/setup-go@v5
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version-file: ./go.mod

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- uses: ./.github/actions/setup-go
with:
Expand All @@ -51,7 +51,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/hyperspell-cli' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- uses: ./.github/actions/setup-go
with:
Expand All @@ -66,7 +66,7 @@ jobs:
run: ./scripts/bootstrap

- name: Run goreleaser
uses: goreleaser/goreleaser-action@v6.1.0
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
with:
version: latest
args: release --snapshot --clean --skip=publish
Expand All @@ -78,7 +78,7 @@ jobs:
github.repository == 'stainless-sdks/hyperspell-cli' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: core.setOutput('github_token', await core.getIDToken());

Expand All @@ -98,7 +98,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/hyperspell-cli' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- uses: ./.github/actions/setup-go
with:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,21 @@ on:
push:
tags:
- "v*"
workflow_dispatch: {}
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version-file: "go.mod"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6.1.0
uses: goreleaser/goreleaser-action@9ed2f89a662bf1735a48bc8557fd212fa902bebf # v6.1.0
with:
version: latest
args: release --clean
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: github.repository == 'hyperspell/hyperspell-cli' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v6
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Check release environment
run: |
Expand Down
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"
".": "0.2.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 30
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell%2Fhyperspell-7d29d0843a52840291678a3c6d136f496ae1f956853abaa5003c1284ca2c94aa.yml
openapi_spec_hash: 010597ad0ec6376fbf2f01ec062787ad
config_hash: bd8505e17db740d82e578d0edaa9bfe0
configured_endpoints: 31
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/hyperspell/hyperspell-5fa01d1d8f236b2c961d0f6db2af161f3d67bf0f9eeee741e452b90095d0031f.yml
openapi_spec_hash: 82e8a4badd2628e82fddb09c4bbdf7a2
config_hash: 11e84d884a86d2db0411c35fae6e9121
65 changes: 65 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,70 @@
# Changelog

## 0.2.0 (2026-06-25)

Full Changelog: [v0.1.0...v0.2.0](https://github.com/hyperspell/hyperspell-cli/compare/v0.1.0...v0.2.0)

### Features

* allow `-` as value representing stdin to binary-only file parameters in CLIs ([40329ac](https://github.com/hyperspell/hyperspell-cli/commit/40329ac0504bec769cdcbd0eda4821b15cf164d1))
* **api:** api update ([58ca36f](https://github.com/hyperspell/hyperspell-cli/commit/58ca36f39729f1276c2620cdcfebc5ebe5852d6c))
* **api:** api update ([7101f8f](https://github.com/hyperspell/hyperspell-cli/commit/7101f8fe926681d693852dc71adfcf7f76e8f2d8))
* **api:** api update ([7e9d222](https://github.com/hyperspell/hyperspell-cli/commit/7e9d222c561f513c16bb53e965bab093ccf50968))
* **api:** api update ([81dbe0c](https://github.com/hyperspell/hyperspell-cli/commit/81dbe0c1824d85e5c199f004e2475aa86c200cc9))
* **api:** api update ([d567ebf](https://github.com/hyperspell/hyperspell-cli/commit/d567ebf6a8772028bd0743263fe562793541091f))
* **api:** api update ([a0e47e8](https://github.com/hyperspell/hyperspell-cli/commit/a0e47e8cd95a3e2cebc179e8ed983d12085e9d5d))
* **api:** api update ([4e73766](https://github.com/hyperspell/hyperspell-cli/commit/4e737664e1e0608fc6c8d96a40172085f3f3a52b))
* **api:** api update ([a47645b](https://github.com/hyperspell/hyperspell-cli/commit/a47645ba9a0d9a0f814c24b58a017d7a34c7e97d))
* **api:** api update ([9e041b0](https://github.com/hyperspell/hyperspell-cli/commit/9e041b0500af612fc314cf5d9c71fcbf55e1e53e))
* **api:** api update ([6388fc3](https://github.com/hyperspell/hyperspell-cli/commit/6388fc390e6421a8afe20e7011d6352554d205f5))
* **api:** api update ([e11fbd3](https://github.com/hyperspell/hyperspell-cli/commit/e11fbd34bfff7a2a70948b12f8231ff3da2f51ec))
* **api:** api update ([cde57e6](https://github.com/hyperspell/hyperspell-cli/commit/cde57e6cc0907e80bc2fa80d05b6701c3b777863))
* **api:** api update ([15efdbc](https://github.com/hyperspell/hyperspell-cli/commit/15efdbcd4ea5962464fe5eedc212d0fd601ceb1f))
* **api:** api update ([6ea47ba](https://github.com/hyperspell/hyperspell-cli/commit/6ea47ba9a0248351256a8ddd0bde7b5575a53eb3))
* **api:** api update ([05fc238](https://github.com/hyperspell/hyperspell-cli/commit/05fc238a5087e6cd3024fd92eccb7fa23cbb8440))
* **api:** api update ([2f69100](https://github.com/hyperspell/hyperspell-cli/commit/2f691007ba68d3b18b6a643db158ed16b4848871))
* **api:** api update ([07389a5](https://github.com/hyperspell/hyperspell-cli/commit/07389a55c46d676894d6392d7c6ed4cf33ac4147))
* **api:** manual updates ([909c9b0](https://github.com/hyperspell/hyperspell-cli/commit/909c9b0f3991e17efa3277e8ad760191f980ef73))
* **api:** manual updates ([d47a16c](https://github.com/hyperspell/hyperspell-cli/commit/d47a16c9dcf6bc31d1c17f8c29eaedce8559885f))
* better error message if scheme forgotten in CLI `*_BASE_URL`/`--base-url` ([665e431](https://github.com/hyperspell/hyperspell-cli/commit/665e431d3c39a2ba149168250d080bdf8b7546b5))
* **cli:** add `--raw-output`/`-r` option to print raw (non-JSON) strings ([4222549](https://github.com/hyperspell/hyperspell-cli/commit/422254937af57c228a18d67191aa8966cceebb45))
* **cli:** alias parameters in data with `x-stainless-cli-data-alias` ([fc1ebc7](https://github.com/hyperspell/hyperspell-cli/commit/fc1ebc74cf40a58ddb979128852ed202354922cc))
* **cli:** send filename and content type when reading input from files ([4b76c79](https://github.com/hyperspell/hyperspell-cli/commit/4b76c79a99e8bb0f8a3ef112ccaf3092decb69a3))
* support passing path and query params over stdin ([14f99ef](https://github.com/hyperspell/hyperspell-cli/commit/14f99ef63dff6a55aca07c84419c42ce25d99142))


### Bug Fixes

* **cli:** correctly load zsh autocompletion ([c419250](https://github.com/hyperspell/hyperspell-cli/commit/c419250da2b4345806d79c322c0384742e8b234a))
* **cli:** fix incompatible Go types for flag generated as array of maps ([a95a486](https://github.com/hyperspell/hyperspell-cli/commit/a95a486ccc528af84af0a8aa0500680982ee6033))
* fall back to main branch if linking fails in CI ([28b2498](https://github.com/hyperspell/hyperspell-cli/commit/28b24981adf8c8c39a68a44495912a66e63945ea))
* fix for failing to drop invalid module replace in link script ([ad3cbf1](https://github.com/hyperspell/hyperspell-cli/commit/ad3cbf15ab7a70f3318ae32d95b7f6bebeaebceb))
* fix quoting typo ([d4f3537](https://github.com/hyperspell/hyperspell-cli/commit/d4f35370e45ed2cc4deceeb6b8fae13f0a07fb63))
* flags for nullable body scalar fields are strictly typed ([c983439](https://github.com/hyperspell/hyperspell-cli/commit/c9834390753ff2facace1035b6b692e73a73e81a))


### Chores

* add documentation for ./scripts/link ([2586047](https://github.com/hyperspell/hyperspell-cli/commit/2586047b1af969fcd3b5c21e52c072a7b620118d))
* **ci:** support manually triggering release workflow ([b5836aa](https://github.com/hyperspell/hyperspell-cli/commit/b5836aa567c2ba79cf6ad7a8706de0ef196ed317))
* **cli:** additional test cases for `ShowJSONIterator` ([5784e71](https://github.com/hyperspell/hyperspell-cli/commit/5784e710f1021b0939a8985eedaa0c80b0b9df0b))
* **cli:** fall back to JSON when using default "explore" with non-TTY ([1b5c7e9](https://github.com/hyperspell/hyperspell-cli/commit/1b5c7e9de0a6ceaf663c5a06365a0ce1ec11cca4))
* **cli:** let `--format raw` be used in conjunction with `--transform` ([d9c0c77](https://github.com/hyperspell/hyperspell-cli/commit/d9c0c77f238264b97af2c5fa8aacbd71de7f6f4b))
* **cli:** switch long lists of positional args over to param structs ([4a9e250](https://github.com/hyperspell/hyperspell-cli/commit/4a9e2508c2605e814c40980baf343dbda59f28b8))
* **cli:** use `ShowJSONOpts` as argument to `formatJSON` instead of many positionals ([9e0c109](https://github.com/hyperspell/hyperspell-cli/commit/9e0c10938023ffbd46ca50c61baf2c3353df23d5))
* **internal:** codegen related update ([6a5c716](https://github.com/hyperspell/hyperspell-cli/commit/6a5c716eaae857905319889fef58bba8db5ecae7))
* **internal:** more robust bootstrap script ([014bf27](https://github.com/hyperspell/hyperspell-cli/commit/014bf271f51526dab8ae459bd514bab798c8062d))
* mark all CLI-related tests in Go with `t.Parallel()` ([5fc2402](https://github.com/hyperspell/hyperspell-cli/commit/5fc240280f247a2a3817b37e359c7c674048a448))
* modify CLI tests to inject stdout so mutating `os.Stdout` isn't necessary ([b7fd553](https://github.com/hyperspell/hyperspell-cli/commit/b7fd5533571992857a741f834af4d272b8ad2b6d))
* redact api-key headers in debug logs ([6347635](https://github.com/hyperspell/hyperspell-cli/commit/634763523a93a97f36a758f4a49b0e6df83b1d69))
* switch some CLI Go tests from `os.Chdir` to `t.Chdir` ([2f49e45](https://github.com/hyperspell/hyperspell-cli/commit/2f49e45e69e821c97605e3929f4d6864f2b306e7))
* **tests:** bump steady to v0.22.1 ([522092e](https://github.com/hyperspell/hyperspell-cli/commit/522092e2767802d6e258353c4bb374f16f2751d5))


### Documentation

* update examples ([62e382b](https://github.com/hyperspell/hyperspell-cli/commit/62e382b449383807ab1568d97c5f461fed2c702c))

## 0.1.0 (2026-04-02)

Full Changelog: [v0.0.1...v0.1.0](https://github.com/hyperspell/hyperspell-cli/compare/v0.0.1...v0.1.0)
Expand Down
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ hyperspell [resource] <command> [flags...]
```sh
hyperspell memories add \
--api-key 'My API Key' \
--text text
--text ...
```

For details about specific commands, use the `--help` flag.
Expand Down Expand Up @@ -119,3 +119,23 @@ base64-encoding). Note that absolute paths will begin with `@file://` or
```bash
hyperspell <command> --arg @data://file.txt
```

## Linking different Go SDK versions

You can link the CLI against a different version of the Hyperspell Go SDK
for development purposes using the `./scripts/link` script.

To link to a specific version from a repository (version can be a branch,
git tag, or commit hash):

```bash
./scripts/link github.com/org/repo@version
```

To link to a local copy of the SDK:

```bash
./scripts/link ../path/to/hyperspell-go
```

If you run the link script without any arguments, it will default to `../hyperspell-go`.
14 changes: 13 additions & 1 deletion cmd/hyperspell/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,13 @@ func main() {
prepareForAutocomplete(app)
}

if baseURL, ok := os.LookupEnv("HYPERSPELL_BASE_URL"); ok {
if err := cmd.ValidateBaseURL(baseURL, "HYPERSPELL_BASE_URL"); err != nil {
fmt.Fprintf(os.Stderr, "%s\n", err.Error())
os.Exit(1)
}
}

if err := app.Run(context.Background(), os.Args); err != nil {
exitCode := 1

Expand All @@ -36,7 +43,12 @@ func main() {
fmt.Fprintf(os.Stderr, "%s %q: %d %s\n", apierr.Request.Method, apierr.Request.URL, apierr.Response.StatusCode, http.StatusText(apierr.Response.StatusCode))
format := app.String("format-error")
json := gjson.Parse(apierr.RawJSON())
show_err := cmd.ShowJSON(os.Stdout, "Error", json, format, app.String("transform-error"))
show_err := cmd.ShowJSON(json, cmd.ShowJSONOpts{
ExplicitFormat: app.IsSet("format-error"),
Format: format,
Title: "Error",
Transform: app.String("transform-error"),
})
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
if show_err != nil {
// Just print the original error:
fmt.Fprintf(os.Stderr, "%s\n", err.Error())
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/charmbracelet/lipgloss v1.1.0
github.com/charmbracelet/x/term v0.2.1
github.com/goccy/go-yaml v1.18.0
github.com/hyperspell/hyperspell-go v0.0.2
github.com/hyperspell/hyperspell-go v0.1.0
github.com/itchyny/json2yaml v0.1.4
github.com/muesli/reflow v0.3.0
github.com/stretchr/testify v1.10.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM=
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
github.com/hyperspell/hyperspell-go v0.0.2 h1:gIQyH73O+pWqUUygwK27C4wJ6lJDRDyPQleYpAkFb1g=
github.com/hyperspell/hyperspell-go v0.0.2/go.mod h1:t9bo1rOMdt9azdS7KWkUiT1Gc3cb8L6emOQuCuiRQG8=
github.com/hyperspell/hyperspell-go v0.1.0 h1:2dDOjiI62rWcH8aGV7gP7/sR1IxNzuU2zjRhPuGT7Xg=
github.com/hyperspell/hyperspell-go v0.1.0/go.mod h1:t9bo1rOMdt9azdS7KWkUiT1Gc3cb8L6emOQuCuiRQG8=
github.com/itchyny/json2yaml v0.1.4 h1:/pErVOXGG5iTyXHi/QKR4y3uzhLjGTEmmJIy97YT+k8=
github.com/itchyny/json2yaml v0.1.4/go.mod h1:6iudhBZdarpjLFRNj+clWLAkGft+9uCcjAZYXUH9eGI=
github.com/lucasb-eyer/go-colorful v1.2.0 h1:1nnpGOrhyZZuNyfu1QjKiUICQ74+3FNCN69Aj6K7nkY=
Expand Down
4 changes: 4 additions & 0 deletions internal/apiform/form_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,12 @@ var tests = map[string]struct {
}

func TestEncode(t *testing.T) {
t.Parallel()

for name, test := range tests {
t.Run(name, func(t *testing.T) {
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
t.Parallel()

buf := bytes.NewBuffer(nil)
writer := multipart.NewWriter(buf)
writer.SetBoundary("xxx")
Expand Down
4 changes: 4 additions & 0 deletions internal/apiquery/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
)

func TestEncode(t *testing.T) {
t.Parallel()

tests := map[string]struct {
val any
settings QuerySettings
Expand Down Expand Up @@ -114,6 +116,8 @@ func TestEncode(t *testing.T) {

for name, test := range tests {
t.Run(name, func(t *testing.T) {
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
t.Parallel()
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.
Comment thread
entelligence-ai-pr-reviews[bot] marked this conversation as resolved.

query := map[string]any{"query": test.val}
values, err := MarshalWithSettings(query, test.settings)
if err != nil {
Expand Down
Loading
Loading