Configuration

Configure the Transactional CLI settings and preferences.

Configuration

The CLI stores its configuration in ~/.transactional/config.json.

View Configuration

Show all current settings:

transactional config show

Output:

Current Configuration
API URL        https://api.usetransactional.com
Web URL        https://usetransactional.com
Output Format  table
Color          enabled

File Locations
Config Directory    /Users/you/.transactional
Credentials File    /Users/you/.transactional/credentials.json

Set Configuration

Set individual configuration values:

transactional config set <key> <value>

Available Settings

KeyDescriptionValid Values
apiUrlAPI endpoint URLAny valid URL
webUrlWeb dashboard URLAny valid URL
outputFormatDefault output formattable, json, yaml
colorEnable colored outputtrue, false

Examples

# Change output format to JSON
transactional config set outputFormat json
 
# Disable colored output
transactional config set color false
 
# Point to a different API (self-hosted)
transactional config set apiUrl https://api.mycompany.com

Get Single Value

Retrieve a specific configuration value:

transactional config get apiUrl

This outputs just the value, useful for scripting:

# Use in scripts
API_URL=$(transactional config get apiUrl)

Reset to Defaults

Reset all configuration to default values:

transactional config reset

Default values:

SettingDefault
apiUrlhttps://api.usetransactional.com
webUrlhttps://usetransactional.com
outputFormattable
colortrue

File Paths

Show configuration file locations:

transactional config path

Output:

Config Directory: /Users/you/.transactional
Credentials File: /Users/you/.transactional/credentials.json

Environment Variables

Environment variables override configuration file settings:

VariableDescription
TRANSACTIONAL_API_URLOverride API URL
TRANSACTIONAL_WEB_URLOverride Web URL
NO_COLORDisable colored output (set to any value)
FORCE_COLORForce colored output

Example:

# Use staging API
TRANSACTIONAL_API_URL=https://staging-api.example.com transactional email send ...
 
# Disable colors in CI
NO_COLOR=1 transactional email templates list

Output Formats

Table (Default)

Human-readable tabular output:

transactional email templates list
id   name           alias          status   updated
1    Welcome        welcome-email  ACTIVE   2024-01-15
2    Password Reset reset-password ACTIVE   2024-01-10

JSON

Machine-readable JSON output:

transactional email templates list --json
[
  {
    "id": 1,
    "name": "Welcome",
    "alias": "welcome-email",
    "status": "ACTIVE",
    "updatedAt": "2024-01-15T10:30:00Z"
  }
]

YAML

YAML output (when configured):

transactional config set outputFormat yaml
transactional email templates list
- id: 1
  name: Welcome
  alias: welcome-email
  status: ACTIVE
  updatedAt: '2024-01-15T10:30:00Z'

Self-Hosted Setup

For self-hosted Transactional installations:

# Set custom API URL
transactional config set apiUrl https://api.yourdomain.com
 
# Set custom Web URL
transactional config set webUrl https://app.yourdomain.com
 
# Login to your instance
transactional login

CI/CD Usage

For automated environments, you can use environment variables and JSON output:

#!/bin/bash
 
# Disable colors
export NO_COLOR=1
 
# Check if logged in
if ! transactional whoami --json > /dev/null 2>&1; then
  echo "Not authenticated"
  exit 1
fi
 
# Get templates as JSON
TEMPLATES=$(transactional email templates list --json)
 
# Process with jq
echo "$TEMPLATES" | jq '.[].name'