# Deploying with an agent

Let Claude, ChatGPT, Cursor or any agent deploy, share and fix your Apps for you, with one line of setup and your own sign-in.

Basemodo is built to be driven by agents. Every command answers in JSON, every error names the exact fix, Basemodo's Skills teach an agent when and how to use it, and Basemodo's MCP serves every command to an agent with no terminal as a tool.

## Set it up

1. Set your agent up: [Which agent do you use?](https://basemodo.com/docs/mcp#which-agent-do-you-use) has a page for each, Claude Code, Claude Desktop, claude.ai, ChatGPT, Cursor, VS Code, Codex, Windsurf and Gemini CLI, with the one thing to do first. An agent with a terminal gets the install line, which installs the CLI, writes Basemodo's Skills and signs you in; a chat app gets the Plugin, or the Remote MCP, and sends you to basemodo.com to approve it the first time it acts. Give each agent one of these, not two: [one way per client](https://basemodo.com/docs/mcp/remote-vs-local#one-way-per-client).
2. Ask it. For example:
   - "Deploy this folder to Basemodo and give me the link."
   - "Share it with ana@example.com and ben@example.com."
   - "The App is broken: read its logs and fix it."
   - "Add a `done` column to the tasks table of the App's database."
   - "Set the Stripe key as a Secret; here it is: ..."

## What the agent can do

Each command of the CLI is a tool of the same name (`env set` is `env_set`), with the same arguments, answering what the command prints with `--json`. [The CLI](https://basemodo.com/docs/cli) lists them all and says which ones only read (clients may run those without asking you) and which change things. A few stay in the terminal, like `basemodo login`, which needs you at your browser: the agent asks you to run it.

The MCP also serves a guide, the resource `basemodo://guide`: the commands, the manifest and the identity headers in one page, written for agents. The agent reads it once and knows how to use Basemodo without searching the web. For more, the tool `docs` reads any page of this documentation.

## An agent with a terminal

An agent that runs commands on your computer drives the CLI itself, with no MCP. [`basemodo setup`](https://basemodo.com/docs/cli/setup), which the install line runs, teaches the agents on your computer to use it: it finds Claude Code, Codex, Cursor, Gemini CLI, VS Code and the others you have, writes Basemodo's Skills where each reads them, and signs the CLI in, so the agent knows the commands and the rules below whenever a request calls for Basemodo ([Skills for your agents](https://basemodo.com/docs/skills)). `basemodo setup --remove` takes the Skills out again. An agent it does not know: tell it to add `--json` to every command, and give it `basemodo docs`, or point it at [/llms.txt](https://basemodo.com/llms.txt), which lists every page with a link to its Markdown, or at [/llms-full.txt](https://basemodo.com/llms-full.txt): the whole documentation in one Markdown file, the same text as these pages.

## The rules an agent follows

- **The CLI.** `basemodo <command>`. Every command takes `--json`: the result is one JSON document on stdout, an error is `{"error": {"code", "message", "fix", "docs"}}` on stdout with a non-zero exit, and a command that takes a while reports progress as JSON lines on stderr (`{"event": "progress", "stage", "message"}`). The `fix` names the exact command or `basemodo.toml` line that fixes the error, and `docs` the page that explains it.
- **The MCP.** Basemodo's MCP serves the guide (the resource `basemodo://guide`) and one tool per command. A tool's name is the command's words joined by `_` (`env set` is `env_set`); its arguments are the command's, named as the guide and the docs name them; its result is exactly what the command prints with `--json`, and a failure is an error result carrying the same `{"error": ...}`. A Deploy's stages arrive as MCP progress, and its result says how long it took, in milliseconds (`deploy.timings`: each step and `total_ms`), as the CLI's last line does. `deploy` and `rollback` wait for the Deploy 45 seconds at most, so no client cuts the call: a Deploy still going then answers its `deploy` with its `status` (queued, building or starting) and `next`, which says to call `status` until its `latest_deploy` is live or failed (a failed one says why in its `failure`). `run` waits for its command as long: one still running then answers `running: true`, what it printed so far, its `id` and `next`, and runs on within its own timeout; follow it with `runs` until `running` is false, and never call `run` with the same command while it runs, or it runs twice. It is remote, at `https://mcp.basemodo.com`, where the person approves the agent in their browser, or local: `basemodo mcp`, over stdio, signed in with the CLI's login. To connect a client, follow its page, which has what to copy for both: Claude Code (https://basemodo.com/docs/mcp/claude-code), Claude Desktop (https://basemodo.com/docs/mcp/claude-desktop), claude.ai (https://basemodo.com/docs/mcp/claude-ai), ChatGPT (https://basemodo.com/docs/mcp/chatgpt), Cursor (https://basemodo.com/docs/mcp/cursor), VS Code (https://basemodo.com/docs/mcp/vscode), Codex (https://basemodo.com/docs/mcp/codex), Windsurf (https://basemodo.com/docs/mcp/windsurf), Gemini CLI (https://basemodo.com/docs/mcp/gemini-cli); any other client as https://basemodo.com/docs/mcp says.
- **Signing in.** `basemodo login`, run by the person in a terminal, signs the CLI and the local MCP in. When a tool answers `not_signed_in`, ask the person to run it. The Remote MCP signs in through the client, which sends the person to basemodo.com to approve it.
- **Which App.** Commands that act on an App take `app` (`--app`); without it, the App named after the current folder, as `deploy` names it. A name means the person's own App of that name, else the one other App of that name they work on (a Workspace's, or one they are an Editor of); an App's slug (the label in its URL) names it when the name is ambiguous.
- **Owners and Editors.** The person signed in may work on their own Apps and on the Apps whose Owner made them an Editor: deploy, logs, Secrets (`env`), status and rollback, `backup` and `backups` work the same on both, and so do the Visibility (`share --visibility`), `indexing`, `toolbar` and `recognize`. Only the Owner invites or removes people (`share EMAIL`, `--editor`, `--remove`), restores a Backup (`restore`, which overwrites its data), downloads its data (`download`) or deletes it; an Editor gets `owner_only`. Each App's `role` says which it is.
- **Workspaces.** An App is owned by a person or by a Workspace (a team). Every Admin of a Workspace manages all of its Apps (deploy, Logs, Secrets, sharing) and the App hears them as `owner`; its other Members do not manage them, unless made Editors. `deploy --workspace <name>` deploys to that Workspace's App, created the first time (only an Admin can). People, company domains and moving a person's App into a Workspace (which an Admin accepts; whoever moved it stays its Editor) are managed on basemodo.com, not here.
- **Feedback.** When the person wants to tell Basemodo that something is wrong or missing (a bug, an error that did not help, a command they wish existed), send it with `feedback` (`basemodo feedback "<text>" --category bug`, or `idea`, `other`), in their words or with their approval. It goes as the person, with your MCP client's name and version, and Basemodo answers the person by email.
- **The documentation.** Everything here and more, with examples: the tool `docs` (`basemodo docs`, one page with a topic: `basemodo docs manifest`), or https://basemodo.com/llms.txt, which lists every page.

## Staying in control

The agent acts as you: it can do what you can do. You see every device and agent signed in as you on the Devices page of basemodo.com, and revoking one there stops it at once. Tools that change things carry no "read only" mark, so a careful client asks you before running them.