moodle uninstall removes what the CLI put on your machine outside its own binary: the keepalive job and any MCP (Model Context Protocol) renewal jobs it registered. Removing the binary itself is a separate, package-manager-specific step — see Removing the package.
By default it only touches local background jobs. Two flags widen what it removes:
--remote tears down a deployed Worker, and --purge deletes local configuration and the encrypted session cache. Neither can be undone from the CLI. Preview with --dry-run first if you’re unsure what’s about to go.

What “local jobs” means

On macOS, local jobs are background jobs the CLI registered under ~/Library/LaunchAgents: the keepalive job (com.moodle-cli.keepalive.plist) and one MCP renewal job per profile (com.moodle-cli.mcp-renewal.<profile>.plist). moodle uninstall removes the keepalive job, and unregisters renewal for every profile it finds a job or saved deployment info for. moodle doctor’s job check is what reports one of these as broken beforehand — see Troubleshooting. Keepalive itself has nothing to remove on Linux, since it’s a cron line you added yourself rather than a job the CLI installed — see Keepalive. MCP renewal is different: on Linux, moodle mcp deploy installs a recurring job per profile instead, and moodle uninstall removes it the same way.

--remote

Without --remote, a managed MCP deployment is left running; only the local renewal job for it is removed, so it stops renewing itself and will eventually need moodle mcp login again to keep working. With --remote, the Worker and its stored credentials are removed the same way moodle mcp remove removes them — see Connect an agent for what that deployment holds.

--purge

--purge deletes ~/.config/moodle-cli (configuration and saved deployment info) and ~/.cache/moodle-cli (the encrypted session cache) after the jobs above are handled. It refuses to run if info for a managed deployment still exists and --remote wasn’t also given, or if more than one does — purging first would throw away what’s needed to clean up that Worker later:
Remove each deployment first, then purge:

Installation footprint

What’s on disk depends on how you installed it. Configuration lives at ~/.config/moodle-cli and the session cache at ~/.cache/moodle-cli regardless of install path; what differs is where the executable itself sits. Cloudflare deployment management uses a copy of its companion tool already on your PATH if present, or downloads one to ~/.config/moodle-cli/tools/wrangler@<version> — --purge removes that along with the rest of the config directory.

Removing the package

moodle uninstall never touches the installed package itself — it only knows about the jobs and files above. Remove the package with whichever tool installed it:
For the installer script or a manual binary, delete the executable directly:
npx/bunx installs leave nothing to remove beyond the package manager’s own execution cache.