Skip to content

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.

Run polytoken update to check the configured channel and apply the update if a newer version is available.

Terminal window
polytoken update
  • --channel latest|stable overrides the updates.channel config value for this invocation.
  • --target-version <version> installs a specific version. This bypasses the newer-than check, so you can use it to downgrade.
  • --check checks for an available update without applying it. Prints whether an update is available and exits.
  • --format human|json controls the output format. human (the default) prints progress messages. json emits structured JSON to stdout.

Apply mode (polytoken update without --check):

CodeMeaning
0Updated, or already current
2Error

Check mode (polytoken update --check):

CodeMeaning
0Already current
1Update available
2Error

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.

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.

KeyDefaultDescription
updates.automatic_checktrueWhether 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.channellatestThe release channel to track. latest follows the newest published release. stable follows only stable releases and skips unstable pre-releases.