Manage your ImprovMX email forwarding directly from the terminal. Add domains, create aliases, manage SMTP credentials, view logs, and more. Perfect for interacting with ImprovMX from Claude Code, OpenAI Codex, or OpenClaw!
Requires Go 1.21+.
go install github.com/improvmx/cli@latestDownload the latest binary for your platform from Releases.
Get your API key from your ImprovMX dashboard, then:
improvmx auth loginOr set the environment variable:
export IMPROVMX_API_KEY=your-api-keyimprovmx domain list # List all domains
improvmx domain add example.com # Add a domain
improvmx domain get example.com # Get domain details
improvmx domain check example.com # Check DNS configuration
improvmx domain delete example.com # Delete a domainimprovmx alias list example.com # List aliases
improvmx alias add example.com hello user@gmail.com # Add an alias
improvmx alias add example.com "*" user@gmail.com # Add a catch-all
improvmx alias update example.com hello new@gmail.com # Update an alias
improvmx alias delete example.com hello # Delete an aliasimprovmx logs example.com # View recent email logsimprovmx rule list example.com # List rules
improvmx rule get example.com <rule-id> # Get rule details
improvmx rule add example.com --type alias --alias hello --forward user@gmail.com # Add alias rule
improvmx rule add example.com --type regex --regex ".*invoice.*" --scopes subject,body --forward user@gmail.com # Add regex rule
improvmx rule add example.com --type cel --expression "subject.contains('finance')" --forward user@gmail.com # Add CEL rule
improvmx rule update example.com <rule-id> --forward new@gmail.com # Update a rule
improvmx rule delete example.com <rule-id> # Delete a rule
improvmx rule delete-all example.com # Delete all rulesimprovmx smtp list example.com # List credentials
improvmx smtp add example.com user password # Add credentials
improvmx smtp delete example.com user # Delete credentialsimprovmx account # View account info| Flag | Description |
|---|---|
--json |
Output in JSON format |
--help |
Show help for any command |
Every command supports --json for scripting and piping:
improvmx domain list --json | jq '.domains[].domain'# Bash
improvmx completion bash > /etc/bash_completion.d/improvmx
# Zsh
improvmx completion zsh > "${fpath[1]}/_improvmx"
# Fish
improvmx completion fish > ~/.config/fish/completions/improvmx.fishCredentials are stored at:
- macOS:
~/Library/Application Support/improvmx/config.yaml - Linux:
~/.config/improvmx/config.yaml
Requires Go 1.23+.
go build -o improvmx .GOOS=darwin GOARCH=arm64 go build -o dist/improvmx-darwin-arm64 .
GOOS=darwin GOARCH=amd64 go build -o dist/improvmx-darwin-amd64 .
GOOS=linux GOARCH=amd64 go build -o dist/improvmx-linux-amd64 .
GOOS=linux GOARCH=arm64 go build -o dist/improvmx-linux-arm64 .
GOOS=windows GOARCH=amd64 go build -o dist/improvmx-windows-amd64.exe .To distribute the macOS binaries without Gatekeeper warnings, you need to sign and notarize them with an Apple Developer ID.
- An Apple Developer Program membership (Organization, requires a DUNS number)
- A Developer ID Application certificate — create one at Certificates, Identifiers & Profiles:
- Choose Developer ID Application
- Select G2 Sub-CA (Xcode 11.4.1 or later) as the intermediary
- Generate a CSR via Keychain Access → Certificate Assistant → Request a Certificate From a Certificate Authority (save to disk)
- Upload the CSR and download the resulting
.cerfile - Double-click the
.cerfile to install it into your Keychain
- An app-specific password from Apple ID account (Sign-In and Security → App-Specific Passwords)
security find-identity -vYou should see something like:
1) XXXXXXXX "Developer ID Application: ImprovMX Incorporated (2TMRXZB6JT)"
codesign --sign "Developer ID Application: ImprovMX Incorporated (2TMRXZB6JT)" \
--options runtime \
--timestamp \
dist/improvmx-darwin-arm64
codesign --sign "Developer ID Application: ImprovMX Incorporated (2TMRXZB6JT)" \
--options runtime \
--timestamp \
dist/improvmx-darwin-amd64codesign --verify --verbose dist/improvmx-darwin-arm64
codesign --verify --verbose dist/improvmx-darwin-amd64Store your credentials in the Keychain to avoid passing them on the command line:
xcrun notarytool store-credentials "improvmx" \
--apple-id "YOUR_APPLE_ID" \
--team-id "2TMRXZB6JT" \
--password "YOUR_APP_SPECIFIC_PASSWORD"# Zip the binaries
ditto -c -k --keepParent dist/improvmx-darwin-arm64 dist/improvmx-darwin-arm64.zip
ditto -c -k --keepParent dist/improvmx-darwin-amd64 dist/improvmx-darwin-amd64.zip
# Submit for notarization
xcrun notarytool submit dist/improvmx-darwin-arm64.zip \
--keychain-profile "improvmx" \
--wait
xcrun notarytool submit dist/improvmx-darwin-amd64.zip \
--keychain-profile "improvmx" \
--waitNotarization typically takes under 5 minutes. If a submission gets stuck, check Apple's system status and resubmit.
# List all submissions
xcrun notarytool history --keychain-profile "improvmx"
# Get details for a specific submission
xcrun notarytool info SUBMISSION_ID --keychain-profile "improvmx"
# View the log if rejected
xcrun notarytool log SUBMISSION_ID --keychain-profile "improvmx"After building, signing, and notarizing, create a GitHub release:
# Tag the release
git tag v0.2.0
git push origin v0.2.0
# Create the release with all binaries
gh release create v0.2.0 \
dist/improvmx-darwin-arm64 \
dist/improvmx-darwin-amd64 \
dist/improvmx-linux-amd64 \
dist/improvmx-linux-arm64 \
dist/improvmx-windows-amd64.exe \
--title "v0.2.0" \
--notes "Release notes here"Make sure to upload the signed and notarized macOS binaries, not the unsigned ones.
MIT