Connect channels with an AI agent
Use this workflow after agent setup has verified a native reply and the agent has recommended a channel (step 8). This page is CLI-only on purpose, so an AI agent can follow it; the clicks in the CatalEx app are in Messaging channels and in each app's guide. It gives each terminal command with its expected result. The person still does the provider-side steps in a browser or on a phone; the Slack, WhatsApp, Google Chat and WhatsApp Personal guides describe those screens.
Messaging channels need CatalEx Cloud, so CatalEx must be signed in to the person's CatalEx account. If catalex channels add refuses with a reason about cloud hosting or signing in, ask the person to sign in first.
One step at a time
Give the person one action and its link, then wait for the answer before the next. Keep each message that asks the person to act short, at most about three lines: what to do, the named link, and exactly what to send back and how. Never end a step with only "tell me when it's done"; say what they hand back next. Don't put a status report, recap or list of pending items in a step message; give the summary once, after the setup finishes. Don't list create, install, copy credentials and save in one message, and don't make a long raw URL the message: name the link in words and give the short link the command prints. Name every link a step needs.
1. Inspect what exists
catalex agents list
catalex accounts list --json
catalex channels list --json
catalex accounts health
If a free account of the right app already exists, connect it instead of creating another:
catalex channels add --agent AGENT_ID --type slack --account ACCOUNT_ID
If another agent uses it, tell the person that moving it removes that agent's channel, and add --move only after they agree. Don't create a second account to repair credentials; see Replace credentials.
2. Add a new account for the agent
catalex channels add --agent AGENT_ID --type TYPE --new
Leave out --name: the account is then named after the agent, exactly as catalex agents list shows it. Pass --name only when a person asks for a different account name.
Use slack, whatsapp, googlechat or whatsapp_personal for TYPE. Add a new account for an agent only this way, never with catalex accounts add: an account added alone has no agent, and a WhatsApp Personal account added alone cannot be set up. Expected: Next: set it up: followed by catalex destinations setup ACCOUNT_ID --APP with the new account's ID. The agent gets the channel when setup finishes.
A setup that is never finished isn't kept. If you abandon one, clear it with catalex accounts clear-setups --agent AGENT_ID.
3. Follow the published actions
Read the current checkpoint without changing anything:
catalex destinations setup ACCOUNT_ID --APP
It prints the setup state, a Next: line, the Allowed actions: and the fields the next action needs. Run only an action it lists. Nonsecret fields use --value NAME=VALUE. Secrets use --input-file NAME=FILE (a private file, mode 0600) or piped --input-stdin NAME; a secret passed with --value is refused before anything is sent. On a terminal, a secret you don't supply is asked for in a hidden prompt. Don't print a secret or paste it in chat.
Each action prints its operation ID first. If a reply is lost, inspect the original attempt with --operation-id OPERATION_ID before sending the action again. A pending approval is never a reason to create another app.
Slack
The name people see in Slack is the agent's CatalEx name, exactly as catalex agents list shows it (same spelling and capitalization). Never propose, recommend or ask about a different app name or bot name. Pass the agent's name as both, and write the description yourself: one line, at most 140 characters, from the agent's instructions, without asking. If the name contains the word "Slack" or is longer than 35 characters, Slack refuses it: tell the person why and ask for a name to use instead.
catalex destinations setup ACCOUNT_ID --slack --action prepare
catalex destinations setup ACCOUNT_ID --slack --action connect --value app_name=AGENT_NAME --value bot_display_name=AGENT_NAME --value description=TEXT
connect prints SLACK_CREATE_APP and a short link (/slack/create/<attempt id>) under "Continue in the provider:". The person chooses the workspace and creates the app. Before you send the next message, choose the folder path in full, such as /private/tmp/slack-creds-a1b2c3 with a random suffix, and use that exact path in your commands and in the message. Make that private folder (mode 0700) with two empty files, client_secret and signing_secret (mode 0600). On the person's own computer, open both in a text editor for them (open -e FILE on macOS, xdg-open FILE on Linux); on a remote computer, ask them to create the two files themselves. Then send one message, every time, in this form, with the real folder path in place of /PRIVATE and the real link in place of the placeholder (on a remote computer, drop "both are open in TextEdit" and say to create the files there):
Create the app in Slack: the short link, named “Create the app in Slack”. Then open its Basic Information page and send me the App ID and Client ID here. Paste the Client Secret into
/PRIVATE/client_secretand the Signing Secret into/PRIVATE/signing_secret(both are open in TextEdit), and save. Don't paste the secrets here.
Fill in real values before you send: create the files, replace every placeholder, and check the message has no $, /PRIVATE, XXXXXX or < left. The create link is the short CatalEx link connect printed, never an api.slack.com URL. A filled-in message:
Create the app in Slack:
https://app.catalex.co/slack/create/k3x9Qd(named "Create the app in Slack"). Then open its Basic Information page and send me the App ID and Client ID here. Paste the Client Secret into/private/tmp/slack-creds-a1b2c3/client_secretand the Signing Secret into/private/tmp/slack-creds-a1b2c3/signing_secret(both are open in TextEdit), and save. Don't paste the secrets here.
The App ID and Client ID are not secret and come back in chat. The two secrets go only into the files. The Basic Information page is the credentials_url value of the result (Your Slack apps until the app exists). If the person pastes a secret in chat anyway, write it to its file, use it, delete the files afterwards and tell them in one line to regenerate both on Basic Information. When you have both IDs and the person says the files are saved:
catalex destinations setup ACCOUNT_ID --slack --action save_credentials --wait --value app_id=APP_ID --value client_id=CLIENT_ID --input-file client_secret=/PRIVATE/client_secret --input-file signing_secret=/PRIVATE/signing_secret
Expected, with --wait: SLACK_WAITING_APPROVAL and "Waiting for you to allow the app in Slack:" with an approval link. Run that save_credentials command in the background (it waits 10 minutes by default; --wait-timeout changes that) and give the person the approval link it prints, in a short message that says to choose Allow and that you will continue by yourself. They open it and choose Allow; when the command exits 0 the account is bound, and you continue from there. Delete the private folder then. Don't tell the person you will "keep watching" without that command running. A decline or timeout exits non-zero and names the command to repeat. To resume, or to get a new approval link if the old one was lost, expired or declined, or after a workspace administrator approved the app, run catalex destinations setup ACCOUNT_ID --slack --action reopen --wait in the background.
WhatsApp
The checkpoint offers connect_meta and discover. Prefer connect_meta: the person signs in to Meta in a browser and CatalEx finds the number, so no credential files are needed.
catalex destinations setup ACCOUNT_ID --whatsapp --action prepare
catalex destinations setup ACCOUNT_ID --whatsapp --action connect_meta
It prints Connect with Meta: and a link. Give the link to the person; they open it and finish Meta's sign-in. You cannot do that step for them, but you can run every other one. Then read the checkpoint again and take the allowed actions in the table below, starting with select_number.
Use discover instead when the person already has the Meta credentials in private files:
catalex destinations setup ACCOUNT_ID --whatsapp --action discover --input-file app_secret=/private/meta-app.secret --input-file access_token=/private/whatsapp.token --value business_account_id=BUSINESS_ACCOUNT_ID --value phone_number_id=PHONE_NUMBER_ID
Both IDs are the numeric IDs beside the sender in Meta's Try it out page. The Meta app ID is read from the token; --value app_id=APP_ID is optional. Then read the checkpoint and take each allowed action until its first line ends (verified):
| Action | Add |
|---|---|
select_number | --value phone_number_id=PHONE_NUMBER_ID |
configure_webhook | Nothing. Offered only to retry after Meta refused the webhook update |
request_code | --value method=SMS or --value method=VOICE |
verify_code | --input-file verification_code=/private/code |
register_number | --input-file pin=/private/pin |
verify | Nothing |
Google Chat
catalex destinations setup ACCOUNT_ID --googlechat --action prepare
Expected: a Callback: line with the HTTP endpoint URL and the numbered setup steps with their console links. The person follows them in Google Cloud, downloading the service-account key and the OAuth client JSON. Then:
catalex destinations setup ACCOUNT_ID --googlechat --action authorize --value project_number=PROJECT_NUMBER --input-file service_account_key=/private/chat-key.json --input-file oauth_client=/private/chat-client.json
Both files are required: authorize without oauth_client is refused before anything is saved. Expected: the first line ends (committed), then Code to send the app:. The person sends exactly that code to the app in a Google Chat direct message. Then:
catalex destinations setup ACCOUNT_ID --googlechat --action verify
Expected: the first line ends (verified). Until the code arrives, --json shows CALLBACK_CHECK_PENDING.
WhatsApp Personal (experimental)
The first step asks the person to accept a risk: WhatsApp doesn't officially support linking automation tools and may restrict the number. Show them the notice that catalex destinations setup ACCOUNT_ID --whatsapp_personal prints and accept it only after they agree:
catalex destinations setup ACCOUNT_ID --whatsapp_personal --action prepare --value risk_acknowledged=true
catalex destinations setup ACCOUNT_ID --whatsapp_personal --action link
It shows a QR code for the person to scan from WhatsApp on their phone (Settings › Linked devices › Link a device). For a pairing code instead, add --value phone=+15551234567 with the person's number. Expected: Linked +<number> (<name>). If you press Ctrl-C, the command prints how to resume with --operation-id.
Shared link
A shared link lets someone try the agent in a browser, with no messaging app. It needs no setup steps:
catalex channels add --agent AGENT_ID --type share_link
catalex channels remove CHANNEL_ID
The first command prints the address to give out. The second unlinks it; take CHANNEL_ID from catalex channels list --agent AGENT_ID. See Share an agent.
The person usually cannot see an agent's tool output, so ask them to run the link command themselves (in Claude Code, prefix it with !) so the QR code shows in their terminal. Otherwise paste the whole QR block into your reply inside a code block. A code expires after about 2 minutes; run link again for a new one.
4. Verify a real reply
catalex channels list --agent AGENT_ID
catalex accounts health ACCOUNT_ID
Then ask the person to send a message in the messaging app. Check the reply there and the matching conversation in CatalEx. Report setup, channel assignment and actual delivery as separate results; a connected account alone doesn't prove the agent answers.
Review who may message the account with catalex accounts access and catalex accounts limits, or in the app on the agent's Settings, Channels tab, by opening the channel's card. See Access, approvals and limits.
Check the agent's two switches on the channel. They start on for Slack and Google Chat and off for WhatsApp and WhatsApp Personal:
catalex accounts agents switches show ACCOUNT_ID --agent AGENT_ID
catalex accounts agents switches set ACCOUNT_ID --agent AGENT_ID --chat-commands on
Chat commands decides whether a message starting with / is a command or ordinary text for the agent. System messages (--system-messages on|off) decides whether CatalEx's own notices reach people in the messaging app. A change applies from the agent's next message. Run accounts access, accounts limits and accounts agents switches set only after the account's setup has finished: on an unfinished account they fail with "Choose the existing provider installation this named account uses." Finish the setup first.
Replace credentials
To replace a rotated or revoked secret on a connected account without setting it up again:
catalex credentials set ACCOUNT_ID --token-file /private/slack.token
catalex credentials set ACCOUNT_ID --token-stdin < /private/whatsapp.token
catalex credentials set ACCOUNT_ID --key-file /private/chat-key.json
The first two replace a Slack bot token or WhatsApp access token. For Google Chat, --key-file takes either a new service-account key or an OAuth client JSON. Expected: an Operation: line, then Credential operation OPERATION_ID: committed. A rejected token or key exits with CREDENTIAL_REJECTED and leaves the saved one in use. --token-stdin and --key-stdin read the secret from a pipe instead of a file.
When an account's saved credential is refused, catalex accounts list adds "· Needs attention" to it and prints this command as the fix; catalex accounts health ACCOUNT_ID names the finding.