# The basemodo CLI

Every command of `basemodo`, the program that deploys and shares your Apps from a terminal, a script or an agent, with how it signs in and how it prints.

## Install and check

`basemodo` is a single program, installed with one line and nothing installed before it. On macOS and Linux:

```sh
curl -fsSL https://basemodo.com/install | sh
```

On Windows, in PowerShell:

```powershell
irm https://basemodo.com/install.ps1 | iex
```

It installs `basemodo` for you alone, never with administrator rights: in `~/.basemodo/bin` on macOS and Linux, in your local programs folder on Windows. It adds that folder to your `PATH` when it is not there, and says when you must open a new terminal for `basemodo` to be found. Running the line again upgrades to the latest version. Then it runs [`basemodo setup`](https://basemodo.com/docs/cli/setup), which asks where your agents should know Basemodo, sets them up and signs you in. With no terminal to ask in (CI, a server), it leaves setup out and says to run it. An agent that runs the line for you leaves setup out itself (`BASEMODO_NO_SETUP=1`, below), runs `basemodo setup --user`, and asks you to run `basemodo login`: the questions and the sign-in are yours.

To install a given version or into another folder, pass them to the script: `curl -fsSL https://basemodo.com/install | sh -s -- 0.2.0 --dir ~/bin`, or set `BASEMODO_VERSION` and `BASEMODO_INSTALL_DIR`. To install it without running setup, as on a server, add `--no-setup` (`-NoSetup` on Windows) or set `BASEMODO_NO_SETUP=1`.

Check it works:

```sh
basemodo --version
```

Every command explains itself with `--help` (`basemodo deploy --help`), with examples; this page and the page of each command say the same, because they are written from the same source.

## Signing in

```sh
basemodo login
```

Opens your browser to approve this computer, and keeps the sign-in for 30 days. Over SSH, or with `--device`, it shows a short code to type at basemodo.com/device from any device instead, where you see where and when the sign-in started before you approve it. The sign-in is kept in `credentials.json`, readable only by you, in `$BASEMODO_CONFIG_DIR`, else `$XDG_CONFIG_HOME/basemodo`, else `~/.config/basemodo` (`%APPDATA%\basemodo` on Windows). The [local MCP](https://basemodo.com/docs/mcp/remote-vs-local) uses the same sign-in. You can see and revoke it on the Devices page of basemodo.com.

## Which App

Commands that act on an App take `--app NAME`. Without it they use the App named after the folder you are in, the way `basemodo deploy` names it (the folder's name, or `name` in [`basemodo.toml`](https://basemodo.com/docs/manifest#name)). So inside the App's folder you rarely type its name.

## Output, for people and for programs

- Without `--json`, a command prints text for people on stdout, and messages along the way (progress, a build log) on stderr.
- With `--json`, stdout holds exactly one JSON document, the result; each command's page says its shape. A command that takes a while also writes its progress to stderr as one JSON object per line: `{"event": "progress", "stage": "build", "message": "..."}`.
- An error exits with a non-zero code. With `--json` it is `{"error": {"code", "message", "fix", "docs"}}` on stdout; without, the message on stderr with its `fix:` (the exact command or `basemodo.toml` line to change) and `docs:` (the page explaining it). Every code is explained on [the errors page](https://basemodo.com/docs/errors).
- `basemodo run` exits with the exit code of the command it ran.

Scripts and agents should always pass `--json`, and act on `error.code` and `error.fix`.

## Global options

Every command takes these, before or after its own arguments.

- `--json`: Print the result as JSON on stdout, for agents and scripts.
- `--api-url <API_URL>`: The Basemodo API to talk to. Also read from `BASEMODO_API_URL`. Default: `https://api.basemodo.com`.

## Commands

| Command | What it does | From an agent |
| --- | --- | --- |
| [`basemodo account delete`](https://basemodo.com/docs/cli/account-delete) | Erase your account for good: type its email to confirm | tool [`account_delete`](https://basemodo.com/docs/mcp/tools/account_delete) |
| [`basemodo backup`](https://basemodo.com/docs/cli/backup) | Take a Backup of an App's data now: its database and every file on its volume | tool [`backup`](https://basemodo.com/docs/mcp/tools/backup) |
| [`basemodo backups`](https://basemodo.com/docs/cli/backups) | List an App's Backups, newest first, to choose one to restore | tool [`backups`](https://basemodo.com/docs/mcp/tools/backups) |
| [`basemodo callers list`](https://basemodo.com/docs/cli/callers-list) | List the App's Callers, with who named each and when, and the paths it exposes to them | tool [`callers_list`](https://basemodo.com/docs/mcp/tools/callers_list) |
| [`basemodo callers add`](https://basemodo.com/docs/cli/callers-add) | Let another App of the same Owner call this one: name it a Caller | tool [`callers_add`](https://basemodo.com/docs/mcp/tools/callers_add) |
| [`basemodo callers remove`](https://basemodo.com/docs/cli/callers-remove) | Take a Caller off: its next call is refused | tool [`callers_remove`](https://basemodo.com/docs/mcp/tools/callers_remove) |
| [`basemodo change`](https://basemodo.com/docs/cli/change) | Change an App's code: write, edit or delete files, deployed as one Deploy | tool [`change`](https://basemodo.com/docs/mcp/tools/change) |
| [`basemodo db`](https://basemodo.com/docs/cli/db) | Run SQL against an App's SQLite database (/data/app.db) and print the rows | tool [`db`](https://basemodo.com/docs/mcp/tools/db) |
| [`basemodo deploy`](https://basemodo.com/docs/cli/deploy) | Deploy a folder and print its URL once it is live | tool [`deploy`](https://basemodo.com/docs/mcp/tools/deploy) |
| [`basemodo deploys`](https://basemodo.com/docs/cli/deploys) | List an App's Deploys, newest first, each with who made it and what it changed | tool [`deploys`](https://basemodo.com/docs/mcp/tools/deploys) |
| [`basemodo diff`](https://basemodo.com/docs/cli/diff) | Show what a Deploy changed in its App's code, file by file | tool [`diff`](https://basemodo.com/docs/mcp/tools/diff) |
| [`basemodo docs`](https://basemodo.com/docs/cli/docs) | Read the documentation of basemodo.com/docs: every page, or one topic | tool [`docs`](https://basemodo.com/docs/mcp/tools/docs) |
| [`basemodo domains add`](https://basemodo.com/docs/cli/domains-add) | Claim a hostname of yours for the App, and print the DNS records to add | tool [`domains_add`](https://basemodo.com/docs/mcp/tools/domains_add) |
| [`basemodo domains verify`](https://basemodo.com/docs/cli/domains-verify) | Look for a custom domain's DNS records now; once found, the App answers there | tool [`domains_verify`](https://basemodo.com/docs/mcp/tools/domains_verify) |
| [`basemodo domains list`](https://basemodo.com/docs/cli/domains-list) | List the App's custom domains, each with its status and DNS records | tool [`domains_list`](https://basemodo.com/docs/mcp/tools/domains_list) |
| [`basemodo domains remove`](https://basemodo.com/docs/cli/domains-remove) | Stop the App answering at a custom domain, and forget its certificate | tool [`domains_remove`](https://basemodo.com/docs/mcp/tools/domains_remove) |
| [`basemodo download`](https://basemodo.com/docs/cli/download) | Download an App's data as it is now: one .tar.gz file of everything on its disk | tool [`download`](https://basemodo.com/docs/mcp/tools/download) |
| [`basemodo egress`](https://basemodo.com/docs/cli/egress) | Give an App an outgoing address of its own (dedicated), give it back (shared), or say where its traffic leaves from | tool [`egress`](https://basemodo.com/docs/mcp/tools/egress) |
| [`basemodo env set`](https://basemodo.com/docs/cli/env-set) | Set Secrets: NAME=value ..., or one NAME alone to read its value from stdin. The App gets them the next time it starts: basemodo restart | tool [`env_set`](https://basemodo.com/docs/mcp/tools/env_set) |
| [`basemodo env list`](https://basemodo.com/docs/cli/env-list) | List the App's Secrets by name, with who set each and when. Never values | tool [`env_list`](https://basemodo.com/docs/mcp/tools/env_list) |
| [`basemodo env unset`](https://basemodo.com/docs/cli/env-unset) | Remove Secrets by name (all or none). The App loses them the next time it starts: basemodo restart | tool [`env_unset`](https://basemodo.com/docs/mcp/tools/env_unset) |
| [`basemodo feedback`](https://basemodo.com/docs/cli/feedback) | Tell Basemodo what is wrong or missing, as the signed-in Person | tool [`feedback`](https://basemodo.com/docs/mcp/tools/feedback) |
| [`basemodo files`](https://basemodo.com/docs/cli/files) | List or read an App's code, one of its Deploys', or a Template's | tool [`files`](https://basemodo.com/docs/mcp/tools/files) |
| [`basemodo indexing`](https://basemodo.com/docs/cli/indexing) | Let search engines index a Public App (on), keep them out (off), or say which | tool [`indexing`](https://basemodo.com/docs/mcp/tools/indexing) |
| [`basemodo logs`](https://basemodo.com/docs/cli/logs) | Follow an App's Logs live, or print its last lines with --lines | tool [`logs`](https://basemodo.com/docs/mcp/tools/logs) |
| [`basemodo login`](https://basemodo.com/docs/cli/login) | Sign this CLI in from your browser | terminal only |
| [`basemodo logout`](https://basemodo.com/docs/cli/logout) | Sign this CLI out: end its Session on Basemodo and forget its token here | terminal only |
| [`basemodo pull`](https://basemodo.com/docs/cli/pull) | Bring an App's latest code into a folder: a new one, or one that came from it | tool [`pull`](https://basemodo.com/docs/mcp/tools/pull) |
| [`basemodo recognize`](https://basemodo.com/docs/cli/recognize) | Have a Public App ask visitors already signed in to Basemodo to continue as themselves (on), let them in as Guests again (off), or say which | tool [`recognize`](https://basemodo.com/docs/mcp/tools/recognize) |
| [`basemodo rename`](https://basemodo.com/docs/cli/rename) | Rename an App; its old address redirects to the new one for 30 days | tool [`rename`](https://basemodo.com/docs/mcp/tools/rename) |
| [`basemodo mcp`](https://basemodo.com/docs/cli/mcp) | Serve the local MCP over stdio, for an agent on this machine | terminal only |
| [`basemodo plan`](https://basemodo.com/docs/cli/plan) | Show your Plan and your next Invoice | tool [`plan`](https://basemodo.com/docs/mcp/tools/plan) |
| [`basemodo plan change`](https://basemodo.com/docs/cli/plan-change) | Switch your Plan to another, on the payment provider's page | terminal only |
| [`basemodo plan reserve`](https://basemodo.com/docs/cli/plan-reserve) | See or change a Workspace's Seats, Additional Apps and Always On Apps reserved ahead, for its Admins | tool [`plan_reserve`](https://basemodo.com/docs/mcp/tools/plan_reserve) |
| [`basemodo restore`](https://basemodo.com/docs/cli/restore) | Put an App's data back as a Backup holds it | tool [`restore`](https://basemodo.com/docs/mcp/tools/restore) |
| [`basemodo open`](https://basemodo.com/docs/cli/open) | Open an App's URL in your browser | tool [`open`](https://basemodo.com/docs/mcp/tools/open) |
| [`basemodo preview`](https://basemodo.com/docs/cli/preview) | Make a Preview Link: an App opened in a browser of your own (an agent's Playwright), signed in as you, for minutes | tool [`preview`](https://basemodo.com/docs/mcp/tools/preview) |
| [`basemodo restart`](https://basemodo.com/docs/cli/restart) | Restart an App: its Machine starts again on its live Deploy | tool [`restart`](https://basemodo.com/docs/mcp/tools/restart) |
| [`basemodo rollback`](https://basemodo.com/docs/cli/rollback) | Make an earlier Deploy live again, as a new Deploy | tool [`rollback`](https://basemodo.com/docs/mcp/tools/rollback) |
| [`basemodo run`](https://basemodo.com/docs/cli/run) | Run a one-off command inside an App's Machine (a migration, a script) | tool [`run`](https://basemodo.com/docs/mcp/tools/run) |
| [`basemodo runs`](https://basemodo.com/docs/cli/runs) | Follow a command an agent's run left running: what it printed and how it ended | tool [`runs`](https://basemodo.com/docs/mcp/tools/runs) |
| [`basemodo screenshot`](https://basemodo.com/docs/cli/screenshot) | See a page of an App as you see it: rendered in a browser, on this computer or on the App's own server, and answered as a PNG | tool [`screenshot`](https://basemodo.com/docs/mcp/tools/screenshot) |
| [`basemodo share`](https://basemodo.com/docs/cli/share) | Share an App: invite Members and Editors by email, remove them, answer Access Requests, or change its Visibility | tool [`share`](https://basemodo.com/docs/mcp/tools/share) |
| [`basemodo setup`](https://basemodo.com/docs/cli/setup) | Teach the agents on this computer to use Basemodo, by writing its Skills where they read them | terminal only |
| [`basemodo status`](https://basemodo.com/docs/cli/status) | Say whether an App is awake, asleep, starting or paused, and its latest Deploy | tool [`status`](https://basemodo.com/docs/mcp/tools/status) |
| [`basemodo toolbar`](https://basemodo.com/docs/cli/toolbar) | Turn off the Toolbar on an App's pages (off), turn it back on (on), or say which | tool [`toolbar`](https://basemodo.com/docs/mcp/tools/toolbar) |
| [`basemodo transfers list`](https://basemodo.com/docs/cli/transfers-list) | List the pending Transfers you asked for or may answer, with each App's Editors | tool [`transfers_list`](https://basemodo.com/docs/mcp/tools/transfers_list) |
| [`basemodo transfers accept`](https://basemodo.com/docs/cli/transfers-accept) | Accept a Transfer: the App becomes yours, or your Workspace's, at the same URL | tool [`transfers_accept`](https://basemodo.com/docs/mcp/tools/transfers_accept) |
| [`basemodo transfers decline`](https://basemodo.com/docs/cli/transfers-decline) | Decline a Transfer: the App stays where it is | tool [`transfers_decline`](https://basemodo.com/docs/mcp/tools/transfers_decline) |
| [`basemodo update`](https://basemodo.com/docs/cli/update) | Update this CLI: replace this `basemodo` with the latest release, or the version named | terminal only |
| [`basemodo upload`](https://basemodo.com/docs/cli/upload) | Get a one-time link to send an App's folder to from your own shell, for deploy to deploy | tool [`upload`](https://basemodo.com/docs/mcp/tools/upload) |
| [`basemodo version`](https://basemodo.com/docs/cli/version) | Print the version of this CLI | terminal only |
| [`basemodo whoami`](https://basemodo.com/docs/cli/whoami) | Print who this CLI is signed in as | tool [`whoami`](https://basemodo.com/docs/mcp/tools/whoami) |