How to remove agent-marketplace safely
Remove the files agent-marketplace generated in a repository or on your machine, without deleting your own files. The deinit command does the removal. --scope chooses what it covers:
| Scope | What deinit removes | What --purge-config also deletes |
|---|---|---|
user (the default) | Machine-wide generated output, plus cached registry clones that your organization's configuration does not use | ~/.agents/config.yaml and ~/.agents/lock.yaml |
repo | Generated output in the current repository | .agents/config.yaml and .agents/lock.yaml |
local | The same repository output as repo | .agents/config.local.yaml and .agents/lock.local.yaml |
Prerequisites
agent-marketplaceon yourPATH.- For repository removal, a terminal open inside the repository.
- Optional: run
agent-marketplace backup createfirst to archive the machine-wide harness folders.deinitdoes not create one for you. See How to back up and restore machine resources.
Remove from a repository
Preview what
deinitwould remove:bashagent-marketplace deinit --scope repo --dry-runThe preview lists the generated files and folders and ends with a line such as
Would remove 4 managed artifact(s). Nothing changes on disk.Run the removal:
bashagent-marketplace deinit --scope repoThe run prints
Removed N managed artifact(s), orNo managed artifacts to removewhen there is nothing to remove. It does not list the individual files. It deletes the generated harness output in the repository and nothing else. Configuration files, lockfiles, organization policy, and the durable ownership state stay in place, so a lateragent-marketplace synccan put everything back.Delete the repository configuration too, only if you no longer want it:
bashagent-marketplace deinit --scope repo --purge-configAfter the artifact summary, it prints
Removed config <path>andRemoved lock <path>, one line for each file that existed, so an absent file produces no line. It removes the.agentsfolder if it is left empty. It does not touch.agents/config.local.yamlor.agents/lock.local.yaml; delete those with--scope local --purge-config. Files that your configuration pulls in withincludeare not deleted.Run
git status, which lists the deleted files underChanges not staged for commit. Review them and commit the changes you want to keep.
Remove from a machine
Preview the machine-wide removal:
bashagent-marketplace deinit --scope user --dry-runThe preview lists the generated output and each cache folder it would delete (
Would remove cache ...).Run the removal:
bashagent-marketplace deinit --scope userThe run prints
Removed N managed artifact(s)(orNo managed artifacts to remove), then oneRemoved cache <path>line for each cache folder it deletes. It removes the machine-wide generated output and the cached registry clones under~/.cache/agent-marketplace/that your organization's configuration does not use. Clones that your repositories still use come back on their nextsync. Resources that your organization's configuration still selects stay installed, with the cache they need. If one of them is missing,deinitwrites it again.Delete your personal configuration, only if you no longer want it:
bashagent-marketplace deinit --scope user --purge-configAfter the artifact and cache output, it prints
Removed config <path>andRemoved lock <path>for each file that existed. This deletes~/.agents/config.yamland~/.agents/lock.yaml.
What deinit leaves alone
- The durable state folder
${XDG_STATE_HOME:-$HOME/.local/state}/agent-marketplace/, which holds the ownership state and safety backups for shared configuration files. - Backup archives under
~/.agent-marketplace/backups/. - Files you wrote yourself inside harness folders, and handwritten entries, comments, and unrelated settings in shared configuration files such as
.mcp.json. - The organization configuration and lock under
/etc/agent-marketplace/. - Internal transaction files that
--purge-configuses to coordinate its deletions.
Troubleshooting
deinitprintswarning: could not read config: your configuration could not be loaded, sodeinitassumed the default installation mode. Output installed in the other mode (symlinks or regular files) may remain. Fix the configuration and rundeinitagain.error: could not resolve organization-owned artifacts; refusing teardown: a user-scopedeinitmust work out which resources the organization still requires before it removes anything. It stops without changes when it cannot. If the organization lock is invalid, the organization administrator has to repair or regenerate it. Do not remove or edit organization policy yourself.- Generated folders remain after
deinit: runagent-marketplace statusto see which scope still selects them. Repository output needs--scope repo, and machine output needs--scope user.