Maton
Guide

CLI

The maton CLI drives the Maton API from your terminal — manage connections and call the gateway.

Installation

curl -fsSL https://maton.ai/install.sh | bash
npm install -g @maton/cli
irm https://maton.ai/install.ps1 | iex

Authentication

maton login                 # open the browser, then paste your API key
maton login --interactive   # skip the browser; paste the key directly
maton whoami                # show the current auth state
maton logout                # clear the active profile's credentials

maton login validates the key against your account and stores it in the OS keyring (use --insecure-storage to save it in plain text). You can also set MATON_API_KEY in the environment to override the stored key. Multiple accounts are supported via profiles — maton login list, maton login switch <profile>, and the global -p, --profile flag (or MATON_PROFILE).

Connections

maton connection list                          # list all connections
maton connection list slack --status ACTIVE    # filter by app and status
maton connection create slack                  # opens the browser to authorize
maton connection get {connection_id}
maton connection delete {connection_id} --yes

connection create waits until the connection becomes ACTIVE; use --interactive to print the URL instead of launching a browser, and --method to pick a non-default auth method.

Calling gateway

Every connected app exposes typed subcommands. Add --connection {connection_id} to target a specific account, and --json / --jq / --template to shape the output.

maton slack channel list --types public_channel --limit 10
maton google-mail message list --hydrate

Passthrough

maton api reaches any gateway endpoint directly:

# GET is the default
maton api '/slack/api/conversations.list?types=public_channel&limit=10'

# typed fields; presence of a field switches the method to POST
maton api /connections -f app=slack

# choose the method and route through a specific connection
maton api -X GET /slack/api/conversations.list --connection {connection_id}

# read a JSON body from a file (or "-" for stdin)
maton api -X POST '/google-sheets/v4/spreadsheets/{id}/values/A1:append?valueInputOption=USER_ENTERED' --input body.json

Triggers

maton trigger list --source github --status ENABLED -L 50
maton trigger create --source github --event-type pull_request.opened \
  --connection-id {connection_id} \
  --parameter repository_full_name=maton-ai/cli \
  --destination '{"url":"https://example.com/hook","method":"POST","name":"prod"}'
maton trigger get {trigger_id}
maton trigger update {trigger_id} --status DISABLED
maton trigger delete {trigger_id} --yes

Destinations

maton trigger destination list --trigger {trigger_id}
maton trigger destination create --trigger {trigger_id} \
  --url https://example.com/hook --method POST --name prod \
  --header X-Token=secret \
  --body-template '{"data": {{ payload.data }}}'
maton trigger destination get {destination_id} --trigger {trigger_id}
maton trigger destination update {destination_id} --trigger {trigger_id} --url https://new.example.com/hook
maton trigger destination delete {destination_id} --trigger {trigger_id} --yes
maton trigger destination rotate-secret {destination_id} --trigger {trigger_id}

Events

maton trigger event list --trigger {trigger_id} -L 20
maton trigger event get {event_id} --trigger {trigger_id}
maton trigger event replay {event_id} --trigger {trigger_id}

# stream new events and run a handler for each (event JSON on stdin)
maton trigger event watch --trigger {trigger_id} --exec ./handle.sh

Global Flags

  • -p, --profile <name> — use a specific logged-in profile (also MATON_PROFILE).
  • --connection <id> — route an app/gateway command through a specific connection.
  • --json, -q/--jq <expr>, -t/--template <tmpl> — format output (--jq and --template require --json).
  • -L, --limit <n> — cap results on list commands (0 = no limit).

For the full command reference, run maton help or see the CLI manual.

On this page