Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
b25c8cb
chore(internal): codegen related update
stainless-app[bot] May 14, 2026
fbfe2c1
chore(cli): fall back to JSON when using default "explore" with non-TTY
stainless-app[bot] Apr 15, 2026
ea26a8c
feat(cli): alias parameters in data with `x-stainless-cli-data-alias`
stainless-app[bot] Apr 15, 2026
d227554
chore(cli): switch long lists of positional args over to param structs
stainless-app[bot] Apr 16, 2026
1da7c3e
codegen metadata
stainless-app[bot] Apr 16, 2026
0e60014
chore(ci): support manually triggering release workflow
stainless-app[bot] Apr 17, 2026
65a86ee
feat(cli): send filename and content type when reading input from files
stainless-app[bot] Apr 17, 2026
f9df419
feat(cli): add `--raw-output`/`-r` option to print raw (non-JSON) str…
stainless-app[bot] Apr 17, 2026
0e94446
chore(cli): use `ShowJSONOpts` as argument to `formatJSON` instead of…
stainless-app[bot] Apr 18, 2026
8b39e72
chore(internal): more robust bootstrap script
stainless-app[bot] Apr 23, 2026
c7f1282
chore(internal): codegen related update
stainless-app[bot] Apr 24, 2026
271e6ab
codegen metadata
stainless-app[bot] Apr 24, 2026
5b36c53
chore(internal): codegen related update
stainless-app[bot] Apr 29, 2026
3a2b15d
codegen metadata
stainless-app[bot] Apr 29, 2026
0625704
ci: pin trigger-release-please github action
stainless-app[bot] Apr 30, 2026
1b982f7
fix(cli): correctly load zsh autocompletion
stainless-app[bot] Apr 30, 2026
c6d3d0f
codegen metadata
stainless-app[bot] Apr 30, 2026
f105a97
fix: flags for nullable body scalar fields are strictly typed
stainless-app[bot] Apr 30, 2026
86c8aab
feat: support passing path and query params over stdin
stainless-app[bot] Apr 30, 2026
0d32710
codegen metadata
stainless-app[bot] May 1, 2026
42b296a
feat(api): api update
stainless-app[bot] May 1, 2026
dbc4e39
chore(internal): codegen related update
stainless-app[bot] May 2, 2026
d3bae3e
chore: redact api-key headers in debug logs
stainless-app[bot] May 8, 2026
95968dd
chore(internal): codegen related update
stainless-app[bot] May 9, 2026
8b4bc7f
codegen metadata
stainless-app[bot] May 11, 2026
ade97ba
ci: pin GitHub Actions to commit SHAs
stainless-app[bot] May 13, 2026
8daa4e3
feat(api): api update
stainless-app[bot] May 14, 2026
aa96815
chore(internal): codegen related update
stainless-app[bot] May 14, 2026
2a05aba
feat(api): api update
stainless-app[bot] May 14, 2026
a842755
chore: update SDK settings
stainless-app[bot] May 14, 2026
caa5746
release: 0.7.12
stainless-app[bot] May 14, 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/agentmail-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/agentmail-go".insteadOf "https://github.com/stainless-sdks/agentmail-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/agentmail-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/agentmail-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/agentmail-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 == 'agentmail-to/agentmail-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.7.11"
".": "0.7.12"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 94
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/agentmail%2Fagentmail-830c24d3ff39df5248fd06a0e32a64a57bdf6ed4f58bb33244cab98fa7c3476e.yml
openapi_spec_hash: c71d36752561924eb2e11bce3f93c32f
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/agentmail/agentmail-ec4e26c46715d10a0de953666e890ab67f97e61f7355971ed728942f957100f8.yml
openapi_spec_hash: 74a582c32cd3a4f6e2afb1e84eccbb21
config_hash: 8ab5eb1bfc282411f0283d386a319f23
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# Changelog

## 0.7.12 (2026-05-14)

