Skip to content

basemodo change

Change an App's code: write, edit or delete files, deployed as one Deploy.

Terminal window
basemodo change [OPTIONS] --base <DEPLOY> [FILE]

Makes a Change on the code of the Deploy --base names, the one files read: the App's latest code, or a Deploy of it that failed since, so a failed attempt is fixed by sending only the fix. Its operations are done in order, then deployed together as one Deploy, followed until it is live as deploy follows its own: all of them go live, or none. An edit replaces one passage, which must occur in the file exactly once. --description says what it changes in one line of the person's words, in their language: the App's history reads like what they asked for. One Change touches at most 200 files and 2 MB of content, and an App takes at most 30 an hour. It is refused when another Change or Deploy landed since its base (stale_base, naming the latest Deploy: read it again, then change that), on an App linked to GitHub, whose code lives there, and when it would leave a key in the code (sk_live_, AKIA, ghp_, a private key): a key is a Secret, set with basemodo env set. Only the App's Owner and its Editors change its code. In a terminal its operations are JSON, from a file or stdin.

Arguments

  • --app <APP>: The App to change. Default: the one named after the current folder.
  • --base <DEPLOY> (required): The Deploy whose code the Change is made on, by its id, as files names it: the App's latest code, or a Deploy of it that failed since, to fix it.
  • --description <DESCRIPTION>: What the Change does, in one line of at most 200 characters, in the person's words and language: kept as its commit's message in the App's history.
  • --operations <JSON>: The operations, done in order: 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"}). Paths are from the App's root (src/main.ts).
  • FILE: Read the operations as JSON from this file, or from stdin with -.
  • --approval <ID>: The Charge Approval an Admin approves on basemodo.com, as a refused change gave it, when the Deploy's workers go beyond the Always On Apps the Workspace pays for: wait until it is approved, then change with it.
  • --allow-public: Open the paths the Change adds to (or widens in) public_paths or [callers] paths in basemodo.toml beyond the live Deploy's, as deploy --allow-public does. Only the Owner may, and an agent asks the person first.

Like every command, it also takes the global options --json and --api-url.

Examples

Change the App of this folder, its operations in a file:

Terminal window
basemodo change --base <deploy> --description "Add a dark mode" changes.json

Change another App, its operations from stdin:

Terminal window
basemodo change --app lunch-rota --base <deploy> --description "Fix the menu" -

Write one file, from a script:

Terminal window
basemodo change --app lunch-rota --base <deploy> --description "Say hello" --operations '[{"op": "write", "path": "index.html", "content": "<h1>Hello</h1>"}]' --json

Output

With --json, it prints {"url", "app", "deploy", "next"}, as deploy prints it: the Deploy it made, live, or still going with what to do next. A failed build is an error with its code, the Deploy and the build's own lines: make the next Change on that Deploy. A base that is no longer the latest code is an error with code stale_base; an edit whose passage is not in the file, passage_not_found, or is there more than once, passage_ambiguous; a delete of a file that is not there, nothing_to_delete; more than one Change takes, change_too_large; a key, secret_in_code; an App linked to GitHub, code_on_github; no description, description_required; one that would charge, charge_required, with the Charge Approval an Admin approves.

From an agent

Basemodo's MCP serves it as the tool change. It changes things, so an agent's client may ask you before it runs. Its arguments are the command's, named as JSON keys: app (text), base (text), description (text), operations (JSON), file (text), approval (text), allow_public (flag). It answers what the command prints with --json.