← Todas las plantillas

Comprobación de versión, descargas firmadas, reversión cuando falla una actualización.

Spec — CLI self-update

Status: draft · Created: 2026-11-10

1. Context and goal

Users of the command-line tool stay on a current, genuine version with one command, and a failed update never leaves them with a broken tool.

2. Functional requirements (EARS)

  • FR-1: THE SYSTEM SHALL check for a newer version at most once every 24 hours, with a timeout of 2 seconds that never delays the command being run.
  • FR-2: WHEN a newer version exists, THE SYSTEM SHALL print one line naming it and the update command, on standard error.
  • FR-3: WHEN the user runs the update command, THE SYSTEM SHALL download the build for their operating system and architecture over HTTPS and show progress at least every second.
  • FR-4: IF the download's signature or checksum does not verify against the published key, THEN THE SYSTEM SHALL discard it and keep the current version.
  • FR-5: IF the new executable, swapped in atomically, fails to run --version within 5 seconds, THEN THE SYSTEM SHALL restore the previous executable it kept.
  • FR-6: WHERE the tool was installed by a package manager, THE SYSTEM SHALL not update itself and print the package manager command instead.

3. Out of scope

  • Automatic updates without the user's command.
  • Downgrading to a chosen older version.