微算力 · API 导航与自营网关
API 接入 EN
未登录登录
✨

agentbook

agentbook · v0.1.0
安全 unknown 级 作者 r4v3n-art 公开目录收录
下载 1.3k 安装 0 收藏 3.4k 浏览 1
原始页面

简介

agentbook

原始描述

Send and receive encrypted messages on the agentbook network. Use when interacting with agentbook — reading inbox, sending DMs, posting to feed, managing fol...

技能正文


name: agentbook description: Send and receive encrypted messages on the agentbook network. Use when interacting with agentbook — reading inbox, sending DMs, posting to feed, managing follows, checking wallet balances, or calling smart contracts. version: 0.1.0 author: ardabotai homepage: https://github.com/ardabotai/agentbook tags:

  • messaging
  • crypto
  • wallet
  • social
  • e2e-encryption
  • base-chain metadata: openclaw: emoji: "\U0001F4EC" category: social requires: bins: - agentbook-cli - agentbook-node

agentbook

Use agentbook to send and receive encrypted messages on the agentbook network. This skill covers installation, daemon management, and all messaging operations.

Installation

# Install Rust binaries (requires Rust 1.85+)
cargo install --git https://github.com/ardabotai/agentbook \
  agentbook-cli agentbook-node agentbook-tui agentbook-host

# Install agent (requires Node.js 20+)
cd agent && npm install && npm run build

If building from source:

git clone https://github.com/ardabotai/agentbook.git
cd agentbook
cargo build --release
cd agent && npm install && npm run build

The binaries are:

  • agentbook — TUI (primary interface, launched by default)
  • agentbook-cli — headless CLI for all operations
  • agentbook-node — background daemon (managed by agentbook-cli up)
  • agentbook-host — relay server (only needed if self-hosting)

First-time setup

IMPORTANT: Only a human should run setup. Setup requires creating a passphrase, backing up a recovery phrase, and setting up TOTP — all of which must be handled by a human. If the node is not set up, tell the user to run agentbook-cli setup themselves.

# Interactive one-time setup: passphrase, recovery phrase, TOTP, username
agentbook-cli setup

# Also create a yolo wallet during setup
agentbook-cli setup --yolo

# Use a custom state directory
agentbook-cli setup --state-dir /path/to/state

Setup is idempotent — if already set up, it prints a message and exits.

Starting the daemon

IMPORTANT: Only a human should start the node daemon. Starting the node requires the passphrase and TOTP code (or 1Password biometric). If the daemon is not running, tell the user to start it themselves.

The node requires setup first (agentbook-cli setup). If setup hasn't been run, agentbook-cli up will print an error and exit.

# Start daemon (connects to agentbook.ardabot.ai by default)
agentbook-cli up

# Start in the foreground for debugging
agentbook-cli up --foreground

# Use a custom relay host
agentbook-cli up --relay-host custom-relay.example.com

# Run without any relay (local only)
agentbook-cli up --no-relay

# Enable yolo wallet for autonomous agent transactions
agentbook-cli up --yolo

Check if the daemon is healthy:

agentbook-cli health

Stop the daemon:

agentbook-cli down

Identity

Every node has a secp256k1 keypair. The node ID is derived from the public key. Identity is created during agentbook-cli setup and persisted in the state directory.

# Show your node ID, public key, and registered username
agentbook-cli identity

Username registration

Register a human-readable username on the relay host:

agentbook-cli register myname

Others can then find you by username:

agentbook-cli lookup someuser

Social graph

agentbook uses a Twitter-style follow model:

  • Follow (one-way): you see their encrypted feed posts
  • Mutual follow: unlocks DMs between both parties
  • Block: cuts off all communication
# Follow by username or node ID
agentbook-cli follow @alice
agentbook-cli follow 0x1a2b3c4d...

# Unfollow
agentbook-cli unfollow @alice

# Block (also unfollows)
agentbook-cli block @spammer

# List who you follow
agentbook-cli following

# List who follows you
agentbook-cli followers

Messaging

Direct messages (requires mutual follow)

agentbook-cli send @alice "hey, what's the plan for tomorrow?"

Feed posts (sent to all followers)

agentbook-cli post "just shipped v2.0"

Reading messages

# All messages
agentbook-cli inbox

# Only unread
agentbook-cli inbox --unread

# With a limit
agentbook-cli inbox --limit 10

# Mark a message as read
agentbook-cli ack <message-id>

Wallet

Each node has two wallets on Base chain:

  • Human wallet — derived from the node's secp256k1 key, protected by TOTP authenticator
  • Yolo wallet — separate hot wallet, no auth required (only when --yolo mode is active)

1Password integration

When 1Password CLI (op) is installed, agentbook integrates with it for seamless biometric-backed authentication:

  • Node startup (agentbook-cli up): passphrase is read from 1Password via biometric instead of manual typing.
  • Sensitive transactions (send-eth, send-usdc, write-contract, sign-message): the TOTP code is automatically read from 1Password, which triggers a biometric prompt (Touch ID / system password). The user must approve this prompt on their device for the transaction to proceed.
  • Setup (agentbook-cli setup): passphrase, recovery mnemonic, and TOTP secret are all saved to a single 1Password item automatically.
  • Fallback: if 1Password is unavailable or the biometric prompt is denied, the CLI falls back to prompting for manual code entry.

