inbox-api-cli
0.1.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet tool install --global inbox-api-cli --version 0.1.0
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.0
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=inbox-api-cli&version=0.1.0
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.0
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 and manage email accounts |
messages |
List, read, and manage messages |
send |
Send an email |
reply |
Reply to a message |
search |
Search emails |
drafts |
Create, list, and manage drafts |
folders |
List and manage folders |
tokens |
Manage API tokens |
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 (11 files)
│ ├── AccountCommands.cs
│ ├── MessageCommands.cs
│ ├── SendCommand.cs
│ ├── ReplyCommand.cs
│ ├── DraftCommands.cs
│ ├── FolderCommands.cs
│ ├── SearchCommand.cs
│ ├── TokenCommands.cs
│ ├── ConfigureCommand.cs
│ ├── CommandHelper.cs
│ └── GlobalOptions.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.