DocsOpen Moon AI
Browse the docs

Updates and uninstalling

Automatic, signed Moon CLI updates, updating right away or to a specific version, going back to the previous version and removing Moon CLI entirely.

On this page

Moon CLI keeps itself up to date. Every update is signed and verified before it is activated, and the previous version stays on your machine so you can go back.

Automatic updatesLink to the Automatic updates section

During an agent session, at most once a day, Moon CLI looks for a new version in the background and installs it. Your session keeps running on the current version. When the session ends, Moon CLI tells you which version was installed: it is used the next time you run moon.

  • After an error (network, server), Moon CLI tries again an hour later.
  • Automatic updates don’t run without an interactive terminal, in continuous integration (when the CI variable is set), with a MOON_API_KEY key, or from a copy of moon placed outside the installation (since 0.3.1; MOON_INSTALL_DIR lets you manage such a copy). Moon Desktop, which runs Moon CLI without a terminal, handles updates itself (see With Moon Desktop).

To turn them off:

Environment variable
export MOON_DISABLE_AUTOUPDATE=1
moon.json
{
  "updates": { "auto": false }
}

The moon.json file is in ~/.config/moon/ (Windows: %USERPROFILE%\.config\moon\).

With Moon DesktopLink to the With Moon Desktop section

Moon Desktop runs Moon CLI without a terminal, where Moon CLI’s own automatic updates don’t run. Since Moon Desktop 2.0.1, the app takes care of it, with the same rules:

  • at startup, if the copy of Moon CLI bundled with the app (Windows, Linux) is newer than the one on the computer, it is installed, after the same signature and checksum checks;
  • at most once a day, and the first time a new version of the app starts, Moon Desktop runs the signed Moon CLI update (moon update). On a Mac, where the app doesn’t bundle Moon CLI, this is how Moon CLI stays current.

A Code session in progress keeps its version: the new one is used for the next session, and a line in the title bar says so for 30 seconds. The previous version remains available for moon rollback. Nothing happens if automatic updates are turned off (above), and the Moon Desktop setting “Update Moon CLI automatically” (“Settings” › “Moon Desktop” › “Updates”, or the “Quick settings” submenu of the File menu) turns them off for the app only.

Update nowLink to the Update now section

Terminal
moon update
OptionEffect
(none)Installs the latest version of the channel if it is newer.
--to <version>Installs that specific version, even an older one.
--forceReinstalls even if you are already up to date.
--channel <channel>Picks the update channel; latest by default.
Terminal
moon update --to 0.2.2

moon upgrade does the same thing as moon update.

The terminal shows these messages in French:

MessageMeaning
“Moon CLI 0.6.1 est à jour.” (Moon CLI is up to date)Nothing to install.
“Moon CLI … est installé. Il sera utilisé au prochain lancement de « moon ».” (Moon CLI … is installed and will be used the next time you run moon)The new version is ready.
“Une mise à jour est déjà en cours dans une autre session.” (an update is already running in another session)Another moon session is already updating: nothing to do.
“La version … n’est pas encore publiée pour votre plateforme (…).” (version … is not published for your platform yet)Your machine keeps its current version.

What gets checkedLink to the What gets checked section

  1. Moon CLI downloads the version’s manifest and checks its signature against a public key built into the binary. An invalid signature stops everything.
  2. It checks the SHA-256 checksum of the archive, then that of the unpacked binary, both listed in the signed manifest.
  3. It runs the new binary to make sure it starts on your machine. If it doesn’t, the installation is canceled.
  4. It activates the new version in a single step, with no in-between state.

Nothing is run from the server. A channel never goes backward, and an update without --to never installs a version older than yours.

If the update is refused, moon update shows “Mise à jour impossible :” (update failed:) followed by the reason, then suggests trying again later or reinstalling.

Go back to the previous versionLink to the Go back to the previous version section

Moon CLI keeps the active version and the previous one.

Terminal
moon rollback

Moon CLI asks “Revenir à la version précédente de Moon CLI ? [o/N]” (go back to the previous version of Moon CLI?): type o (oui, yes) to confirm. The previous version becomes active the next time you start Moon CLI. In a script, add --yes: moon rollback --yes. If there is no previous version on the machine, Moon CLI says so. To go further back, use moon update --to <version>.

UninstallLink to the Uninstall section

Terminal
moon uninstall
  1. Moon CLI asks you to confirm (“Désinstaller … ? [o/N]”, uninstall …?; type o for yes).
  2. It revokes your session with Moon AI and deletes the token from your machine, like moon logout.
  3. It removes the binary, the installed versions and the PATH entry (the # >>> moon cli >>> block in your shell files, fish’s moon.fish file, or the user PATH on Windows).

Your settings and the agent’s session history are kept.

OptionEffect
--purgeAlso deletes your settings, your personal agent configuration, the session history and the caches: the moon folders in ~/.local/share, ~/.config, ~/.cache and ~/.local/state.
--yes (or -y)No confirmation. Required without an interactive terminal.

On Windows, open a new terminal afterward so the PATH is up to date. If you installed Moon CLI in another folder with MOON_INSTALL_DIR, delete that folder yourself unless it is named Moon.

Uninstall by handLink to the Uninstall by hand section

If the command no longer works, first revoke the session in “Settings” › “Account and security” › “Moon CLI sessions” (chat.realmoon.ai/settings/account#security), then delete:

ItemWindowsmacOS, Linux, WSL
Binary and versionsthe %LOCALAPPDATA%\Moon folder~/.local/bin/moon and ~/.local/share/moon/versions/
PATH entrythe entry in the user PATHthe # >>> moon cli >>> block in .zshrc, .bashrc, .bash_profile or .profile, or the ~/.config/fish/conf.d/moon.fish file
Session, state and history (optional)%USERPROFILE%\.local\share\moon~/.local/share/moon
Settings (optional)%USERPROFILE%\.config\moon~/.config/moon

Without a system keychain, the token is in the state folder; with a keychain, the moon-cli entry stays in the keychain until moon logout has cleared the session.

Coming from a 0.1.x versionLink to the Coming from a 0.1.x version section

On a 0.1.x version, moon update runs the online installer again, which installs the current version. You can also run the installation command again directly: see Installation. The installer removes moon-agent, the second binary shipped with the 0.1.x versions.

Release notesLink to the Release notes section

moon --version shows the installed version. What changes in each version is in the release notes.

If it doesn’t workLink to the If it doesn’t work section

See alsoLink to the See also section

Moon AI

Moon AI in action

0:00

Explore

Screenshots of chat.realmoon.ai taken on October 29, 2026, with fictional data.

Moon AI

Your preferences

Visits counted without cookies.

Our server counts visits without cookies or trackers. Your theme and your answer about ad measurement are remembered on this device.

Ad measurement

With your consent, our ad networks’ trackers (Google) measure our ads, from the visit to the sign-up and then to the first subscription and its amount, and may show you our ads. Your answer is valid for 13 months; you can change it here at any time.

No answer saved on this device.

After you decline, no tag is loaded anymore and the site deletes the cookies they had set on realmoon.ai. Those on the ad networks’ own domains are managed with them or in your browser.

The Moon AI app has its own privacy settings.