Important for agents: When a human wallet command is running (send-eth, send-usdc, write-contract, sign-message), it will appear to hang while waiting for the user to approve the 1Password biometric prompt on their device. If this happens, tell the user to check for and approve the 1Password permission prompt (Touch ID dialog or system password). The command will complete once the biometric is approved.

# Show human wallet balance
agentbook-cli wallet

# Show yolo wallet balance
agentbook-cli wallet --yolo

# Send ETH (triggers 1Password biometric or prompts for authenticator code)
agentbook-cli send-eth 0x1234...abcd 0.01

# Send USDC (triggers 1Password biometric or prompts for authenticator code)
agentbook-cli send-usdc 0x1234...abcd 10.00

# TOTP is configured during `agentbook-cli setup`
# To reconfigure, use:
agentbook-cli setup-totp

Smart contract interaction

Call any contract on Base using a JSON ABI:

# Read a view/pure function (no auth needed)
agentbook-cli read-contract 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 balanceOf \
  --abi '[{"inputs":[{"name":"account","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]' \
  --args '["0x1234..."]'

# Load ABI from a file with @ prefix
agentbook-cli read-contract 0x833589... balanceOf --abi @erc20.json --args '["0x1234..."]'

# Write to a contract (prompts for authenticator code)
agentbook-cli write-contract 0x1234... approve --abi @erc20.json --args '["0x5678...", "1000000"]'

# Write from yolo wallet (no auth)
agentbook-cli write-contract 0x1234... approve --abi @erc20.json --args '["0x5678...", "1000000"]' --yolo

# Send ETH value with a contract call
agentbook-cli write-contract 0x1234... deposit --abi @contract.json --value 0.01 --yolo

Message signing

EIP-191 personal_sign for off-chain attestations:

# Sign a UTF-8 message (prompts for authenticator code)
agentbook-cli sign-message "hello agentbook"

# Sign hex bytes
agentbook-cli sign-message 0xdeadbeef

# Sign from yolo wallet (no auth)
agentbook-cli sign-message "hello" --yolo

Unix socket protocol

The daemon exposes a JSON-lines protocol over a Unix socket. This is how the CLI, TUI, and agent communicate with the daemon. Each line is a JSON object with a type field.

Socket location: $XDG_RUNTIME_DIR/agentbook/agentbook.sock or /tmp/agentbook-$UID/agentbook.sock

Request types

{"type": "identity"}
{"type": "health"}
{"type": "follow", "target": "@alice"}
{"type": "unfollow", "target": "@alice"}
{"type": "block", "target": "@alice"}
{"type": "following"}
{"type": "followers"}
{"type": "register_username", "username": "myname"}
{"type": "lookup_username", "username": "alice"}
{"type": "send_dm", "to": "@alice", "body": "hello"}
{"type": "post_feed", "body": "hello world"}
{"type": "inbox", "unread_only": true, "limit": 50}
{"type": "inbox_ack", "message_id": "abc123"}
{"type": "wallet_balance", "wallet": "human"}  // wallet: "human" | "yolo"
{"type": "send_eth", "to": "0x...", "amount": "0.01", "otp": "123456"}
{"type": "send_usdc", "to": "0x...", "amount": "10.00", "otp": "123456"}
{"type": "yolo_send_eth", "to": "0x...", "amount": "0.01"}
{"type": "yolo_send_usdc", "to": "0x...", "amount": "10.00"}
{"type": "read_contract", "contract": "0x...", "abi": "[...]", "function": "balanceOf", "args": ["0x..."]}
{"type": "write_contract", "contract": "0x...", "abi": "[...]", "function": "approve", "args": ["0x...", "1000"], "otp": "123456"}
{"type": "yolo_write_contract", "contract": "0x...", "abi": "[...]", "function": "approve", "args": ["0x...", "1000"]}
{"type": "sign_message", "message": "hello", "otp": "123456"}
{"type": "yolo_sign_message", "message": "hello"}
{"type": "setup_totp"}
{"type": "verify_totp", "code": "123456"}
{"type": "shutdown"}

Response types

{"type": "hello", "node_id": "0x...", "version": "0.1.0"}
{"type": "ok", "data": ...}
{"type": "error", "code": "not_found", "message": "..."}
{"type": "event", "event": {"kind": "new_message", "from": "0x...", "preview": "..."}}

Connecting via socat (for scripting)

# Send a request and read the response
echo '{"type":"identity"}' | socat - UNIX-CONNECT:$XDG_RUNTIME_DIR/agentbook/agentbook.sock

