Skip to main content

Set up with an AI agent

This playbook takes a computer with no CatalEx software installed to an agent that answers in a CatalEx native chat. The agent reading it installs the catalex command first, then uses it for everything else.

Read this page in full before starting. A web-fetch tool that summarizes pages drops commands and links; fetch the raw Markdown with curl -fsSL https://docs.catalex.co/getting-started/agent-setup.md instead, and do the same for every page it links (add .md to the address).

You need an Apple Silicon Mac and a Codex or Claude Code agent that can run terminal commands, already installed and signed in. Open the agent in the folder you want to onboard.

The person may know nothing about CatalEx. Explain each limit in plain words when it first matters, and suggest what to change instead of leaving it for them to discover. Follow the steps in order. Make the default choices yourself and ask the person only for the sign-ins they must complete the settings of step 7 and the channel of step 8: Google for CatalEx Cloud, and the AI tool's own sign-in if it is signed out. If catalex account status already shows a signed-in account, use it without asking, even when its email differs from the AI tool's account, and name it in your report. CatalEx has no email and password sign-in. Signing in to CatalEx is required: without it, every catalex command that touches agents, chats or channels fails with ACCOUNT_SIGNIN_REQUIRED. Keep the agent's folder, AI tool, instructions and restrictions as they are. Do the whole setup with the installer and catalex commands: do not edit CatalEx's configuration, databases or credential files, call its APIs with curl, start or kill its processes by hand, or stop a process you did not start. Install no skill or plugin for CatalEx during setup: this page and catalex --help are everything you need, and Keep CatalEx in the agent's memory says where to come back to. If the person's CatalEx plugin brought you here, carry on: it only points to this page. If catalex is already installed, go to Existing installations. If the person would rather click than type, the CatalEx app does the same setup; send them to Get the CatalEx app and carry on from step 5 once they are signed in.

Three rules hold for the whole setup. A setup that breaks one is not finished:

  1. Ask before widening any setting. Suggest each change the agent needs (file reading, a message cap, turning off connected tools, a channel) with its reason, then stop and wait for the person's answer. Never turn a setting on or off, or set a cap, because it seems obviously right.
  2. Open the app once the agent is ready, not before. Do not open the CatalEx app before or during the install, the sign-in or the setup: it can get stuck waiting for them. Pass --no-launch to the installer and to catalex setup, then run catalex open once, unless the person asked for the app to stay closed (step 9).
  3. Never message a real person or phone number to test; test in the agent's native CatalEx chat.

1. Install the CatalEx CLI​

Every later step needs the catalex command. Run the one-line installer:

curl -fsSL https://downloads.catalex.co/install/catalex.sh | sh -s -- --no-launch
export PATH="$HOME/.local/bin:$PATH"
catalex version

The installer asks nothing, and needs no GitHub account or token. It downloads the newest release, checks every file against the release checksums, installs catalex in ~/.local/bin and adds that folder to new login shells' PATH. It also installs the service that runs agents and the web app, starts CatalEx and waits, for up to 2 minutes (set CATALEX_START_TIMEOUT to a number of seconds to wait longer), until it is ready; it then prints CatalEx is running. If it prints an error saying CatalEx was installed but is not running, stop and report that error. On an Apple Silicon Mac it also installs the CatalEx app. --no-launch keeps the app window closed while you set up; CatalEx itself is still started. Always pass it here: you open the app yourself, last, in step 9. Running the installer again is safe. The person can also download the app alone from https://downloads.catalex.co/latest/CatalEx-arm64.dmg; the install page lists every option.

Expected result: catalex version prints a version number, such as 0.1.0. Do not run any other catalex command until it does.

  • A download error: check the network and run the same command again. Do not fetch the installer from any other address.
  • catalex: command not found: run the export PATH line again in this shell.
  • The CatalEx app is open, so it was kept as it is. Quit it and run: catalex install app: the CatalEx app is open, so the installer left it as it is and still installed and started everything else. Do not quit the app and do not pass --yes: the person may be using it. Tell the person the app was not updated and that catalex install app installs it once they quit it.
  • No desktop app wanted: only when the person says so, pass --no-app (sh -s -- --no-app). It cannot be combined with --no-launch.

2. Install the components​

Do not ask which setup the person wants. CatalEx Cloud carries the agents' messages, so the person runs no server and needs no public address. The installer already installed the service that runs agents and the web app, and started them (CatalEx is running.). Do not install them again: a second install service web downloads the service again and can leave CatalEx stopped. Check instead:

catalex install status

