basemodo deploy
Deploy a folder and print its URL once it is live.
basemodo deploy [OPTIONS] [PATH]Packs the folder (leaving out .git, what its .gitignore, .ignore, .basemodoignore and .dockerignore exclude, what the .gitignore and .ignore above it in its git repository exclude, and its .env files but .env.example unless --include-env), uploads it, and Basemodo detects how to build and run it (or reads basemodo.toml), builds it and starts it; the command waits until the App answers HTTP at its URL. The App is created the first time. A Deploy that fails leaves the previous one live. With --repository there is no folder: the App is linked to that GitHub repository and its branch's latest commit is deployed. With --template app|site there is none either: an App with no Deploy yet starts from a Template Basemodo serves, changed first by --operations when given, so its example never runs. With --upload the folder is one an agent's shell sent to an Upload Link (basemodo upload), deployed as a folder here is.
Arguments
PATH: The folder to deploy. Default: the current one.--name <NAME>: The App to deploy to. Default:namein basemodo.toml, else the folder's name (with --repository, the repository's name).--repository <OWNER/REPO>: A GitHub repository to deploy instead of a folder, as owner/repo: the App is linked to it and its branch's latest commit is deployed now, and again on every push. Basemodo's GitHub App must be able to read it.--template <TEMPLATE>: A Template to start the App from instead of a folder, app or site, as Basemodo serves it. Only an App with no Deploy yet starts from one.--operations <JSON>: With --template: change's operations, done in order on the Template's files before the App's first Deploy is made of them, so an example the App replaces is never built or run (its migration included). Each writes a file whole ({"op": "write", "path", "content", or "base64" for a binary file, and "executable" if it should be}), edits one passage of a file, which must occur in it exactly once ({"op": "edit", "path", "passage", "replacement"}), or deletes a file ({"op": "delete", "path"}), with change's limits and refusals; --description is required with them.--upload <ID>: The folder an agent's shell sent to an Upload Link (basemodo upload), by the link's id, deployed instead of a folder here, as a folder is: its ignore files and .env files left out. Only to the App the link was asked for.--branch <BRANCH>: With --repository: the branch to deploy. Default: the one the App is linked to, else the repository's default branch.--subdir <SUBDIR>: With --repository: the folder of the repository that holds the App (apps/web). Default: the one the App is linked to, else the whole repository.--workspace <WORKSPACE>: The Workspace whose App this is, by name: deploy to its App of that name, creating it the first time (which takes an Admin of the Workspace). Default: your own App of that name, else the one App of that name a Workspace of yours owns, else a new App of your own.--link: In a clone of a GitHub repository: link the App to it (this branch and folder) without asking, so every push deploys it.--no-link: Do not offer to link the App to the folder's GitHub repository.--approval <ID>: The Charge Approval an Admin approves on basemodo.com, as a refused deploy gave it, when the new App goes beyond the Apps the Workspace pays for (an Additional App) or its workers beyond the Always On Apps (an Always On App): wait until it is approved, then create or deploy with it.--allow-public: Open the paths this Deploy adds to (or widens in)public_pathsor[callers] pathsbeyond the live Deploy's: anyone reaches a Public Path, and the App's Callers their paths, past sign-in with no role checked. Only the Owner (an Admin, for a Workspace's App) may, and an agent asks the person first. Without it, such a Deploy is refused naming the paths.--description <DESCRIPTION>: What this Deploy changes, in one line of at most 200 characters: kept as its commit's message in the App's history. A push's Deploy says its commit message's first line instead.--include-env: Upload the folder's .env files too, which deploy leaves out (all but .env.example) whatever the ignore files say: they hold secrets, which go in with basemodo env set, never in the App's code, where every Editor reads them.--replace: In a folder that came from Basemodo, deploy it even though the App's code changed since (a Change from a chat, another folder's Deploy): the folder as it is replaces those changes, which stay in the App's history. Without it, such a folder is refused, to bring the changes in first with basemodo pull.
Like every command, it also takes the global options --json and --api-url.
Examples
Deploy the folder you are in:
basemodo deployDeploy another folder, as an App of another name:
basemodo deploy ./site --name team-lunchDeploy and keep the result for a script:
basemodo deploy --json > deploy.jsonDeploy a GitHub repository's latest commit, without a clone (pushes deploy too):
basemodo deploy --repository ana/lunch-rotaStart a new App from the app Template, without a folder:
basemodo deploy --template app --name lunch-rotaDeploy the folder a shell sent to an Upload Link (basemodo upload):
basemodo deploy --upload <upload_id> --name lunch-rotaCreate a Workspace's sixth App, an Additional App, once an Admin approves its price:
basemodo deploy --workspace AcmeDeploy with the Charge Approval a refused deploy gave, once an Admin approved it:
basemodo deploy --workspace Acme --name mailer --approval 6f1d0c8e-3b9a-4f2e-8d7c-1a2b3c4d5e6fOutput
With --json, it prints {"url", "app", "deploy"}, the live Deploy with what was detected, and "left_out": {"files", "why"} when it left .env files out; progress events on stderr (upload, detect, queued, build_turn, build, start, ready). A failed Deploy is an error with "deploy" and the build "log". Run by an agent (an MCP tool), it waits for the Deploy at most 45 seconds: one still queued, building or starting then is a result, not an error, with its "deploy" (and "status") and "next", which says to call status until its latest_deploy is live or failed. A new App, or workers, beyond what its Workspace pays for asks an Admin for a Charge Approval, approved on basemodo.com in their own browser: in a terminal it opens the approval's page and waits for it; with --json or no terminal, an error with code charge_required, its "charges" (each "item": additional or always_on, "monthly_cents", "currency", "next_invoice_on") and its "approval" ("id", "url", "expires_at"): nothing was created or deployed. --approval waits until it is approved, then goes on; a new App and its workers each ask for their own. Only an Admin approves one, an Editor's Deploy included (its link goes to the Admins); a push from GitHub never charges: always_on_not_reserved.
From an agent
Basemodo's MCP serves it as the tool deploy. It changes things, so an agent's client may ask you before it runs. Its arguments are the command's, named as JSON keys: path (text), name (text), repository (text), template (text), operations (JSON), upload (text), branch (text), subdir (text), workspace (text), link (flag), no_link (flag), approval (text), allow_public (flag), description (text), include_env (flag), replace (flag). It answers what the command prints with --json.