Register and publish from the command line

The agt command takes a name from search to a verified agent in a terminal: register it, write and sign its manifest, host it, set the on-chain records, and check the result. It signs in MetaMask by default, so your key stays in the wallet.

Install

terminalsh
npx @agtnames/cli --help        # run without installing
npm install -g @agtnames/cli    # or install the `agt` command

Node 20 or later. The same commands work in PowerShell, bash and zsh.

From nothing to a verified agent

five commandssh
agt available youragent
agt register youragent --years 1
agt manifest init youragent
agt manifest publish youragent youragent.manifest.json
agt verify youragent
  1. available shows whether the name is free and its price.
  2. register asks the site for a signed quote, approves the USDC amount if needed, and registers the name from your wallet. It pays in USDC on Polygon and needs a little POL for gas. A quote is good for about 15 minutes, so the approval and the registration go out one after the other.
  3. manifest init walks you through the manifest and writes youragent.manifest.json (below).
  4. manifest publish checks that every endpoint in the file answers, signs the manifest in your wallet, hosts it at https://agts.dev/youragent.json (or on IPFS with --host ipfs), and sets the records in one transaction: the manifest pointer, one endpoint per protocol, addr, and the agent wallet when the manifest lists a payment address. It finishes with a verify.
  5. verify checks that the manifest's signer, its owner and the on-chain owner are the same, and that each endpoint is live.
agt verify youragenttext
✓ youragent.agt: manifest verified, owner 0x7f4a…7566, signed by 0x7f4a…7566
  manifest https://agts.dev/youragent.json
  live  mcp https://youragent.example/mcp (health 200)
  live  a2a https://youragent.example/a2a (health 200)

Signing

Every write asks you to sign. By default agt opens a page on 127.0.0.1 in your browser, and you approve each signature and transaction in MetaMask, or in any wallet that injects window.ethereum. Keep the page open until the command finishes. --no-open prints the page address instead of opening it.

For scripts and CI, sign with a key instead. It is read from an environment variable or an encrypted keyfile, never from a command-line argument:

key from the environmentpowershell
$env:AGT_OWNER_KEY = "0x…"          # the name owner's private key, for this window only
agt manifest publish youragent youragent.manifest.json --signer key
Remove-Item Env:AGT_OWNER_KEY
encrypted keyfilesh
agt keyfile create owner.json          # prompts for the key and a passphrase (hidden)
agt keyfile address owner.json         # the address, no passphrase needed
agt records set youragent --mcp https://youragent.example/mcp --keyfile owner.json
keyfile in CIsh
# CI: passphrase from a secret, no prompt
AGT_KEYFILE_PASSPHRASE="$KEYFILE_PASSPHRASE" agt manifest publish youragent youragent.manifest.json --keyfile owner.json

A keyfile is scrypt plus AES-256-GCM over the key, with the address stored in the clear. It is the same format as the MCP server's session key.

Writing the manifest

In a terminal, agt manifest init youragent asks for each field in turn. Where it already knows a value it offers it as a suggestion, shown faintly after the cursor: your current manifest's values, a URL next to one you already entered, or what your agent says about itself. It reads your MCP server's tool list and A2A agent card as soon as you enter their URLs, and uses them to suggest a description and capabilities.

KeyDoes
Tab, then EnterFill the suggestion, then submit it. Enter on its own never takes a suggestion.
↑Put the suggestion back after typing over it. It stays visible under the field.
EscClear the field.
Ctrl+Y / Ctrl+KCopy the suggestion / what you typed.
j / ;Go back a step / skip it (in lists, or in an empty field).
Ctrl+CStop. Your answers are saved; the same command resumes.

Endpoints is one list with a URL box per protocol: Tab into a row, type the URL, Enter to save it and move to the next row, and Enter again to continue. Capabilities searches the shared vocabulary with the best match first; → browses by category, and a term that is not in the list can be added as your own. At the end it writes the file and prints the publish command, already copied to the clipboard.

Outside an interactive terminal, or with --template, it writes a file to fill in by hand:

youragent.manifest.jsonjson
{
  "description": "Hourly and 10-day weather forecasts for any city",
  "website": "https://youragent.example",
  "endpoints": [
    { "protocol": "mcp", "url": "https://youragent.example/mcp" },
    { "protocol": "a2a", "url": "https://youragent.example/a2a" }
  ],
  "capabilities": ["forecasting", "api-integration"],
  "pricing": { "model": "free" }
}

name, owner, updated and agt are filled in when you publish. The fields are in the Manifest Spec.

Records on their own

agt records setsh
agt records set youragent --mcp https://youragent.example/mcp --a2a https://youragent.example/a2a
agt records set youragent --wallet 0x…            # where the agent is paid
agt records set youragent --manifest https://agts.dev/youragent.json

Try before you send

--dry-run on any write signs what needs signing, prints the exact document and transactions, and sends nothing. --json prints the result as JSON on stdout, with progress on stderr. Exit codes: 0 done, 1 failed or verify found a problem, 2 usage error.

terminalsh
agt register youragent --dry-run                 # gets a real quote, prints the approve + register transactions
agt manifest publish youragent m.json --dry-run  # signs, prints the document and the record writes
agt verify youragent --json | jq .verified

Registering for someone else

agt register youragent --to 0x… pays from your wallet and registers the name to another address. Only that address can then publish the manifest or set records; a manifest signed by anyone else shows as unverified.

When something goes wrong

MessageWhat to do
missing the 0x prefix / holds an address, not a private keyThe key is 0x plus 64 hex characters; an address is 40.
this looks like your keyfile passphrasePass the file with --keyfile and the passphrase in AGT_KEYFILE_PASSPHRASE.
these endpoints are not reachable yetDeploy the agent first, or pass --skip-live-check to publish anyway.
owned by 0x…, but you are signing as 0x…Select the owner account in your wallet.
an equal or newer manifest is already hostedPublish again: the command signs a fresh manifest with the current time.
not enough USDC / quote expiresTop up USDC on Polygon, then run register again for a fresh quote.

Networks

--network polygon is the default; --network amoy is the testnet and needs --site pointing at a site that issues Amoy quotes. --rpc overrides the RPC endpoint. The same settings can come from AGT_NETWORK, AGT_RPC_URL and AGT_SITE.

Reference

Choose a wallet

More than one wallet is installed. Pick the one that holds your .agt name; the site will use it for signing and transactions until you disconnect.