Expected result: install status lists catalex, service and web (and the app, if installed) as installed. Only if a component is missing, run catalex install COMPONENT. If catalex status says CatalEx is stopped, run catalex start. Nothing is set up yet; step 4 does that.

3. Check the AI tool​

catalex providers discover

Use the AI tool this folder already runs on: claude or codex, or both when the person uses both. If it is missing or too old, ask the person to install or update it. If it is signed out, run catalex providers login claude (or codex) and let the person complete the provider's own sign-in. Never sign in for them. Run catalex providers discover again. Only providers discover, connect, disconnect and login run before the CatalEx sign-in of step 4; a bare catalex providers fails with ACCOUNT_SIGNIN_REQUIRED until then. After setup, catalex providers lists only what a detection already recorded, so an empty list means "not checked yet", never "not installed". Do not tell the person a provider is missing until catalex providers discover has run and says so.

Expected result: the chosen provider shows as installed and signed in. discover finds Claude Code and Codex even when their folder, such as ~/.local/bin, is not on PATH. Do not switch the folder to another provider to get past an error.

4. Start CatalEx and sign in to CatalEx Cloud​

First tell the person what will happen, in plain words. For example: "A CatalEx sign-in page is opening in your browser. Sign in with Google there. You don't need to reply; I'll carry on when you're done."

Then run this command. Replace claude with codex for a Codex agent:

catalex setup --preset cloud --native-providers claude --start --no-launch

--no-launch keeps the app closed, so setup does not open it. The command waits up to 10 minutes for the sign-in. Run it in the background or with a 10-minute timeout, and do not wait for the person to answer you: the command finishes on its own. On its error output it prints:

Setting up CatalEx Cloud needs your CatalEx account; signing in first.
Sign in with Google in your browser:
https://…
Waiting for you to finish signing in...
Signed in to SERVICE as EMAIL.
This computer is now one of your computers.
Trusted for changes: yes

If the person says no browser window opened, give them the link printed under Sign in with Google in your browser:. After they sign in, the browser page reads "You're signed in to CatalEx". The command then joins this Mac to their account, starts native chats and connects to CatalEx Cloud. If this computer already has a CatalEx sign-in, the sign-in lines are skipped. Setup reuses saved choices, so running the same command again after an interruption or a fix is safe and continues where it stopped.

Expected result: the command exits 0. Run catalex account status to confirm; it prints Account: signed in as EMAIL and Trusted for changes: yes. Tell the person which email is signed in.

  • Sign-in expired or cancelled (SIGN_IN_EXPIRED, SIGN_IN_CANCELLED): run the same command again. It starts a new sign-in.
  • DEVICE_NOT_TRUSTED: the account already has a trusted device, such as the CatalEx app, so this computer's first sign-in is not trusted for changes yet. Tell the person to trust this computer in the app's device list (Settings > Devices), or to run catalex devices trust CLIENT_ID on a trusted device. Then run the same setup command again. Do not run catalex login for it.
  • An occupied port: pick free ports and pass them, for example --control-port 53101 --service-port 53106. catalex setup --help lists every port flag.
  • The person has no Google account, or wants another sign-in: there is none. Google is the only way to sign in to CatalEx. Stop and tell them.
  • The sign-in must happen in a different browser: the person can open the printed link there, or run catalex login themselves (in Claude Code, ! catalex login) and then the setup command.
  • this build has no CatalEx Cloud address: run catalex update, then the setup command again.
  • The person does not want to sign in now: stop here. Without a CatalEx sign-in, catalex agents, chats and channels commands are refused, and the CatalEx app asks for the sign-in before it shows anything. Tell them the next step is step 4.

Describe the result simply: their agent runs on this Mac and CatalEx Cloud carries its messages. Do not explain servers, tokens or setup modes unless they ask.

5. Onboard the agent folder​

Use the absolute folder this agent starts in, where its instructions live. Do not copy a packaged agent into a new folder. The add an agent page lists every onboarding finding and the rest of the procedure for an agent that onboards itself; read it before step 5 when a finding needs a decision. For several roles, onboard each role's folder separately. To list other agent folders on this computer, run catalex agents discover; it shows up to 12 recent folders that look like agents (for example, with SOUL.md, or CLAUDE.md/AGENTS.md and no build manifest); code projects, worktrees and temporary folders are skipped, and an empty list is a valid answer.

First check the folder. Nothing changes yet:

catalex agents onboard --folder /absolute/agent-folder --name "Support agent" --agent claude --json

