CLI Tool

The AgentInbox CLI provides a command-line interface for creating inboxes, waiting for emails, and managing your account.

Global vs NPX

Install globally for frequent use, or use npx for one-off commands without installing.

Installation

Install the CLI globally via npm, or use npx to run it without installing.

bash
npm install -g @AgentInbox/cli

Authentication

Set your API key via an environment variable or configure it once with the CLI.

bash
export AgentInbox_API_KEY="at_live_..."

Commands

The CLI supports all major API operations through intuitive commands.

Inboxes

Inbox commands
# Create an inbox
AgentInbox inboxes create --ttl 3600
# List inboxes
AgentInbox inboxes list
# Get an inbox
AgentInbox inboxes get inb_123
# Delete an inbox
AgentInbox inboxes delete inb_123

Messages

Message commands
# List messages in an inbox
AgentInbox messages list --inbox inb_123
# Get a message
AgentInbox messages get msg_456

Waits

Wait commands
# Wait for an OTP
AgentInbox waits create --inbox inb_123 --type otp --timeout 120
# Cancel a wait
AgentInbox waits cancel wait_789

Sessions

Session commands
# Create a session
AgentInbox sessions create --name "signup-flow"
# Get session details
AgentInbox sessions get sess_789
# Complete a session
AgentInbox sessions complete sess_789

Output Formats

The CLI supports multiple output formats: table, JSON, and raw.

bash
AgentInbox inboxes list --format json | jq '.[0].emailAddress'

Format Options

Use --format json for piping to other tools, or --format raw for simple values in scripts.

Next Steps