Skip to content

Quickstart (CLI)

Install the CLI, create a named agent, send a transaction, revoke it. Five minutes, end to end.

1. Install

npm install -g @agensai/cli

Verify:

agensai --version

2. Authenticate

agensai init

You'll be prompted for your AGENSAI API key (get one at app.agensai.xyz). The CLI generates an encrypted local keystore at ~/.agensai/keystore for the owner key that will fund and authorize your agents.

✔ API key saved
✔ Owner keystore created
✔ Owner address: 0x4d2a…9f1b

3. Create your first agent

agensai create my-agent \
  --policy spend:50/USDC/weekly \
  --policy contract:uniswap.eth \
  --policy expires:2026-08-01

Output:

✔ Smart account provisioned
✔ ENS subname issued: my-agent.agensai.eth
✔ Permissions granted onchain
✔ Agent ready
 
  Name:     my-agent.agensai.eth
  Address:  0x7a3b…c2f1
  Chain:    Base (8453)
  Policies: spend, contract, expires

The agent is now an addressable, named entity onchain. You can look it up in any ENS-aware tool.

4. Execute as the agent

agensai send 10 USDC to treasury.acme.eth --as my-agent.agensai.eth

Output:

✔ Transaction submitted
  From:  my-agent.agensai.eth
  To:    treasury.acme.eth
  Value: 10 USDC
  Tx:    0x9c41…ab23

ENS names are accepted everywhere addresses are. Add --raw to any command to see hex output instead.

5. List your agents

agensai ls
NAME                       BALANCE    POLICIES               STATUS
my-agent.agensai.eth       90 USDC    spend, contract        active

6. Revoke

agensai revoke my-agent.agensai.eth

Revocation is an onchain transaction. Once revoked, the agent's permissions are gone permanently.

✔ Permissions revoked
  Tx: 0xa83f…c19d

The ENS subname remains (you can reuse the name), but the agent can no longer act.

What just happened

Under the hood, agensai create did three things:

  1. Provisioned a smart account. ERC-4337 with EntryPoint v0.8.
  2. Issued an ENS subname. Gasless, under agensai.eth.
  3. Granted ERC-7715 permissions. From your owner account.

You wrote a name and three policies.

Next steps