bfun-agent-dev
v0.2.2
Published
CLI, OpenClaw plugin, and agent skill for creating and trading B.fun meme tokens on BSC
Downloads
282
Maintainers
Readme
bfun-agent-dev
bfun-agent-dev is the testnet dev package for B.fun automation, with three layers:
bfunCLI for direct terminal use- OpenClaw plugin for installing the bundled skill
skills/bfun-integrationfor agent-guided create, quote, and trade workflows
The CLI delegates to the existing Commander program in src/index.js and always loads .env from the current working directory before execution.
Install
CLI only
npm install -g bfun-agent-devAfter install:
bfun --helpOpenClaw plugin + skill
openclaw plugins install bfun-agent-devThis exposes the bfun-ai skill from skills/bfun-integration.
Configuration
Create a .env file in the directory where you run bfun:
BSC_RPC_URL=https://bsc-testnet-rpc.publicnode.com
# PRIVATE_KEY=0x...Notes:
- Default chain is BSC testnet (chainId 97).
PRIVATE_KEYis only required for write operations such asbuy,sell,send, andcreate.- The CLI entry reads
.envfromprocess.cwd(), not from the package directory.
For OpenClaw, configure skill env under ~/.openclaw/openclaw.json:
{
"skills": {
"entries": {
"bfun-ai": {
"enabled": true,
"env": {
"PRIVATE_KEY": "0x...",
"BSC_RPC_URL": "https://bsc-testnet-rpc.publicnode.com"
}
}
}
}
}After modifying
openclaw.json, restart OpenClaw for the changes to take effect.
Quick Start
Read-only commands
bfun config
bfun verify
bfun token-list --limit 5
bfun rankings now_trending --limit 10
bfun token-info 0xTokenAddress
bfun token-get 0xTokenAddress
bfun quote-buy 0xTokenAddress 0.01
bfun quote-sell 0xTokenAddress 1000
bfun tax-info 0xTokenAddressWrite commands
bfun buy 0xTokenAddress 0.01 --slippage 500
bfun sell 0xTokenAddress 1000 --slippage 500
bfun send 0xRecipient 0.01
bfun send 0xRecipient 100 --token 0xTokenAddressCreate a token
bfun create \
--name "My Token" \
--symbol "MTK" \
--image ./logo.png \
--description "Example token" \
--pair ETHThe create command also supports advanced vesting, tax, vault, collateral-pair, and optional first-buy parameters. See skills/bfun-integration/references/create-flow.md for the full parameter model.
Agent Usage
When installed as an OpenClaw plugin, the bundled skill guides the agent to:
- Inspect market state with
token-list,rankings,token-info, andtoken-get - Quote trades before execution with
quote-buyorquote-sell - Confirm risk acceptance before any write operation
- Execute
buy,sell,send, orcreateonly through the CLI
Primary skill file:
Reference material:
- skills/bfun-integration/references/create-flow.md
- skills/bfun-integration/references/trade-flow.md
- skills/bfun-integration/references/token-phases.md
- skills/bfun-integration/references/contract-addresses.md
- skills/bfun-integration/references/errors.md
Command Summary
Read-only:
bfun configbfun verifybfun token-info <tokenAddress>bfun token-get <tokenAddress>bfun token-list [--sort <value>] [--kw <keyword>] [--offset <n>] [--limit <n>]bfun rankings <orderBy> [--limit <n>]bfun quote-buy <tokenAddress> <bnbAmount> [--slippage <bps>]bfun quote-sell <tokenAddress> <tokenAmount> [--slippage <bps>]bfun tax-info <tokenAddress> [--user <address>]bfun events [fromBlock] [--toBlock <block>] [--chunk <n>]
Write:
bfun buy <tokenAddress> <bnbAmount> [--slippage <bps>]bfun sell <tokenAddress> <tokenAmount> [--slippage <bps>]bfun send <toAddress> <amount> [--token <tokenAddress>]bfun create ...
All commands return JSON for agent-friendly parsing. Success responses use { "success": true, "data": ... }. Failures return { "success": false, "error": ... } or, for create validation failures, { "success": false, "errors": [...] }.