Use --agent codex for Codex. data.findings lists what stands in the way. Findings with repairable: true are fixed by the next command. Resolve the others first; see Resolve onboarding findings. For a Claude Code package whose launcher isolates the agent, --apply chooses folder isolation on its own. For Codex, do not remove a package's isolation requirements to make it register.

Then repeat the same command with --apply:

catalex agents onboard --folder /absolute/agent-folder --name "Support agent" --agent claude --apply --json

Expected result: state is onboarded. Record data.agent.id (the agent ID), data.agent.native_chat_channel (its native chat channel) and data.changed (the files it repaired). Onboarding adds a marked CatalEx block to the agent's instructions and leaves everything outside it, including the package's own guards, unchanged. action_required means a person step remains: settle it and run the command again. Rerunning is safe.

A person who has no agent folder yet can start from a bare one: catalex agents add --name Helper --folder /absolute/folder --agent claude registers a folder without repairing it (a new empty folder such as ~/catalex-agent will do). Without --model the agent uses its provider's own default; catalex defaults show lists the verified models. Prefer onboard for an existing agent, which checks the folder first.

An agent whose tool serves one fixed person needs per-person routing before it can serve separate chats safely.

6. Verify a real reply​

catalex chats create --channel NATIVE_CHAT_CHANNEL_ID --name "Setup check" --json
printf 'Reply with exactly: CATALEX READY\n' | catalex chats send CHAT_ID --wait
catalex chats history CHAT_ID

