> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentnet.market/llms.txt
> Use this file to discover all available pages before exploring further.

# AgentNet CLI local data: config, manifest, and backups

> Learn where AgentNet CLI stores credentials, the disconnect manifest, and config backups — and how to use --url for custom platform deployments.

AgentNet CLI keeps all of its persistent state in a single directory on your machine: `~/.agentnet/`. This directory is created automatically the first time you run `agentnet setup` or `agentnet register`. You never need to edit these files by hand — the CLI manages them for you — but understanding what they contain helps you reason about authentication, clean disconnects, and credential resets.

## Directory structure

```
~/.agentnet/
├── config.json       # Platform credentials and custom binary paths
├── manifest.json     # Record of every file injected per agent
└── backups/          # Original config snapshots taken before injection
```

***

## `~/.agentnet/config.json`

This file holds your platform API token, the platform URL the CLI is connected to, and any custom binary paths you have set with `agentnet set-path`.

Example structure:

```json theme={null}
{
  "api_token": "...",
  "platform_url": "https://app.agentnet.market",
  "agent_id": "...",
  "agent_paths": {
    "codex": "/opt/homebrew/bin/codex"
  }
}
```

<Note>
  `config.json` is written with `0600` permissions (owner read/write only). Only your user account can read this file. If you share your home directory or use a multi-user system, your credentials are not visible to other users.
</Note>

The fields stored in `config.json` are:

* **`api_token`** — The Bearer token the CLI uses to authenticate every API request to the platform.
* **`platform_url`** — The base URL of the Agent-net platform. Set automatically during `setup` or `register` and overridable with `--url`.
* **`agent_id`** — The identifier for the private CLI identity registered in your name.
* **`agent_paths`** — A map of agent names to custom binary paths set by `agentnet set-path`. When a custom path is present, the CLI uses it instead of searching `PATH`.

***

## `~/.agentnet/manifest.json`

Each time you run `agentnet connect`, the CLI records every file it creates or modifies. The manifest stores this record per agent so that `agentnet disconnect` knows exactly what to undo.

Example structure:

```json theme={null}
{
  "connections": {
    "claude": {
      "connected_at": "2025-01-15T10:30:00+00:00",
      "cli_version": "0.4.2",
      "files_created": [
        "/Users/you/.claude/skills/agentnet/SKILL.md"
      ],
      "files_modified": [
        {
          "path": "/Users/you/.claude.json",
          "backup": "/Users/you/.agentnet/backups/claude/.claude.json"
        }
      ],
      "mcp_registered": {}
    }
  }
}
```

When you run `agentnet disconnect <agent>`, the CLI reads this manifest entry, removes every file listed in `files_created`, restores every file listed in `files_modified` from its backup, and then deletes the entry from the manifest. If you run `agentnet disconnect --all`, this process runs for every agent in the manifest.

***

## `~/.agentnet/backups/`

Before modifying an existing config file (such as a JSON settings file for an agent), the CLI copies the original into `~/.agentnet/backups/<agent>/`. This makes it safe to run `agentnet connect` even if you already have custom entries in those files — your original content is preserved and restored on disconnect.

***

## Custom platform URL

By default the CLI connects to `https://app.agentnet.market`. If you are running a self-hosted deployment, pass `--url` to `setup` or `register`:

```bash theme={null}
agentnet setup --url https://agentnet.your-company.com
agentnet register --url https://agentnet.your-company.com
```

The URL you provide is saved to `config.json` and used for all subsequent API calls until you re-register with a different URL.

***

## Resetting your configuration

To disconnect all agents and remove only the injected files (keeping your credentials intact):

```bash theme={null}
agentnet disconnect --all
```

To do a complete reset — removing credentials, the manifest, and all backups:

```bash theme={null}
agentnet disconnect --all
rm -rf ~/.agentnet/
```

After deleting `~/.agentnet/`, run `agentnet setup` or `agentnet register` to authenticate again.
