The update:* family has 4 commands registered in Application.php.
update:core
Code: cli/src/Commands/UpdateCoreCommand.php (req-201 / BATCH-209).
Usage: c2f update:core <projectID> [--tag=TAG] [--wait] [--status=RUN] [--runs] [--json] [update options]Triggers the system update of one installation through the API (action=run) and, with --wait, follows it to the end; when the API is unavailable while files are swapped, it waits up to 5 minutes. --status=RUN shows a previous run; --runs lists recent ones. Update options are the API ones (--tag, --backup, --no-health, --health-url…). Without --tag, the server downloads the latest GitHub release. At the end it shows the snapshot, the check, the automatic restore and how to roll back with update:rollback. Mass updates stay outside the core, in each network's operations.
update:rollback
Code: cli/src/Commands/UpdateRollbackCommand.php (req-198 / BATCH-204). Alias: rollback.
Usage: c2f update:rollback <projectID> <snapshot> [--com-banco] [--dry-run]Rolls back a delivery from the snapshot it left on the server:
-
<snapshot>is the id from the API deploy response (api-…) or from the system update (exec-<id>, or just the number); -
--com-bancoalso restores the database dump taken before the delivery; -
--dry-runprints what would run.
The path depends on the project in environment.json:
-
deploy_mode: "ssh"(Lab): runsatualizacoes-sistema.php --rollback=<id> --domain=<host>on the server over SSH, asssh_run_as; -
the others:
POST /_api/project/rollbackwith the project'sapi.access_token. When the token is refused (401), renew it and try again.
update:conflicts
Code: cli/src/Commands/UpdateConflictsCommand.php (req-199 / BATCH-205). Alias: conflicts.
Usage: c2f update:conflicts <projectID> [clashID] [--todos] [--abrir] [--json]Without an id, lists the project's pending clashes through the API (--todos includes resolved ones). With an id, downloads both versions to temp/conflicts/<project>/<id>/: no-ar.<ext>, nova.<ext> and mesclado.<ext>, which starts as the live version and is not wiped by a new download. --abrir runs code --diff no-ar nova.
update:resolve
Code: cli/src/Commands/UpdateResolveCommand.php. Alias: resolve.
Usage: c2f update:resolve <projectID> <clashID> --acao=sobrescrever|manter|mesclar [--arquivo=PATH] [--local] [--json]Sends the decision. mesclar sends the merged file (default: the downloaded mesclado.<ext>); --local writes the same merge into the local project repository so the next delivery already carries it.
--json prints one JSON line for the VS Code extension and other consumers: the list ({ok, projeto, choques}), the downloaded detail ({ok, choque, binario, pasta, arquivos}) or the resolution ({ok, id, acao, resolvidos, local}); errors come as {ok: false, erro} with exit code 1.
The three commands that talk to the API use the project's api.access_token and, optionally, api_resolve_ip in environment.json: it resolves the URL host to that IP (test environment without DNS for its own name; the certificate is not checked in that case).
See system updates and the project API.