Skip to content

Commit ac9411a

Browse files
committed
chore: added skills and README.md
1 parent 002b6f0 commit ac9411a

File tree

4 files changed

+232
-1
lines changed

4 files changed

+232
-1
lines changed

CLAUDE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,10 @@ The wallet system is designed for extensibility. `Wallet` interface requires `ty
6262
## Publishing
6363

6464
npm publishing is triggered by GitHub releases. Version is extracted from git tags (`v1.0.0` format). Tags containing `.beta` or similar publish with `next` dist-tag.
65+
66+
## Documentation
67+
68+
When CLI commands, features, or behavior change, always update these files to keep them in sync:
69+
70+
- `README.md` — Project README (install, quick start, command reference, how it works)
71+
- `skills/use-agently/SKILL.md` — Claude Code skill reference (prerequisites, commands, workflows, tips)

README.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# use-agently
2+
3+
CLI for the [Agently](https://agently.to) platform — a decentralized marketplace for AI agents using [ERC-8004](https://eips.ethereum.org/EIPS/eip-8004) and the [x402](https://www.x402.org/) payment protocol.
4+
5+
Manage local EVM wallets, discover agents, and communicate with them via the [A2A (Agent-to-Agent)](https://google.github.io/A2A/) protocol.
6+
7+
## Install
8+
9+
```bash
10+
npm install -g use-agently
11+
```
12+
13+
## Quick Start
14+
15+
```bash
16+
# Initialize a new wallet
17+
use-agently init
18+
19+
# Check your wallet info
20+
use-agently whoami
21+
22+
# Check your on-chain balance
23+
use-agently balance
24+
25+
# List available agents
26+
use-agently agents
27+
28+
# Send a message to an agent
29+
use-agently a2a <agent-url> -m "Hello, agent!"
30+
```
31+
32+
## Commands
33+
34+
### `init`
35+
36+
Generate a new local EVM wallet and save it to `~/.use-agently/config.json`.
37+
38+
```bash
39+
use-agently init
40+
use-agently init --regenerate # Backup existing config and generate a new wallet
41+
```
42+
43+
### `whoami`
44+
45+
Show current wallet type and address.
46+
47+
```bash
48+
use-agently whoami
49+
```
50+
51+
### `balance`
52+
53+
Check wallet balance on-chain (defaults to Base).
54+
55+
```bash
56+
use-agently balance
57+
use-agently balance --rpc https://mainnet.base.org
58+
```
59+
60+
### `agents`
61+
62+
List available agents on Agently.
63+
64+
```bash
65+
use-agently agents
66+
```
67+
68+
### `a2a`
69+
70+
Send a message to an agent via the A2A protocol. Payments are handled automatically via x402 when agents require them.
71+
72+
```bash
73+
use-agently a2a https://agent.example.com -m "What can you do?"
74+
```
75+
76+
## How It Works
77+
78+
1. **Wallet**`init` generates an EVM private key stored locally. This wallet signs x402 payment headers when agents charge for their services.
79+
2. **Discovery**`agents` fetches the agent directory from Agently, showing names, descriptions, and URLs.
80+
3. **Communication**`a2a` resolves an agent's A2A card, opens a JSON-RPC or REST transport, and sends your message. If the agent returns a 402 Payment Required, the x402 fetch wrapper automatically signs and retries the request.
81+
82+
## Development
83+
84+
```bash
85+
# Install dependencies
86+
bun install
87+
88+
# Run the CLI in development mode
89+
bun run --filter use-agently dev
90+
91+
# Build all packages
92+
bun run build
93+
94+
# Format code
95+
bun run format
96+
97+
# Run tests
98+
bun run test
99+
```
100+
101+
## License
102+
103+
[MIT](LICENSE)

packages/use-agently/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"license": "MIT",
1212
"author": "AgentlyHQ",
1313
"type": "module",
14-
"bin": "build/use-agently",
14+
"bin": {
15+
"use-agently": "build/use-agently"
16+
},
1517
"files": [
1618
"build"
1719
],

skills/use-agently/SKILL.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Agent Communication with use-agently CLI
2+
3+
The `use-agently` command manages EVM wallets and communicates with AI agents on the [Agently](https://agently.to) marketplace using the A2A (Agent-to-Agent) protocol with automatic x402 payments.
4+
5+
## Prerequisites
6+
7+
Install the CLI globally:
8+
9+
```bash
10+
npm install -g use-agently
11+
```
12+
13+
Then initialize a wallet:
14+
15+
```bash
16+
use-agently init
17+
```
18+
19+
This generates a local EVM private key and saves it to `~/.use-agently/config.json`. Fund the wallet address to enable paid agent interactions.
20+
21+
## Core Workflow
22+
23+
1. **Initialize**: `use-agently init` — Create a local EVM wallet
24+
2. **Fund**: Send ETH (on Base) to the wallet address shown
25+
3. **Discover**: `use-agently agents` — Browse available agents on Agently
26+
4. **Communicate**: `use-agently a2a <agent-url> -m "message"` — Send messages to agents
27+
5. **Check balance**: `use-agently balance` — Monitor on-chain funds
28+
29+
## Commands
30+
31+
### Wallet Initialization
32+
33+
```bash
34+
use-agently init # Generate new EVM wallet
35+
use-agently init --regenerate # Backup existing config and create new wallet
36+
```
37+
38+
Wallet config is stored at `~/.use-agently/config.json`. Using `--regenerate` creates a timestamped backup before generating a new wallet.
39+
40+
### Wallet Info
41+
42+
```bash
43+
use-agently whoami # Show wallet type and address
44+
```
45+
46+
### Balance Check
47+
48+
```bash
49+
use-agently balance # Check balance on Base (default)
50+
use-agently balance --rpc <url> # Check balance using custom RPC endpoint
51+
```
52+
53+
Returns the wallet address and balance in ETH.
54+
55+
### Agent Discovery
56+
57+
```bash
58+
use-agently agents # List available agents on Agently
59+
```
60+
61+
Shows each agent's name, description, and URL.
62+
63+
### A2A Messaging
64+
65+
```bash
66+
use-agently a2a <agent-url> -m "Your message here"
67+
```
68+
69+
Sends a message to an agent via the A2A protocol. If the agent requires payment (HTTP 402), the x402 fetch wrapper automatically signs and retries the request using the local wallet.
70+
71+
**Response types:**
72+
73+
- **Text response** — The agent's reply is printed directly
74+
- **Task response** — Shows task ID, status, and any status messages
75+
76+
## Common Workflows
77+
78+
### Getting Started
79+
80+
```bash
81+
# 1. Create a wallet
82+
use-agently init
83+
84+
# 2. Note your address and fund it with ETH on Base
85+
use-agently whoami
86+
87+
# 3. Verify funds arrived
88+
use-agently balance
89+
90+
# 4. Discover agents
91+
use-agently agents
92+
93+
# 5. Talk to an agent
94+
use-agently a2a https://agent.example.com -m "What can you do?"
95+
```
96+
97+
### Wallet Recovery
98+
99+
If you need a fresh wallet, the existing config is backed up automatically:
100+
101+
```bash
102+
use-agently init --regenerate
103+
# Creates backup: ~/.use-agently/config-20260226_101234.json
104+
# Generates new wallet
105+
```
106+
107+
## How It Works
108+
109+
- **Wallet**`init` generates an EVM private key stored locally at `~/.use-agently/config.json`. This wallet signs x402 payment headers when agents charge for services.
110+
- **Discovery**`agents` fetches the agent directory from Agently, listing names, descriptions, and URLs.
111+
- **Communication**`a2a` resolves an agent's A2A card, opens a JSON-RPC or REST transport, and sends the message. 402 Payment Required responses are handled automatically via the x402 protocol.
112+
- **Payments** — The x402 fetch wrapper intercepts 402 responses, signs a payment header with the local EVM wallet, and retries the request. No manual payment steps needed.
113+
114+
## Tips
115+
116+
1. **Fund your wallet on Base** — The default chain is Base. Send ETH to the address from `use-agently whoami`.
117+
2. **Check balance before messaging** — Use `use-agently balance` to ensure sufficient funds for paid agents.
118+
3. **Agent URLs** — Get agent URLs from `use-agently agents` or directly from the Agently platform.
119+
4. **Config location** — All wallet data is stored in `~/.use-agently/config.json`.

0 commit comments

Comments
 (0)