Full Changelog: [v0.7.11...v0.7.12](https://github.com/agentmail-to/agentmail-cli/compare/v0.7.11...v0.7.12)

### Features

* **api:** api update ([2a05aba](https://github.com/agentmail-to/agentmail-cli/commit/2a05aba658ca45f0a782575b47c8f159ca67a186))
* **api:** api update ([8daa4e3](https://github.com/agentmail-to/agentmail-cli/commit/8daa4e303af3d3e8b2543e1c294dbbac08dbbb2a))
* **api:** api update ([42b296a](https://github.com/agentmail-to/agentmail-cli/commit/42b296accc273d1f43984b7a978500f5f4c890fd))
* **cli:** add `--raw-output`/`-r` option to print raw (non-JSON) strings ([f9df419](https://github.com/agentmail-to/agentmail-cli/commit/f9df419dc3ba3b15a8a267db59207e81eea217f5))
* **cli:** alias parameters in data with `x-stainless-cli-data-alias` ([ea26a8c](https://github.com/agentmail-to/agentmail-cli/commit/ea26a8c2a975386b3a00bf181d877e3eeb40c3f1))
* **cli:** send filename and content type when reading input from files ([65a86ee](https://github.com/agentmail-to/agentmail-cli/commit/65a86ee9ddb38368eebc5a472380d9d85b4fb6c5))
* support passing path and query params over stdin ([86c8aab](https://github.com/agentmail-to/agentmail-cli/commit/86c8aab82328e0362b0d699464f1a55a9421b4e7))


### Bug Fixes

* **cli:** correctly load zsh autocompletion ([1b982f7](https://github.com/agentmail-to/agentmail-cli/commit/1b982f78a9d150901b940791d7bc05fe1a396e49))
* flags for nullable body scalar fields are strictly typed ([f105a97](https://github.com/agentmail-to/agentmail-cli/commit/f105a97104a8e6be911e6419733d9c7628577d84))


### Chores

* **ci:** support manually triggering release workflow ([0e60014](https://github.com/agentmail-to/agentmail-cli/commit/0e6001439c676f9b793176e39417f69ff94d01ac))
* **cli:** fall back to JSON when using default "explore" with non-TTY ([fbfe2c1](https://github.com/agentmail-to/agentmail-cli/commit/fbfe2c1e0e56a779a885443c2d0d4743b512e242))
* **cli:** switch long lists of positional args over to param structs ([d227554](https://github.com/agentmail-to/agentmail-cli/commit/d227554129ec4bddcf6ba84af9f08fe49247ea82))
* **cli:** use `ShowJSONOpts` as argument to `formatJSON` instead of many positionals ([0e94446](https://github.com/agentmail-to/agentmail-cli/commit/0e944460e3f00ab8cb1040bb18e0380bb3574dbe))
* **internal:** codegen related update ([aa96815](https://github.com/agentmail-to/agentmail-cli/commit/aa9681503fff5488e7b02db6e210c055f6699f19))
* **internal:** codegen related update ([95968dd](https://github.com/agentmail-to/agentmail-cli/commit/95968dd8267ca302ca54e626fff6e71a58542cbf))
* **internal:** codegen related update ([dbc4e39](https://github.com/agentmail-to/agentmail-cli/commit/dbc4e3921846cff6f687cd96b4c46163f8785baf))
* **internal:** codegen related update ([5b36c53](https://github.com/agentmail-to/agentmail-cli/commit/5b36c5391637ffda46b95c9095acda6f6be532e9))
* **internal:** codegen related update ([c7f1282](https://github.com/agentmail-to/agentmail-cli/commit/c7f1282aabb0958db3b8dd601bdca796e5dc0f57))
* **internal:** codegen related update ([b25c8cb](https://github.com/agentmail-to/agentmail-cli/commit/b25c8cb53998ae20441273aa550a0b435b608bf3))
* **internal:** more robust bootstrap script ([8b39e72](https://github.com/agentmail-to/agentmail-cli/commit/8b39e720cbe7e3c2c150bd7f2a563dd0feb298bf))
* redact api-key headers in debug logs ([d3bae3e](https://github.com/agentmail-to/agentmail-cli/commit/d3bae3e70698a8869a12853ee029755a7654ff67))
* update SDK settings ([a842755](https://github.com/agentmail-to/agentmail-cli/commit/a842755950fd6fa4ccbf2c890025e2d22ab48f97))

## 0.7.11 (2026-04-14)

Full Changelog: [v0.7.10...v0.7.11](https://github.com/agentmail-to/agentmail-cli/compare/v0.7.10...v0.7.11)
Expand Down
7 changes: 6 additions & 1 deletion cmd/agentmail/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,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"),
})
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 @@ -3,7 +3,7 @@ module github.com/agentmail-to/agentmail-cli
go 1.25

require (
github.com/agentmail-to/agentmail-go v0.6.0
github.com/agentmail-to/agentmail-go v0.14.0
github.com/charmbracelet/bubbles v0.21.0
github.com/charmbracelet/bubbletea v1.3.6
github.com/charmbracelet/lipgloss v1.1.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/agentmail-to/agentmail-go v0.6.0 h1:CCQtBbYE97KASraV2v4IvSuaaJrjKDn97qH1rhMmJt8=
github.com/agentmail-to/agentmail-go v0.6.0/go.mod h1:3NrKbeXLQKRgb9gj2bmCoN9WXDTy9y9yacV070xpvDU=
github.com/agentmail-to/agentmail-go v0.14.0 h1:oEZQResNnsqY7aZl2zoXoQdAHYltsROr51Z+gNEHhS8=
github.com/agentmail-to/agentmail-go v0.14.0/go.mod h1:3NrKbeXLQKRgb9gj2bmCoN9WXDTy9y9yacV070xpvDU=
github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiErDT4WkJ2k=
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/aymanbagabas/go-udiff v0.2.0 h1:TK0fH4MteXUDspT88n8CKzvK0X9O2xu9yQjWpi6yML8=
Expand Down
14 changes: 12 additions & 2 deletions internal/autocomplete/shellscripts/zsh_autocomplete.zsh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/zsh
compdef ____APPNAME___zsh_autocomplete __APPNAME__
#compdef __APPNAME__

____APPNAME___zsh_autocomplete() {

Expand Down Expand Up @@ -44,3 +43,14 @@ ____APPNAME___zsh_autocomplete() {
;;
esac
}

# When installed in fpath (e.g., via Homebrew's zsh_completion stanza), this file
# is autoloaded as the function ___APPNAME__ and its body becomes that function's
# body. Detect that case via funcstack and dispatch to the completion function.
# When sourced (e.g., `source <(__APPNAME__ @completion zsh)`), register the
# function with compdef instead.
if [[ "${funcstack[1]}" = "___APPNAME__" ]]; then
____APPNAME___zsh_autocomplete "$@"
else
compdef ____APPNAME___zsh_autocomplete __APPNAME__
fi
7 changes: 6 additions & 1 deletion internal/debugmiddleware/debug_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ const redactedPlaceholder = "<REDACTED>"

// Headers known to contain sensitive information like an API key. Note that this exclude `Authorization`,
// which is handled specially in `redactRequest` below.
var sensitiveHeaders = []string{}
var sensitiveHeaders = []string{
"api-key",
"x-api-key",
"cookie",
"set-cookie",
}

// RequestLogger is a middleware that logs HTTP requests and responses.
type RequestLogger struct {
Expand Down
35 changes: 32 additions & 3 deletions internal/requestflag/innerflag.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,44 @@ import (
type InnerFlag[
T []any | []map[string]any | []DateTimeValue | []DateValue | []TimeValue | []string |
[]float64 | []int64 | []bool | any | map[string]any | DateTimeValue | DateValue | TimeValue |
string | float64 | int64 | bool,
string | float64 | int64 | bool |
*string | *float64 | *int64 | *bool | *DateTimeValue | *DateValue | *TimeValue,
] struct {
Name string // name of the flag
DefaultText string // default text of the flag for usage purposes
Usage string // usage string for help output
Aliases []string // aliases that are allowed for this flag
Validator func(T) error // custom function to validate this flag value

OuterFlag cli.Flag // The flag on which this inner flag will set values
InnerField string // The inner field which this flag will set
OuterFlag cli.Flag // The flag on which this inner flag will set values
InnerField string // The inner field which this flag will set
DataAliases []string // alternate names recognized in YAML values passed as the outer flag

// OuterIsArrayOfObjects tells an untyped outer flag (Flag[any], used for nullable
// complex schemas) to seed its underlying value as []map[string]any rather than
// map[string]any before SetInnerField runs. The hint is ignored for typed outer
// flags whose zero value already carries a dispatchable reflect.Kind.
OuterIsArrayOfObjects bool
}

// GetDataAliases returns the aliases recognized when parsing inner field keys from piped or flag YAML.
func (f *InnerFlag[T]) GetDataAliases() []string {
return f.DataAliases
}

// GetInnerField returns the API field name that this inner flag sets on its outer flag's value.
// For example, the flag --parent.foo targeting a parameter whose OpenAPI property name is "foo"
// would return "foo". This is distinct from the flag's CLI name and from any DataAliases entries.
func (f *InnerFlag[T]) GetInnerField() string {
return f.InnerField
}

type HasOuterFlag interface {
cli.Flag
SetOuterFlag(cli.Flag)
GetOuterFlag() cli.Flag
GetInnerField() string
GetDataAliases() []string
}

func (f *InnerFlag[T]) SetOuterFlag(flag cli.Flag) {
Expand Down Expand Up @@ -61,6 +83,10 @@ func (f *InnerFlag[T]) Set(name string, rawVal string) error {
}
}

if seeder, ok := f.OuterFlag.(InnerFieldSeeder); ok {
seeder.SeedInnerCollection(f.OuterIsArrayOfObjects)
}

if settableInnerField, ok := f.OuterFlag.(SettableInnerField); ok {
settableInnerField.SetInnerField(f.InnerField, parsedValue)
} else {
Expand Down Expand Up @@ -121,6 +147,9 @@ func (f *InnerFlag[T]) TypeName() string {
if ty == nil {
return ""
}
if ty.Kind() == reflect.Pointer {
ty = ty.Elem()
}

// Get base type name with special handling for built-in types
getTypeName := func(t reflect.Type) string {
Expand Down
Loading
Loading