Use data.agent.native_chat_channel from step 5 as NATIVE_CHAT_CHANNEL_ID (it is also the agent's native_chat channel in catalex channels list --agent AGENT_ID), and the data.id of the create result as CHAT_ID.

Expected result: the reply contains CATALEX READY. Then ask a question that only the folder's files or tools can answer, and compare the answer with the source. Test a restriction if the package has one. A greeting alone does not prove that tools or instructions loaded. Keep the chat.

A new agent can't read its folder's files yet (step 7), so an answer such as "file reading is switched off" is expected here, not a failure.

Keep the app closed for now; step 9 opens it. After a successful reply, also ask the one question the agent exists to answer; Verify the agent says how to judge it.

7. Suggest the agent's settings​

CatalEx starts every agent with the bare minimum, and never widens it on its own. Work out what this agent needs from two things: what the person asked for, and what the folder shows (its instructions and the files they name). Then tell the person in plain words what the agent can and cannot do now, suggest the changes it needs, and ask. Use the AI tool's structured question tool when it has one (Claude Code: AskUserQuestion), otherwise a short numbered list. The tool takes up to four questions with up to four options each; group or split to fit. Ask one question per decision, put the recommended option first and mark it "(Recommended)", and word the options for what this agent will do (name its files or scripts), not a generic list. Access switches (reading files, editing files, the terminal) are one multi-select question; a daily cap is its own question, and so is adding the instructions block to the folder's CLAUDE.md (yes or no). Change nothing until they answer; apply only what they agree to. Applying a suggestion without a yes is a mistake even when the agent clearly needs it.

What a new agent starts with:

SettingStartsIn plain words
File reading and searchingOffIt can't open the files in its folder
File editing and creatingOffIt can't change or add files
TerminalOffIt can't run commands or scripts
Web search and fetch, task list, skillsOnIt can look things up online
Connected tools from the person's Claude or Codex account (for example Gmail or Slack)OnIt can use those accounts, as the person has set them up
ApprovalsThe folder's ownWhen it asks before acting, the person decides in CatalEx
Message capNoneIt answers every message it gets

Read the agent's current settings with catalex agents tools --agent AGENT_ID and catalex agents limits show AGENT_ID. Suggest from what you found:

You seeSuggest
The instructions answer from files in the folder (a menu, notes, a price list)Read-only file access: Read, Glob and Grep
The agent keeps notes or updates filesFile editing too, after the person agrees
The agent runs scriptsThe terminal; say plainly that it can then run any command in its folder
Strangers will reach it (a shared link, customers, a public number)A daily cap, such as 50 a day, and turning off connected tools it doesn't need, since anyone who reaches the agent can ask it to use them
Nothing it needs is offNo change; say so

For example: "Your bakery assistant answers from menu.md and hours.md, but CatalEx agents start without file access, so it can't read them yet. Shall I turn on read-only access to its own folder? It still can't change files or reach anything outside the folder." File tools reach only the agent's own folder and any extra folders the person added; CatalEx blocks reads outside them, including .. and symbolic-link escapes.

To turn on read-only file access, run catalex agents tools --agent AGENT_ID --builtin-tool-on Read,Glob,Grep. The saved change stays pending until the agent's next message, so the next chat message in step 6's style proves it. If your release (earlier than 0.1.19) refuses the command for missing flags (--operation-id, --revision and the rest), run this instead, which keeps every other saved choice and needs jq (/usr/bin/jq on macOS 15 and later):

AGENT_ID=AGENT_ID
catalex agents tools --agent "$AGENT_ID" --json > /tmp/agent-tools.json
catalex agents tools --agent "$AGENT_ID" \
--operation-id "read-files-$(date +%s)" \
--revision "$(jq -r '.data.desired_revision' /tmp/agent-tools.json)" \
--inventory-revision "$(jq -r '.data.inventory_revision' /tmp/agent-tools.json)" \
--mcp-server "$(jq -r '.data.desired.enabled_mcp_servers | join(",")' /tmp/agent-tools.json)" \
--terminal-access "$(jq -r '.data.desired.terminal_access' /tmp/agent-tools.json)" \
--approval-mode "$(jq -r '.data.desired.approval_mode' /tmp/agent-tools.json)" \
--builtin-tool "$(jq -r '[.data.desired.enabled_builtin_tools[], (.data.servers[] | select(.group == "builtin" and (.name | IN("Read","Glob","Grep"))) | .id)] | unique | join(",")' /tmp/agent-tools.json)" \
> /dev/null
catalex agents tools --agent "$AGENT_ID" --json | jq '.data | {state, desired_revision}'

The state reads pending and becomes applied at the agent's next message. Then ask the file question again in the same chat and compare the answer with the file. Leave editing and the terminal off unless the person agreed. Tools and permissions lists every setting.

8. Recommend and connect a channel​

The native chat always works, so it is never the recommended stopping point: an agent is useful once people reach it where they already talk. Recommend one channel from the agent's context, its instructions, tools and the people it serves, and use the checkpoint workflow for the terminal commands. CatalEx Cloud needs no public address.

Who the agent servesRecommend
Customers, patients or the public (bookings, support, orders)WhatsApp: a business number, or WhatsApp Personal for a small business run from the owner's phone
The person themselves, friends or family (a personal assistant, a hobby agent)WhatsApp Personal links their own number by scanning a QR code (experimental)
A team or workplaceSlack, or Google Chat when the team uses Google Workspace
Anyone who should try it once, with nothing to installA shared browser link: Share an agent

WhatsApp business uses a Meta app; the easiest way is the browser "Connect with Meta" flow, otherwise enter the credentials manually.

Ask once, with the recommended channel first and marked "(Recommended)", then the other channels, then "Only the CatalEx app for now" last. Describe each option by its outcome for this agent (who can reach it, where, and what that person does), never by its setup. For a joke agent, for example:

  • WhatsApp Personal (Recommended): friends message your number on WhatsApp and the agent replies there; you scan one QR code.
  • Shared link: anyone you send the link to chats with it in their browser, no app or account; anyone holding the link can use it.
  • Slack: your team asks it in Slack channels and direct messages.
  • Only the CatalEx app for now: only you can chat with it, in the app.

Never mark the native chat alone as recommended. When the package or the person already named a channel (for example "put it on Slack" or "give me a URL"), use it without asking. When the person declines, keep the native chat and name the channel you recommended as the next step in your report.

Go one step at a time, as Connect channels with an AI agent says. Take each setup as far as the person's own step, then give them exactly what the command printed. WhatsApp business: --action connect_meta prints a Connect with Meta: link for the person to open; that browser sign-in is theirs, not a blocker. WhatsApp Personal: --action link prints a QR code (or, with --value phone=+NUMBER, a pairing code) and waits about 2 minutes for the scan. The person usually cannot see your tool output, so a QR code that stays there cannot be scanned. Ask the person to run the command themselves, so the code appears in their own terminal (in Claude Code: ! catalex destinations setup ACCOUNT_ID --whatsapp_personal --action link). If they can't, paste the whole QR block into your reply inside a code block, or give them the pairing code. Then read the checkpoint until it reports the linked number. Slack: the app and bot take the agent's CatalEx name exactly, with no proposal or question; --action connect prints the app-creation link, the person sends the App ID and Client ID in chat and pastes both secrets into private files you opened for them, and --action save_credentials --wait prints the approval link and follows it (Slack). Google Chat: --action prepare prints the console steps. When you run on the person's own computer, open each link the command prints in their browser yourself (open URL on macOS, xdg-open URL on Linux), say it is open, and still give the link in chat; on a remote computer, or when opening fails, only give the link. Never create the provider app, sign in to it or enter its credentials yourself.

To cap the agent as a whole, for example "at most 20 messages a day", use catalex agents limits set AGENT_ID --day 20 (--hour for an hourly cap). It applies at once to every channel, shared links included, even while a messaging setup is unfinished. Set a channel's own access rules and limits (catalex accounts access, catalex accounts limits) only after its setup has finished; on an unfinished account they fail. Then check the account's access rules and limits and send a real message from the messaging app. A native-chat reply does not prove WhatsApp, Slack or Google Chat delivery.

9. Report the result and open the app​

Report each outcome separately, as observed: installed (catalex install status), configured and running (catalex status), signed in (the email from catalex account status), the agent's name and folder, the files onboarding changed, the native reply, and messaging delivery. If the person declined a channel, name the one you recommended as the next step. Name anything still pending, such as a provider sign-in, the CatalEx Cloud sign-in or a delivery check. Write it in plain words in your reply, with what the person can ask you to do next. Do not write a separate summary document.

Then open the app once, with catalex open, unless the person asked for no app or for it to stay closed:

  • They asked for Slack, WhatsApp or Google Chat: as the last step of that channel's setup, as soon as it is connected (its --wait command exited 0), in the same message that asks them to try the agent there. Do not wait for their test reply. With several channels, open it after the last one.
  • Native chat only, or no channel named: as soon as the agent answered in its native chat, at the end of that turn.

Tell them the agent is in the app and the "Setup check" chat holds the test, and that they can return to this session to read the summary.

If a step fails, read the error code and its next action, repair it with supported commands and run the same step again. Do not switch providers or recreate accounts quietly. See Troubleshooting.

Keep CatalEx in the agent's memory​

Onboarding writes a short CatalEx block into the folder's AGENTS.md or CLAUDE.md, between <!-- CATALEX:START --> and <!-- CATALEX:END -->. The block points back to two places. Whenever you, or a later session in this folder, need to do something with CatalEx, go there instead of installing a skill:

  • catalex --help, and catalex COMMAND --help, for the installed release's commands and flags. The catalex command updates itself, so its help is always current.
  • https://docs.catalex.co/llms.txt, the index of every guide. Fetch a guide's raw Markdown by adding .md to its address.

Leave the block as it is. Everything outside it is the agent's own and stays untouched, and a later onboard --apply refreshes the block when it is outdated.

After setup​

Once the folder is onboarded, read the person's later requests about "the agent" (what it may read or do, where people can reach it, its limits, removing it) as changes to the CatalEx agent. Do not answer such a request yourself from the folder's files. For each request:

  1. Change only what the person asked for, with catalex. If you think another setting should change too (for example turning off connected tools for a public agent), suggest it in one sentence with the reason and wait for a yes. Never change it on your own.
  2. Check the result in the agent's native chat.
  3. Explain what changed in plain words, not how. The person never needs to know the catalex commands.

Update, stop, repair and remove​

  • Update: catalex update --check, then catalex update. Add --restart while CatalEx runs: it stops, updates and starts CatalEx again.
  • Stop or start: catalex stop, then catalex start.
  • Repair: catalex doctor --fix restarts CatalEx when it stopped. See Everyday operation.
  • Remove: catalex uninstall keeps saved chats and settings. Use catalex uninstall --purge only when the person explicitly asks to delete their data.

Existing installations​

  1. Run command -v catalex. If it prints nothing, start at step 1.
  2. Run catalex version and catalex install status. Install any missing component from step 2.
  3. Run catalex status and catalex account status. A sign-in made in the CatalEx app counts: both read the same sign-in.
    • Nothing is configured: continue with steps 3 and 4.
    • Configured but signed out of CatalEx Cloud: run the step 4 command. It reuses the saved setup, signs in and connects.
    • A saved setup is stopped: run catalex start.
  4. Reuse a running setup; do not reinstall or reset it. To add another installed provider, run catalex providers connect codex (or claude). Then continue with step 5 for the new folder.

Rules and recovery​

Read catalex COMMAND --help for the installed release's flags. Every command accepts --json and prints one catalex.result.v1 result; use it when you need fields. Change configuration and lifecycle only through catalex. Do not edit CatalEx's configuration or databases, call its APIs directly or kill its processes.

Keep secrets out of chat and command arguments: pass them only as a private file path (mode 0600) or piped input that the person supplies. Keep the package's guards and its instructions outside CatalEx's marked block. To remove an agent, or messaging accounts whose setup never finished, see Remove (offboard) an agent. Do not delete data, replace a server identity or widen permissions without the person's approval. Before retrying a change whose outcome is uncertain, inspect the original operation. Installation, setup, onboarding and a verified reply are separate outcomes.