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.7.12"
".": "0.7.13"
}
8 changes: 4 additions & 4 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/agentmail-ec4e26c46715d10a0de953666e890ab67f97e61f7355971ed728942f957100f8.yml
openapi_spec_hash: 74a582c32cd3a4f6e2afb1e84eccbb21
config_hash: 8ab5eb1bfc282411f0283d386a319f23
configured_endpoints: 91
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/agentmail/agentmail-af6486aae3ab676a9825da6bd60ea7dad5d76a22c1cc8ba80515767ee774c270.yml
openapi_spec_hash: 4eb49916915aeac5a7897470322459d4
config_hash: 79c13cf7727d64173933e0d367570632
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# Changelog

## 0.7.13 (2026-07-15)

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

### Features

* **api:** api update ([e06cbb1](https://github.com/agentmail-to/agentmail-cli/commit/e06cbb15ad15eb8973bce6723d66cf5b748613ba))
* **api:** api update ([1f4632f](https://github.com/agentmail-to/agentmail-cli/commit/1f4632f9e452427893fe000b6cb963bba0bc82bf))
* **api:** api update ([4830642](https://github.com/agentmail-to/agentmail-cli/commit/4830642f1b660a451a354c8960bf5bde9ec312d8))
* **api:** api update ([2dc9e62](https://github.com/agentmail-to/agentmail-cli/commit/2dc9e622b55e052aa44bcad4ccfe2489ed4aa908))
* **api:** api update ([2508a62](https://github.com/agentmail-to/agentmail-cli/commit/2508a62a7abe87ea5044c75500ee931bf6742692))
* **api:** api update ([f7e5d93](https://github.com/agentmail-to/agentmail-cli/commit/f7e5d93a4df98db8c2491a316717c0bd63ff9f08))
* **api:** api update ([95de1df](https://github.com/agentmail-to/agentmail-cli/commit/95de1df13b2ff5a3146cd0ce528e5d305057ee08))
* **api:** api update ([7f0959e](https://github.com/agentmail-to/agentmail-cli/commit/7f0959e4bbec8893c177ad4e155d7fc950d7c5e6))
* **api:** api update ([5b5819c](https://github.com/agentmail-to/agentmail-cli/commit/5b5819c93bb814f0e13f4ce45d86212e32defe4f))

## 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)
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.14.0
github.com/agentmail-to/agentmail-go v0.15.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.14.0 h1:oEZQResNnsqY7aZl2zoXoQdAHYltsROr51Z+gNEHhS8=
github.com/agentmail-to/agentmail-go v0.14.0/go.mod h1:3NrKbeXLQKRgb9gj2bmCoN9WXDTy9y9yacV070xpvDU=
github.com/agentmail-to/agentmail-go v0.15.0 h1:K8j9wQqbq+X0lM4UyaDmnMlEzGcQnD/jVOv0DtbnsRw=
github.com/agentmail-to/agentmail-go v0.15.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
17 changes: 0 additions & 17 deletions pkg/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ func init() {
&inboxesList,
&inboxesDelete,
&inboxesGet,
&inboxesListMetrics,
},
},
{
Expand Down Expand Up @@ -251,14 +250,6 @@ func init() {
&podsAPIKeysDelete,
},
},
{
Name: "pods:metrics",
Category: "API RESOURCE",
Suggest: true,
Commands: []*cli.Command{
&podsMetricsQuery,
},
},
{
Name: "webhooks",
Category: "API RESOURCE",
Expand Down Expand Up @@ -316,14 +307,6 @@ func init() {
&listsGet,
},
},
{
Name: "metrics",
Category: "API RESOURCE",
Suggest: true,
Commands: []*cli.Command{
&metricsList,
},
},
{
Name: "organizations",
Category: "API RESOURCE",
Expand Down
13 changes: 11 additions & 2 deletions pkg/cmd/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ var domainsCreate = cli.Command{
Required: true,
BodyPath: "domain",
},
&requestflag.Flag[bool]{
&requestflag.Flag[*bool]{
Name: "feedback-enabled",
Usage: "Bounce and complaint notifications are sent to your inboxes.",
Required: true,
BodyPath: "feedback_enabled",
},
&requestflag.Flag[*bool]{
Name: "subdomains-enabled",
Usage: "Allow inboxes on any subdomain of this domain. Adds a required wildcard MX\nrecord (`*.<domain>`) to `records`.",
BodyPath: "subdomains_enabled",
},
},
Action: handleDomainsCreate,
HideHelpCommand: true,
Expand All @@ -52,6 +56,11 @@ var domainsUpdate = cli.Command{
Usage: "Bounce and complaint notifications are sent to your inboxes.",
BodyPath: "feedback_enabled",
},
&requestflag.Flag[*bool]{
Name: "subdomains-enabled",
Usage: "Allow inboxes on any subdomain of this domain. Adds a required wildcard MX\nrecord (`*.<domain>`) to `records`.",
BodyPath: "subdomains_enabled",
},
},
Action: handleDomainsUpdate,
HideHelpCommand: true,
Expand Down
9 changes: 7 additions & 2 deletions pkg/cmd/domain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@ func TestDomainsCreate(t *testing.T) {
"domains", "create",
"--domain", "domain",
"--feedback-enabled=true",
"--subdomains-enabled=true",
)
})

t.Run("piping data", func(t *testing.T) {
// Test piping YAML data over stdin
pipeData := []byte("" +
"domain: domain\n" +
"feedback_enabled: true\n")
"feedback_enabled: true\n" +
"subdomains_enabled: true\n")
mocktest.TestRunMockTestWithPipeAndFlags(
t, pipeData,
"--api-key", "string",
Expand All @@ -42,12 +44,15 @@ func TestDomainsUpdate(t *testing.T) {
"domains", "update",
"--domain-id", "domain_id",
"--feedback-enabled=true",
"--subdomains-enabled=true",
)
})

t.Run("piping data", func(t *testing.T) {
// Test piping YAML data over stdin
pipeData := []byte("feedback_enabled: true")
pipeData := []byte("" +
"feedback_enabled: true\n" +
"subdomains_enabled: true\n")
mocktest.TestRunMockTestWithPipeAndFlags(
t, pipeData,
"--api-key", "string",
Expand Down
110 changes: 12 additions & 98 deletions pkg/cmd/inbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,14 @@ var inboxesCreate = cli.Command{
},
&requestflag.Flag[*string]{
Name: "domain",
Usage: "Domain of address. Must be verified domain. Defaults to `agentmail.to`.",
Usage: "Domain of address. Must be a verified domain, or any subdomain of a\nverified domain that has subdomains enabled (e.g., `bot.example.com`).\nDefaults to `agentmail.to`.",
BodyPath: "domain",
},
&requestflag.Flag[map[string]any]{
Name: "metadata",
Usage: "Custom metadata to attach to the inbox.",
BodyPath: "metadata",
},
&requestflag.Flag[*string]{
Name: "username",
Usage: "Username of address. Randomly generated if not specified.",
Expand All @@ -55,12 +60,16 @@ var inboxesUpdate = cli.Command{
Required: true,
PathParam: "inbox_id",
},
&requestflag.Flag[string]{
&requestflag.Flag[*string]{
Name: "display-name",
Usage: "Display name: `Display Name <username@domain.com>`.",
Required: true,
BodyPath: "display_name",
},
&requestflag.Flag[map[string]any]{
Name: "metadata",
Usage: "Metadata to merge into the inbox's existing metadata. Keys you include\nare added or overwritten; keys you omit are left unchanged. To remove a\nsingle key, send it with a null value. To clear all metadata, send\n`metadata` as null. Sending an empty object is rejected; use null to\nclear. Each update must include at least one of `display_name` or\n`metadata`.",
BodyPath: "metadata",
},
},
Action: handleInboxesUpdate,
HideHelpCommand: true,
Expand Down Expand Up @@ -123,52 +132,6 @@ var inboxesGet = cli.Command{
HideHelpCommand: true,
}

var inboxesListMetrics = cli.Command{
Name: "list-metrics",
Usage: "**CLI:**",
Suggest: true,
Flags: []cli.Flag{
&requestflag.Flag[string]{
Name: "inbox-id",
Usage: "The ID of the inbox.",
Required: true,
PathParam: "inbox_id",
},
&requestflag.Flag[*bool]{
Name: "descending",
Usage: "Sort in descending order.",
QueryPath: "descending",
},
&requestflag.Flag[any]{
Name: "end",
Usage: "End timestamp for the query.",
QueryPath: "end",
},
&requestflag.Flag[any]{
Name: "event-type",
Usage: "List of metric event types to query.",
QueryPath: "event_types",
},
&requestflag.Flag[*int64]{
Name: "limit",
Usage: "Limit on number of buckets to return.",
QueryPath: "limit",
},
&requestflag.Flag[*string]{
Name: "period",
Usage: "Period in number of seconds for the query.",
QueryPath: "period",
},
&requestflag.Flag[any]{
Name: "start",
Usage: "Start timestamp for the query.",
QueryPath: "start",
},
},
Action: handleInboxesListMetrics,
HideHelpCommand: true,
}

func handleInboxesCreate(ctx context.Context, cmd *cli.Command) error {
client := agentmail.NewClient(getDefaultRequestOptions(cmd)...)
unusedArgs := cmd.Args().Slice()
Expand Down Expand Up @@ -366,52 +329,3 @@ func handleInboxesGet(ctx context.Context, cmd *cli.Command) error {
Transform: transform,
})
}

func handleInboxesListMetrics(ctx context.Context, cmd *cli.Command) error {
client := agentmail.NewClient(getDefaultRequestOptions(cmd)...)
unusedArgs := cmd.Args().Slice()
if !cmd.IsSet("inbox-id") && len(unusedArgs) > 0 {
cmd.Set("inbox-id", unusedArgs[0])
unusedArgs = unusedArgs[1:]
}
if len(unusedArgs) > 0 {
return fmt.Errorf("Unexpected extra arguments: %v", unusedArgs)
}

options, err := flagOptions(
cmd,
apiquery.NestedQueryFormatBrackets,
apiquery.ArrayQueryFormatComma,
EmptyBody,
false,
)
if err != nil {
return err
}

params := agentmail.InboxListMetricsParams{}

var res []byte
options = append(options, option.WithResponseBodyInto(&res))
_, err = client.Inboxes.ListMetrics(
ctx,
cmd.Value("inbox-id").(string),
params,
options...,
)
if err != nil {
return err
}

obj := gjson.ParseBytes(res)
format := cmd.Root().String("format")
explicitFormat := cmd.Root().IsSet("format")
transform := cmd.Root().String("transform")
return ShowJSON(obj, ShowJSONOpts{
ExplicitFormat: explicitFormat,
Format: format,
RawOutput: cmd.Root().Bool("raw-output"),
Title: "inboxes list-metrics",
Transform: transform,
})
}
27 changes: 8 additions & 19 deletions pkg/cmd/inbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ func TestInboxesCreate(t *testing.T) {
"--client-id", "client_id",
"--display-name", "display_name",
"--domain", "domain",
"--metadata", "{foo: string}",
"--username", "username",
)
})
Expand All @@ -28,6 +29,8 @@ func TestInboxesCreate(t *testing.T) {
"client_id: client_id\n" +
"display_name: display_name\n" +
"domain: domain\n" +
"metadata:\n" +
" foo: string\n" +
"username: username\n")
mocktest.TestRunMockTestWithPipeAndFlags(
t, pipeData,
Expand All @@ -46,12 +49,16 @@ func TestInboxesUpdate(t *testing.T) {
"inboxes", "update",
"--inbox-id", "inbox_id",
"--display-name", "display_name",
"--metadata", "{foo: string}",
)
})

t.Run("piping data", func(t *testing.T) {
// Test piping YAML data over stdin
pipeData := []byte("display_name: display_name")
pipeData := []byte("" +
"display_name: display_name\n" +
"metadata:\n" +
" foo: string\n")
mocktest.TestRunMockTestWithPipeAndFlags(
t, pipeData,
"--api-key", "string",
Expand Down Expand Up @@ -98,21 +105,3 @@ func TestInboxesGet(t *testing.T) {
)
})
}

func TestInboxesListMetrics(t *testing.T) {
t.Skip("Mock server tests are disabled")
t.Run("regular flags", func(t *testing.T) {
mocktest.TestRunMockTestWithFlags(
t,
"--api-key", "string",
"inboxes", "list-metrics",
"--inbox-id", "inbox_id",
"--descending=true",
"--end", "'2019-12-27T18:11:19.117Z'",
"--event-type", "[message.sent]",
"--limit", "0",
"--period", "period",
"--start", "'2019-12-27T18:11:19.117Z'",
)
})
}
Loading
Loading