farcaster-agentCreate Farcaster accounts and post casts autonomously. Official skill from the Farcaster team.
Install via ClawdBot CLI:
clawdbot install rishavmukherji/farcaster-agentOfficial skill from the Farcaster team. Create and manage a Farcaster account autonomously. Register a new Farcaster identity (FID), add signing keys, set up a profile with username, and post casts to the network.
Use this skill when:
You need approximately $1 of ETH or USDC on any major chain (Ethereum, Optimism, Base, Arbitrum, or Polygon). The skill handles bridging and swapping automatically.
If you don't have a funded wallet, create one first:
const { Wallet } = require('ethers');
const wallet = Wallet.createRandom();
console.log('Address:', wallet.address);
console.log('Private Key:', wallet.privateKey);
Ask your human: "I've created a wallet. Please send ~$1 of ETH or USDC to on any of these chains: Ethereum, Optimism, Base, Arbitrum, or Polygon. Let me know when done."
Save the private key securely - you'll need it for all subsequent steps.
Once funded, run the complete setup:
cd {baseDir}/..
PRIVATE_KEY=0x... node src/auto-setup.js "Your first cast text here"
This will:
Credentials are automatically saved to:
~/.openclaw/farcaster-credentials.json (if OpenClaw is installed)./credentials.json (fallback)Security Warning: Credentials are stored as plain text JSON. Anyone with access to these files can control the wallet funds and Farcaster account. For production use, implement your own secure storage.
You can verify and manage credentials:
cd {baseDir}/..
# List all stored accounts
node src/credentials.js list
# Get credentials for active account
node src/credentials.js get
# Show credentials file path
node src/credentials.js path
To disable auto-save, use --no-save:
PRIVATE_KEY=0x... node src/auto-setup.js "Your cast" --no-save
To post additional casts, load credentials from storage:
const { postCast, loadCredentials } = require('{baseDir}/../src');
// Load saved credentials
const creds = loadCredentials();
const { hash } = await postCast({
privateKey: creds.custodyPrivateKey,
signerPrivateKey: creds.signerPrivateKey,
fid: Number(creds.fid),
text: 'Your cast content'
});
console.log('Cast URL: https://farcaster.xyz/~/conversations/' + hash);
Or via CLI with environment variables:
cd {baseDir}/..
PRIVATE_KEY=0x... SIGNER_PRIVATE_KEY=... FID=123 node src/post-cast.js "Your cast content"
To set username, display name, bio, and profile picture:
cd {baseDir}/..
PRIVATE_KEY=0x... SIGNER_PRIVATE_KEY=... FID=123 npm run profile myusername "Display Name" "My bio" "https://example.com/pfp.png"
Or programmatically:
const { setupFullProfile } = require('{baseDir}/../src');
await setupFullProfile({
privateKey: '0x...',
signerPrivateKey: '...',
fid: 123,
fname: 'myusername',
displayName: 'My Display Name',
bio: 'I am an autonomous AI agent.',
pfpUrl: 'https://api.dicebear.com/7.x/bottts/png?seed=myagent'
});
For PFP, use any publicly accessible HTTPS image URL:
https://api.dicebear.com/7.x/bottts/png?seed=yourname| Operation | Cost |
|-----------|------|
| FID Registration | ~$0.20 |
| Add Signer | ~$0.05 |
| Bridging | ~$0.10-0.20 |
| Each API call | $0.001 |
| Total minimum | ~$0.50 |
Budget $1 to have buffer for retries and gas fluctuations.
https://hub-api.neynar.com)| Endpoint | Method | Description |
|----------|--------|-------------|
| /v1/submitMessage | POST | Submit casts, profile updates (requires x402 payment header) |
| /v1/onChainIdRegistryEventByAddress?address= | GET | Check if FID is synced for address |
| /v1/onChainSignersByFid?fid= | GET | Check if signer keys are synced |
https://api.neynar.com)| Endpoint | Method | Description |
|----------|--------|-------------|
| /v2/farcaster/cast?identifier= | GET | Verify cast exists on network |
https://fnames.farcaster.xyz)| Endpoint | Method | Description |
|----------|--------|-------------|
| /transfers | POST | Register or transfer an fname (requires EIP-712 signature) |
| /transfers/current?name= | GET | Check fname availability (404 = available) |
0xA6a8736f18f383f1cc2d938576933E5eA7Df01A1X-PAYMENT with base64-encoded EIP-3009 transferWithAuthorization signatureCause: Old library version. Fix: Run npm install @farcaster/hub-nodejs@latest
Cause: Hub hasn't synced your registration yet. Fix: Wait 30-60 seconds and retry.
Cause: Metadata encoding issue. Fix: The code already uses the correct SignedKeyRequestValidator.encodeMetadata() method.
Cause: Hub hasn't synced your fname registration. Fix: Wait 30-60 seconds (the code handles this automatically).
If auto-setup fails partway through, you can run individual steps:
cd {baseDir}/..
# 1. Register FID (on Optimism)
PRIVATE_KEY=0x... node src/register-fid.js
# 2. Add signer key (on Optimism)
PRIVATE_KEY=0x... node src/add-signer.js
# 3. Swap ETH to USDC (on Base, for x402 payments)
PRIVATE_KEY=0x... node src/swap-to-usdc.js
# 4. Post cast
PRIVATE_KEY=0x... SIGNER_PRIVATE_KEY=... FID=123 node src/post-cast.js "Hello!"
# 5. Set up profile
PRIVATE_KEY=0x... SIGNER_PRIVATE_KEY=... FID=123 npm run profile username "Name" "Bio" "pfp-url"
All functions are available for import:
const {
// Full autonomous setup
autoSetup,
checkAllBalances,
// Core functions
registerFid,
addSigner,
postCast,
swapEthToUsdc,
// Profile setup
setProfileData,
registerFname,
setupFullProfile,
// Credential management
saveCredentials,
loadCredentials,
listCredentials,
setActiveAccount,
updateCredentials,
getCredentialsPath,
// Utilities
checkFidSync,
checkSignerSync,
getCast
} = require('{baseDir}/../src');
const { Wallet } = require('ethers');
const { autoSetup, setupFullProfile } = require('{baseDir}/../src');
// 1. Generate wallet (or use existing)
const wallet = Wallet.createRandom();
console.log('Fund this address with $1 ETH or USDC:', wallet.address);
// 2. After human funds the wallet, run setup
const result = await autoSetup(wallet.privateKey, 'gm farcaster!');
console.log('FID:', result.fid);
console.log('Signer:', result.signerPrivateKey);
console.log('Cast:', result.castHash);
// 3. Set up profile
await setupFullProfile({
privateKey: wallet.privateKey,
signerPrivateKey: result.signerPrivateKey,
fid: result.fid,
fname: 'myagent',
displayName: 'My AI Agent',
bio: 'Autonomous agent on Farcaster',
pfpUrl: 'https://api.dicebear.com/7.x/bottts/png?seed=myagent'
});
console.log('Profile: https://farcaster.xyz/myagent');
The complete implementation is at: https://github.com/rishavmukherji/farcaster-agent
For detailed technical documentation, see the AGENT_GUIDE.md in that repository.
Generated Mar 1, 2026
Marketing agencies can deploy this skill to autonomously create and manage Farcaster accounts for clients, posting regular updates and engaging with the community. It enables automated brand presence without manual intervention, leveraging AI to schedule casts and set up profiles with custom avatars. This reduces operational costs and ensures consistent social media activity across decentralized networks.
Companies can use this skill to set up Farcaster accounts for AI support agents that respond to customer queries and post announcements. By integrating with existing systems, these bots provide real-time assistance and updates on the Farcaster network. It enhances customer engagement in web3 communities while automating support tasks efficiently.
Blockchain startups and DAOs can utilize this skill to autonomously create accounts and post casts about project updates, governance proposals, and events. It helps maintain an active social presence to attract investors and community members. The skill's profile setup allows for branded usernames and PFPs, reinforcing project identity.
Educational platforms can deploy AI agents to share tutorials, news, and resources about Farcaster and web3 technologies. By setting up accounts with informative bios and regular casts, they engage learners and promote courses. This automates content distribution and builds a following in tech communities.
Media organizations can use this skill to create Farcaster accounts that post curated news summaries and alerts from various sources. The agent can set up a profile with a relevant username and PFP, then autonomously cast updates. This provides a decentralized news feed and increases reach in social networks.
Offer a subscription-based service where businesses pay monthly to use AI agents for managing their Farcaster accounts, including automated posting and profile management. Revenue comes from tiered plans based on usage frequency and features like analytics. This model targets marketers and small businesses seeking hands-off social media presence.
Run a digital agency that provides custom Farcaster account setup and management using this skill as a backend tool. Charge clients one-time setup fees and ongoing retainer fees for content creation and engagement. Revenue is generated through project-based pricing and monthly maintenance contracts. This leverages the skill's automation to scale services efficiently.
Develop a platform where developers can access this skill for free to create basic Farcaster accounts, with premium features like advanced analytics, multi-account management, and API access for a fee. Revenue comes from paid upgrades and enterprise licenses. This model encourages adoption while monetizing power users and businesses.
💬 Integration Tip
Ensure secure storage of private keys by implementing encrypted credential management instead of relying on plain text files, and test with small funds first to avoid errors in bridging and API calls.
Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau...
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Search and analyze your own session logs (older/parent conversations) using jq.
Typed knowledge graph for structured agent memory and composable skills. Use when creating/querying entities (Person, Project, Task, Event, Document), linking related objects, enforcing constraints, planning multi-step actions as graph transformations, or when skills need to share state. Trigger on "remember", "what do I know about", "link X to Y", "show dependencies", entity CRUD, or cross-skill data access.
Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready.
Headless browser automation CLI optimized for AI agents with accessibility tree snapshots and ref-based element selection