Updating Polytoken
Polytoken can update itself. The polytoken update command checks the configured release channel and applies an update when a newer version is available. Polytoken also checks for updates automatically at launch and prompts you if one is available.
The polytoken update command
Section titled “The polytoken update command”Run polytoken update to check the configured channel and apply the update if a newer version is available.
polytoken update--channel latest|stableoverrides theupdates.channelconfig value for this invocation.--target-version <version>installs a specific version. This bypasses the newer-than check, so you can use it to downgrade.--checkchecks for an available update without applying it. Prints whether an update is available and exits.--format human|jsoncontrols the output format.human(the default) prints progress messages.jsonemits structured JSON to stdout.
Exit codes
Section titled “Exit codes”Apply mode (polytoken update without --check):
| Code | Meaning |
|---|---|
| 0 | Updated, or already current |
| 2 | Error |
Check mode (polytoken update --check):
| Code | Meaning |
|---|---|
| 0 | Already current |
| 1 | Update available |
| 2 | Error |
Launch-time update check
Section titled “Launch-time update check”When you start a new interactive session, Polytoken checks the release channel for a newer version before the session begins. If a newer version is available, you see a prompt asking whether you want to update before continuing.
The check runs only for polytoken and polytoken new when you launch them from an interactive terminal. Every other command skips the check. Stdin and stderr must both connect to a terminal, so scripts and pipelines run without a prompt.
Polytoken performs the check at most once every 24 hours. A 5-second timeout on the network fetch means an unreachable update server does not delay the session. When you accept the prompt, Polytoken downloads and verifies the update, replaces the installed binary, and starts the session again with the updated version. The re-launched process skips the update check for that run, so it starts immediately.
A network failure, timeout, or update error does not block or crash the launch. Polytoken proceeds with the currently installed binary.
Update configuration
Section titled “Update configuration”The updates config block controls both the launch-time check and the polytoken update command. The updates block is global-only: project configs may not set any keys under it.
| Key | Default | Description |
|---|---|---|
updates.automatic_check | true | Whether Polytoken checks for updates at launch. Set to false to disable the launch-time check. The polytoken update command still works when updates.automatic_check is false. |
updates.channel | latest | The release channel to track. latest follows the newest published release. stable follows only stable releases and skips unstable pre-releases. |