What those CLI commands are for:

  • connecting email accounts
  • testing the connection with your credentials (stored locally, encrypted with a key you own)

What they’re not for:

  • creating or deleting email accounts

Should you need help with the CLI syntax, you can always invoke:

relay accounts --help

Connect an email account

Add a new IMAP account with interactive setup. The CLI will auto-detect your email provider and configure the appropriate settings.

relay accounts add

Follow the prompts to enter your account details. The CLI will guide you through:

  • Account name (for reference)
  • Email address
  • Provider selection (auto-detected when possible)
  • Password (with confirmation)
  • Server settings (auto-configured for known providers)

Supported providers

Gmail

Automatically configures imap.gmail.com:993

Outlook

Automatically configures outlook.office365.com:993

Yahoo Mail

Automatically configures imap.mail.yahoo.com:993

iCloud Mail

Automatically configures imap.mail.me.com:993

For Gmail, you’ll need to use an App Password instead of your regular password. Generate one at myaccount.google.com/apppasswords.

Options

OptionShortDescription
--name-nAccount name for reference
--email-eEmail address
--provider-pEmail provider (gmail, outlook, yahoo, icloud, custom)
--imap-serverIMAP server address (for custom providers)
--imap-portIMAP port (for custom providers)

List email account connections

Display all configured email accounts in a formatted table.

relay accounts list

Alias: relay accounts ls

The output shows:

  • Account name
  • Email address
  • Provider type
  • IMAP server
  • IMAP port

If no accounts are configured, the CLI will display a helpful message prompting you to add one.

Disconnect an email account

Remove an account and its stored credentials from your system.

relay accounts remove work

The CLI will ask for confirmation before removing the account.

This action is irreversible. You’ll need to re-add the account if you want to use it again.

Test a connection

Verify that your account credentials are working and the server is reachable.

relay accounts test work

This command will:

  • Connect to the IMAP server
  • Authenticate with your stored credentials
  • Verify the connection is working
  • Display success or error messages

Use this command to troubleshoot connection issues or verify your setup after adding an account.