Skip to content
Open
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-82febf7e246170c880f45b5eece83e1c61a09db0ba33a727db9a1856b8e2e2e6.yml
openapi_spec_hash: 6c283e686c1bb42190fefbb0146af920
config_hash: 79c13cf7727d64173933e0d367570632
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.7.13 (2026-07-10)

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 ([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
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'",
)
})
}
17 changes: 16 additions & 1 deletion pkg/cmd/inboxmessage.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var inboxesMessagesUpdate = cli.Command{

var inboxesMessagesList = cli.Command{
Name: "list",
Usage: "**CLI:**",
Usage: "Lists messages in the inbox, most recent first. Pass `from`, `to`, or `subject`\nto filter by substring. Filtered requests are served by search, which caps\n`limit` at 100. For relevance-ranked full-text search across sender, recipients,\nsubject, and message body, use `Search Messages`.",
Suggest: true,
Flags: []cli.Flag{
&requestflag.Flag[string]{
Expand All @@ -72,6 +72,11 @@ var inboxesMessagesList = cli.Command{
Usage: "Timestamp before which to filter by.",
QueryPath: "before",
},
&requestflag.Flag[any]{
Name: "from",
Usage: "Filter to messages whose sender contains this value (substring match). Repeatable; all values must match.",
QueryPath: "from",
},
&requestflag.Flag[*bool]{
Name: "include-blocked",
Usage: "Include blocked in results.",
Expand Down Expand Up @@ -107,6 +112,16 @@ var inboxesMessagesList = cli.Command{
Usage: "Page token for pagination.",
QueryPath: "page_token",
},
&requestflag.Flag[any]{
Name: "subject",
Usage: "Filter to messages whose subject contains this value (substring match). Repeatable; all values must match.",
QueryPath: "subject",
},
&requestflag.Flag[any]{
Name: "to",
Usage: "Filter to messages whose recipients (to, cc, or bcc) contain this value (substring match). Repeatable; all values must match.",
QueryPath: "to",
},
},
Action: handleInboxesMessagesList,
HideHelpCommand: true,
Expand Down
3 changes: 3 additions & 0 deletions pkg/cmd/inboxmessage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,16 @@ func TestInboxesMessagesList(t *testing.T) {
"--after", "'2019-12-27T18:11:19.117Z'",
"--ascending=true",
"--before", "'2019-12-27T18:11:19.117Z'",
"--from", "[string]",
"--include-blocked=true",
"--include-spam=true",
"--include-trash=true",
"--include-unauthenticated=true",
"--label", "[string]",
"--limit", "0",
"--page-token", "page_token",
"--subject", "[string]",
"--to", "[string]",
)
})
}
Expand Down
Loading
Loading