transactional-cli
v0.1.1
Published
Official CLI for Transactional - manage email, SMS, forms, and more from your terminal
Maintainers
Readme
transactional-cli
Official command-line interface for Transactional - manage email, SMS, forms, and more from your terminal.
Installation
npm install -g transactional-cliOr using npx without installation:
npx transactional-cli loginQuick Start
Authenticate
transactional loginThis opens your browser to authenticate and link the CLI to your Transactional organization.
Send an email
transactional email send \ --from "[email protected]" \ --to "[email protected]" \ --subject "Hello from CLI" \ --text "This is a test email"Check your user info
transactional whoami
Commands
Authentication
| Command | Description |
|---------|-------------|
| transactional login | Authenticate with Transactional |
| transactional logout | Log out from all organizations |
| transactional whoami | Show current user and organization |
| transactional switch [org] | Switch to a different organization |
| transactional orgs list | List all authenticated organizations |
| Command | Description |
|---------|-------------|
| transactional email send | Send a single email |
| transactional email batch <file> | Send batch emails from JSON file |
| transactional email stats | Get email statistics |
| transactional email templates list | List email templates |
| transactional email templates get <id> | Get template details |
| transactional email templates create | Create a new template |
| transactional email domains list | List email domains |
| transactional email domains add <domain> | Add a domain |
| transactional email senders list | List email senders |
| transactional email suppressions list | List suppressions |
Configuration
| Command | Description |
|---------|-------------|
| transactional config show | Show current configuration |
| transactional config set <key> <value> | Set a configuration value |
| transactional config get <key> | Get a configuration value |
| transactional config reset | Reset to default configuration |
| transactional config path | Show configuration file paths |
Global Options
| Option | Description |
|--------|-------------|
| -o, --org <slug> | Override the current organization |
| --json | Output results as JSON |
| --help | Show help for a command |
| --version | Show CLI version |
Configuration
Configuration is stored in ~/.transactional/config.json:
| Key | Description | Default |
|-----|-------------|---------|
| apiUrl | API base URL | https://api.usetransactional.com |
| webUrl | Web app URL | https://app.usetransactional.com |
| outputFormat | Output format (table, json, yaml) | table |
| color | Enable color output | true |
Environment Variables
| Variable | Description |
|----------|-------------|
| TRANSACTIONAL_API_URL | Override API URL |
| TRANSACTIONAL_WEB_URL | Override web URL |
| NO_COLOR | Disable color output |
| TRANSACTIONAL_NO_COLOR | Disable color output |
Credentials
Credentials are stored securely in ~/.transactional/credentials.json with file permissions set to 0600 (read/write for owner only).
Examples
Send email with template
transactional email send \
--from "[email protected]" \
--to "[email protected]" \
--template-alias "welcome" \
--model '{"name": "John", "company": "Acme"}'Send batch emails
Create a file emails.json:
[
{
"from": "[email protected]",
"to": "[email protected]",
"subject": "Hello User 1",
"text": "Hello from batch!"
},
{
"from": "[email protected]",
"to": "[email protected]",
"subject": "Hello User 2",
"text": "Hello from batch!"
}
]Then send:
transactional email batch emails.jsonGet stats as JSON
transactional email stats --period month --jsonDocumentation
Full documentation is available at usetransactional.com/docs/cli
License
MIT - see LICENSE for details.
