# Reset or uninstall

This page covers the two cleanup paths in AgentPay SDK.

They are not the same:

* `reset` clears wallet-specific state so the machine can be set up again
* `uninstall` removes AgentPay from the machine

## Reset

{% hint style="warning" %}
**Before resetting**, check whether you have an encrypted offline wallet backup. If you do, you can restore the same wallet on this or another machine with `agentpay admin setup --restore-wallet-from <backup.json>` instead of destroying the wallet state. Only reset when you intentionally want to discard the old wallet and create a new one.
{% endhint %}

Use reset when you want to discard the current wallet attachment and start over without removing the CLI itself.

```bash
agentpay admin reset
agentpay admin reset --yes
agentpay admin reset --yes --delete-config
```

Without `--yes`, the CLI prints a destructive warning to stderr and prompts:

```
Type RESET to delete the managed local daemon state and wallet credentials:
```

You must type exactly `RESET` to proceed.

For automation or CI-style flows, use `--non-interactive` together with `--yes` to suppress all interactive prompts.

`--delete-config` goes further and removes `~/.agentpay/config.json` instead of only clearing wallet-specific credentials.

Because the managed local daemon and its state are root-managed, reset can prompt for the local root password.

### What reset removes and keeps

**Removed by reset:**

* managed LaunchDaemon (`com.agentpay.daemon`)
* agent auth token from macOS Keychain
* `agentKeyId` and `agentAuthToken` from config
* bootstrap artifacts
* managed local daemon state (`/var/db/agentpay/daemon-state.enc`)
* daemon socket

**Kept by reset** (unless `--delete-config` is passed):

* the rest of `config.json` (chain settings, RPC URLs, etc.)

## Uninstall

Use uninstall when you want AgentPay removed from the machine entirely:

```bash
agentpay admin uninstall
agentpay admin uninstall --yes
```

Without `--yes`, the CLI prints a destructive warning to stderr and prompts:

```
Type UNINSTALL to delete all AgentPay managed files and local credentials:
```

You must type exactly `UNINSTALL` to proceed.

Uninstall removes everything that reset removes, plus:

* `/Library/AgentPay/` (entire directory)
* `/var/db/agentpay/` (entire directory)
* `/var/log/agentpay/` (entire directory)
* `~/.agentpay/` (entire directory)
* the daemon password stored in System Keychain
* one-click installer artifacts (shell RC blocks, skill symlinks, PATH shims)
* source-built CLI artifacts (if installed from source)

For automation, use `--non-interactive` together with `--yes`.

Because this removes root-managed files, uninstall can also prompt for the local root password.

If something went wrong and you ended up here to recover, see [Troubleshooting](/agentpay-sdk/workflows/troubleshooting.md) before resetting - repair may be enough.

## When to use which

Choose reset when:

* the machine should keep `agentpay` installed
* the current wallet state should be discarded
* you plan to run `agentpay admin setup` again afterward

Choose uninstall when:

* the machine should stop running AgentPay entirely
* you are cleaning up a development or test machine
* you do not want to leave AgentPay state behind under user or root-managed paths

## Next step

If you reset and want to set up again, continue to [Wallet setup](/agentpay-sdk/workflows/wallet-setup.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.worldlibertyfinancial.com/agentpay-sdk/workflows/reset-and-uninstall.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