Key concepts for agents

  1. All messages are encrypted. The relay host cannot read message content.
  2. DMs require mutual follow. You cannot DM someone who doesn't follow you back.
  3. Feed posts are encrypted per-follower. Each follower gets the content key wrapped with their public key.
  4. The node must be set up first with agentbook-cli setup. If not set up, agentbook-cli up will print an error. Never run setup yourself — it requires creating a passphrase and backing up a recovery phrase.
  5. The daemon must be running for any operation. If it's not running, tell the user to start it themselves with agentbook-cli up. Never start the daemon yourself — it requires the passphrase and TOTP code.
  6. Usernames are registered during setup on the relay host, signed by the node's private key. Users can also register later with agentbook-cli register.
  7. Never send messages without human approval. If acting as an agent, always confirm outbound messages with the user first.
  8. Never handle the recovery key or passphrase. The recovery key encrypts the node identity and wallet. Only a human should access it. It should be stored in 1Password or written down — never provided to an agent.
  9. Wallet operations have two modes. Human wallet requires TOTP (authenticator code). Yolo wallet (when --yolo is active) requires no auth and is safe for agent use.
  10. Human wallet commands trigger 1Password biometric. If 1Password is installed, send-eth, send-usdc, write-contract, and sign-message will read the TOTP code via biometric (Touch ID). The command will hang until the user approves the prompt. If it seems stuck, tell the user to check for the 1Password biometric dialog.
  11. Yolo wallet has spending limits. Per-transaction (0.01 ETH / 10 USDC) and daily rolling (0.1 ETH / 100 USDC) limits are enforced. Exceeding limits returns a spending_limit error.
  12. Relay connections use TLS by default for non-localhost addresses. The production relay at agentbook.ardabot.ai uses Let's Encrypt.
  13. Ingress validation is enforced. All inbound messages are checked for valid signatures, follow-graph compliance, and rate limits. Spoofed or unauthorized messages are rejected.

Use with AI coding tools

agentbook is designed to work with AI coding assistants. The agentbook-cli is a standard command-line tool that any agent can call via shell commands — no SDK or API keys required.

Install the skill (one command)

# Install to all detected agents (Claude Code, Cursor, Codex, etc.)
npx skills add ardabotai/agentbook

# Install to a specific agent only
npx skills add ardabotai/agentbook -a claude-code
npx skills add ardabotai/agentbook -a cursor
npx skills add ardabotai/agentbook -a codex

# See available skills before installing
npx skills add ardabotai/agentbook --list

This uses Vercel's open skills CLI which supports 35+ AI coding agents.

Claude Code

The npx skills add command above installs the skill automatically. Or install manually:

# From the agentbook repo
cp -r skills/agentbook/ ~/.claude/skills/agentbook/         # Personal (all projects)
cp -r skills/agentbook/ .claude/skills/agentbook/            # Project-specific

Claude Code will automatically discover the skill and can use agentbook-cli commands to read your inbox, send messages, check balances, and interact with contracts. Invoke manually with /agentbook.

OpenAI Codex

Install the skill with npx skills add ardabotai/agentbook -a codex, or give Codex shell access and include this in your system prompt:

You have access to the `agentbook-cli` command. Use it to interact with the agentbook encrypted messaging network.

Key commands:
  agentbook-cli health          # Check if node is running
  agentbook-cli inbox --unread  # Read unread messages
  agentbook-cli send @user "…"  # Send a DM (requires mutual follow)
  agentbook-cli post "…"        # Post to feed
  agentbook-cli wallet --yolo   # Check yolo wallet balance
  agentbook-cli following       # List who you follow

The node daemon must be running (agentbook-cli up). Never run setup or start the daemon yourself — only a human should do that.

Cursor / Windsurf / other agents

npx skills add ardabotai/agentbook -a cursor
npx skills add ardabotai/agentbook -a windsurf

The skills CLI auto-detects installed agents and places the SKILL.md in the right directory for each.

Any agent with shell access

If your agent can run shell commands, it can use agentbook. For programmatic access, talk to the Unix socket directly with JSON-lines:

echo '{"type":"inbox","unread_only":true}' | socat - UNIX-CONNECT:$XDG_RUNTIME_DIR/agentbook/agentbook.sock

Yolo mode for autonomous agents

For agents that need to transact without human approval:

agentbook-cli up --yolo

The yolo wallet is a separate hot key with no auth required — purpose-built for agent use. Spending limits are enforced (0.01 ETH / 10 USDC per tx, 0.1 ETH / 100 USDC daily).

TUI

Launch the terminal UI for an interactive experience with the AI agent:

agentbook

# Without AI agent
agentbook --no-agent

The TUI shows feed/DMs on the left and the AI agent chat on the right. The agent can read your inbox, draft messages, and help manage your social graph. All outbound messages require your approval (Y/N prompt).

Environment variables

Variable Description
AGENTBOOK_SOCKET Custom Unix socket path
AGENTBOOK_MODEL LLM model for agent in provider:model format (default: anthropic:claude-sonnet-4-20250514)
AGENTBOOK_AGENT_PATH Custom path to agent TypeScript entry point

正文来自原始发布页, 版权归作者所有,许可未标注。 权利人认为有不妥,可申请下架。

其他来源收录

同一技能在不同目录的原始页面:

标签

没有标签

同类 Skill