inbox-api-cli
0.1.3
dotnet tool install --global inbox-api-cli --version 0.1.3
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
dotnet tool install --local inbox-api-cli --version 0.1.3
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=inbox-api-cli&version=0.1.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
nuke :add-package inbox-api-cli --version 0.1.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
mail-cli — .NET CLI Tool
Command-line tool for interacting with the Inbox API. Provides email account management, message operations, sending, search, and draft management. Authenticates via API tokens (cw_ prefix).
Prerequisites
- .NET 9 SDK
- A running Inbox API instance
- An API token (generated from the web UI or API)
Install / Run
# Run directly (from backend/ directory)
dotnet run --project mail-cli -- [command] [options]
# Build a self-contained single-file executable
dotnet publish mail-cli -c Release
# The published binary is at mail-cli/bin/Release/net9.0/{runtime}/publish/mail-cli
Configuration
Configure the CLI with the configure command:
# Interactive configuration
dotnet run --project mail-cli -- configure
# Or use environment variables
export INBOX_API_URL=http://localhost:5015
export INBOX_API_TOKEN=cw_your_api_token_here
Configuration is stored in a local config file managed by ConfigService.
Commands
| Command | Description |
|---|---|
configure |
Set API URL and token |
accounts |
List email accounts |
messages |
List, read, flag, move, archive, and delete messages |
send |
Send an email |
reply |
Reply to a message |
forward |
Forward a message to new recipients |
search |
Search emails across accounts |
drafts |
Create, list, update, send, and delete drafts |
threads |
List and view email threads |
folders |
List folders for an account |
attachments |
List and download message attachments |
batch |
Bulk operations (mark-read, archive, move) |
contacts |
List frequency-ranked contacts |
digest |
Email digest summary across accounts |
health |
Check account IMAP health |
webhooks |
Manage webhooks, deliveries, and templates |
configure
Set up API connection. Supports interactive prompts or direct flags.
configure [--api-url <url>] [--api-token <token>]
accounts
accounts list [--provider <name>] [--status <status>] [--sort <field>]
| Subcommand | Description |
|---|---|
list |
List connected email accounts |
messages
messages list [--account <id>] [--folder <id>] [--unread] [--starred] [--has-attachments] [--start-date <date>] [--end-date <date>] [--sort <order>] [--query <text>] [--page <n>] [--page-size <n>]
messages get <message-id> [--body] [--html]
messages flag <message-id> [--read <bool>] [--starred <bool>]
messages move <message-id> --folder <folder-id>
messages archive <message-id>
messages delete <message-id>
| Subcommand | Description |
|---|---|
list |
List messages with filtering, sorting, and pagination |
get |
Get message details (optionally include body) |
flag |
Update message flags (read/starred) |
move |
Move a message to a folder |
archive |
Archive a message |
delete |
Delete a message |
send
send --to <emails> --subject <text> --account <id> [--body <text>] [--html-body <html>] [--cc <emails>] [--bcc <emails>]
reply
reply <message-id> --body <text> [--html-body <html>] [--reply-all]
forward
forward <message-id> --to <emails> [--cc <emails>] [--bcc <emails>] [--text <additional-text>]
search
search <query> [--account <id>] [--sort <order>] [--page <n>] [--page-size <n>]
Sort options: relevance, date, date_asc, subject, from.
drafts
drafts list [--account <id>] [--start-date <date>] [--end-date <date>] [--sort <order>] [--page <n>] [--page-size <n>]
drafts get <draft-id>
drafts create --account <id> [--to <emails>] [--subject <text>] [--body <text>] [--html-body <html>]
drafts update <draft-id> [--to <emails>] [--subject <text>] [--body <text>] [--html-body <html>]
drafts send <draft-id>
drafts delete <draft-id> [--force]
| Subcommand | Description |
|---|---|
list |
List drafts with filtering and pagination |
get |
Get draft details by ID |
create |
Create a new draft |
update |
Update an existing draft |
send |
Send a draft |
delete |
Delete a draft |
threads
threads list [--account <id>] [--start-date <date>] [--end-date <date>] [--unread] [--sort <order>] [--page <n>] [--page-size <n>]
threads get <thread-id>
| Subcommand | Description |
|---|---|
list |
List email threads with filtering and pagination |
get |
Get a thread with all its messages |
folders
folders list <account-id>
attachments
attachments list <message-id>
attachments download <message-id> <attachment-id> [--output <path>]
| Subcommand | Description |
|---|---|
list |
List attachments for a message |
download |
Download an attachment (defaults to original filename) |
batch
batch mark-read <message-ids> [--unread]
batch archive <message-ids>
batch move <message-ids> --folder <folder-id>
<message-ids> is a comma-separated list of message IDs.
| Subcommand | Description |
|---|---|
mark-read |
Mark messages as read (or unread with --unread) |
archive |
Archive multiple messages |
move |
Move multiple messages to a folder |
contacts
contacts list [--since <period>] [--account <id>] [--search <text>] [--sort <field>] [--page <n>] [--page-size <n>]
Sort options: name, email, count, recent.
digest
digest [--since <period>] [--account <id>] [--max-per-account <n>]
health
health <account-id>
webhooks
webhooks list [--page <n>] [--page-size <n>]
webhooks get <webhook-id>
webhooks create --url <url> --events <events> [--secret <secret>]
webhooks update <webhook-id> [--url <url>] [--events <events>] [--active <bool>]
webhooks delete <webhook-id> [--force]
webhooks regenerate-secret <webhook-id>
webhooks deliveries <webhook-id> [--page <n>] [--page-size <n>]
webhooks retry <webhook-id> <delivery-id>
webhooks purge <webhook-id> [--force]
webhooks templates
| Subcommand | Description |
|---|---|
list |
List webhooks |
get |
Get webhook details |
create |
Create a webhook for specified events |
update |
Update webhook URL, events, or active status |
delete |
Delete a webhook |
regenerate-secret |
Regenerate the webhook signing secret |
deliveries |
List delivery history for a webhook |
retry |
Retry a failed delivery |
purge |
Purge all deliveries for a webhook |
templates |
List available webhook templates |
Global Options
| Option | Description |
|---|---|
--json |
Output in JSON format |
--no-color |
Disable colored output |
--debug |
Enable debug output |
Examples
# List email accounts
dotnet run --project mail-cli -- accounts list
# Send an email
dotnet run --project mail-cli -- send --to user@example.com --subject "Hello" --body "Message"
# Search messages
dotnet run --project mail-cli -- search --query "invoice" --json
# List messages in JSON format
dotnet run --project mail-cli -- messages list --json
Structure
mail-cli/
├── Program.cs # Entry point, command registration, error handling
├── Commands/ # Command handlers (21 files)
│ ├── AccountCommands.cs
│ ├── AttachmentCommands.cs
│ ├── BatchCommands.cs
│ ├── CommandHelper.cs
│ ├── ConfigureCommand.cs
│ ├── ContactCommands.cs
│ ├── DigestCommand.cs
│ ├── DraftCommands.cs
│ ├── FolderCommands.cs
│ ├── ForwardCommand.cs
│ ├── GlobalOptions.cs
│ ├── HealthCommand.cs
│ ├── MessageCommands.cs
│ ├── ReplyCommand.cs
│ ├── SearchCommand.cs
│ ├── SendCommand.cs
│ ├── ThreadCommands.cs
│ └── WebhookCommands.cs
├── Models/
│ ├── ApiModels.cs # API response types
│ └── ConfigModels.cs # Local configuration types
└── Services/
├── ApiClient.cs # HTTP client wrapper
├── ConfigService.cs # Config file management
└── OutputService.cs # Console output formatting (Spectre.Console)
Key Dependencies
| Package | Purpose |
|---|---|
| System.CommandLine | CLI argument parsing |
| Spectre.Console | Rich console output (tables, colors, markup) |
Notes
- This is a standalone project — it does not reference saas-api or saas-data
- All API communication is over HTTP via
ApiClient - The binary can be published as a self-contained single-file executable (
PublishSingleFile+SelfContainedare enabled in the csproj) - Error handling maps API errors to user-friendly messages with appropriate exit codes (0=success, 1=error, 2=auth failure, 3=connection failure)
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.