{"_id":"@b-fun/bfun-ai","_rev":"11-ddbb7987efabce655b65c080c6a456f6","name":"@b-fun/bfun-ai","dist-tags":{"latest":"0.5.4"},"versions":{"0.5.0":{"name":"@b-fun/bfun-ai","version":"0.5.0","keywords":["bfun","bsc","binance","meme","memecoin","token","cli","agent","skill","openclaw"],"author":{"name":"B.fun"},"license":"MIT","_id":"@b-fun/bfun-ai@0.5.0","maintainers":[{"name":"bfunbot","email":"info@b.fun"}],"homepage":"https://github.com/bfun-ai/bfun-ai#readme","bugs":{"url":"https://github.com/bfun-ai/bfun-ai/issues"},"bin":{"bfun":"bin/bfun.js"},"dist":{"shasum":"d642a5abbb18d31e915c4f10ef4971307d40b3cc","tarball":"https://registry.npmjs.org/@b-fun/bfun-ai/-/bfun-ai-0.5.0.tgz","fileCount":39,"integrity":"sha512-Qqsslse/svTZIxWbggCXWjwGsPIbp8DNklRDeWCIFFUfLYwCtoCKxq3dDwDgrfVGyYDx8XlmwUezUMa6ylfldg==","signatures":[{"sig":"MEQCIGDXeYm7uLs2PrW+WVOZR7xrhxfj0T19LFeRT7hLDA6tAiBLrPVXCylrp4cpC8SCA6wUAWTHGZ41eTVei/Vw3VRFKw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":146896},"type":"module","_npmUser":{"name":"bfunbot","email":"info@b.fun"},"openclaw":{"extensions":["./plugin.ts"]},"deprecated":"Use 0.5.1 — docs aligned with real CLI output, verify-first flow, stricter confirmation rules","repository":{"url":"git+https://github.com/bfun-ai/bfun-ai.git","type":"git"},"_npmVersion":"11.6.1","description":"CLI, OpenClaw plugin, and agent skill for creating and trading B.fun meme tokens on BSC","directories":{},"_nodeVersion":"24.11.0","dependencies":{"viem":"^2.0.0","axios":"^1.7.0","dotenv":"^16.0.0","commander":"^12.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/bfun-ai_0.5.0_1774344306323_0.3231207328375372","host":"s3://npm-registry-packages-npm-production"}},"0.5.1":{"name":"@b-fun/bfun-ai","version":"0.5.1","keywords":["bfun","bsc","binance","meme","memecoin","token","cli","agent","skill","openclaw"],"author":{"name":"B.fun"},"license":"MIT","_id":"@b-fun/bfun-ai@0.5.1","maintainers":[{"name":"bfunbot","email":"info@b.fun"}],"homepage":"https://github.com/bfun-ai/bfun-ai#readme","bugs":{"url":"https://github.com/bfun-ai/bfun-ai/issues"},"bin":{"bfun":"bin/bfun.js"},"dist":{"shasum":"fec612d958f3c3266855a8efaba096181d134708","tarball":"https://registry.npmjs.org/@b-fun/bfun-ai/-/bfun-ai-0.5.1.tgz","fileCount":39,"integrity":"sha512-nDt7Uy6dYGnpXkAA++zaou5LqZq+zdlc1rU1Iv43Px2lAPZllD2FpyIlCIcwJ0Ym8zdaAVS49K+7EqFXxJ1fmA==","signatures":[{"sig":"MEQCICsbI6LFXCp/5R4S7eX1hbm/IQ97bivHdUbDIynT4EtuAiAcSqYes2NxD9rHIvyO0bmLyFBFnqOsPOQu3FDeoCSg1g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":148410},"type":"module","_npmUser":{"name":"bfunbot","email":"info@b.fun"},"openclaw":{"extensions":["./plugin.ts"]},"deprecated":"Use 0.5.2 — brand name normalization","repository":{"url":"git+https://github.com/bfun-ai/bfun-ai.git","type":"git"},"_npmVersion":"11.6.1","description":"CLI, OpenClaw plugin, and agent skill for creating and trading B.fun meme tokens on BSC","directories":{},"_nodeVersion":"24.11.0","dependencies":{"viem":"^2.0.0","axios":"^1.7.0","dotenv":"^16.0.0","commander":"^12.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/bfun-ai_0.5.1_1774349577341_0.3664155249797765","host":"s3://npm-registry-packages-npm-production"}},"0.5.2":{"name":"@b-fun/bfun-ai","version":"0.5.2","keywords":["bfun","bsc","binance","meme","memecoin","token","cli","agent","skill","openclaw"],"author":{"name":"B.Fun"},"license":"MIT","_id":"@b-fun/bfun-ai@0.5.2","maintainers":[{"name":"bfunbot","email":"info@b.fun"}],"homepage":"https://github.com/bfun-ai/bfun-ai#readme","bugs":{"url":"https://github.com/bfun-ai/bfun-ai/issues"},"bin":{"bfun":"bin/bfun.js"},"dist":{"shasum":"55258719812698649eaa3c8d26576954c6ddc0f8","tarball":"https://registry.npmjs.org/@b-fun/bfun-ai/-/bfun-ai-0.5.2.tgz","fileCount":39,"integrity":"sha512-SLU5FrvumS+1VMBSHvryKPFmvVve6RDJHrWfwtsSXmxOR6h3cJGNQoz9hwp1NbstVWC/0Z+Ji/4JoM2wHAVCQw==","signatures":[{"sig":"MEUCIE5orgEWbixkrLjevueDEMbEbsZLxQuY+HQlz5fHjIqUAiEA44jO4cecqTxaRwD9abNdrB4/C+KdiX01nPRh4f3M/wo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":148414},"type":"module","_npmUser":{"name":"bfunbot","email":"info@b.fun"},"openclaw":{"extensions":["./plugin.ts"]},"repository":{"url":"git+https://github.com/bfun-ai/bfun-ai.git","type":"git"},"_npmVersion":"11.6.1","description":"CLI, OpenClaw plugin, and agent skill for creating and trading B.Fun meme tokens on BSC","directories":{},"_nodeVersion":"24.11.0","dependencies":{"viem":"^2.0.0","axios":"^1.7.0","dotenv":"^16.0.0","commander":"^12.0.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/bfun-ai_0.5.2_1774360866139_0.7357158390626937","host":"s3://npm-registry-packages-npm-production"}},"0.5.3":{"name":"@b-fun/bfun-ai","version":"0.5.3","keywords":["bfun","bsc","binance","meme","memecoin","token","cli","agent","skill","openclaw"],"author":{"name":"B.Fun"},"license":"MIT","_id":"@b-fun/bfun-ai@0.5.3","maintainers":[{"name":"bfunbot","email":"info@b.fun"}],"homepage":"https://github.com/freeedevs/bfun-ai#readme","bugs":{"url":"https://github.com/freeedevs/bfun-ai/issues"},"bin":{"bfun":"bin/bfun.js"},"dist":{"shasum":"d70477d3f0601c167b7a07100b4abc551ab5cba1","tarball":"https://registry.npmjs.org/@b-fun/bfun-ai/-/bfun-ai-0.5.3.tgz","fileCount":39,"integrity":"sha512-gz+90X0bmJ9g86zxVLTz+x9NJP6tqdni96///XdisI2v/rzoRL0c2bFLrluKSZjGWAzlxoKt7hz8Fa9eoRVFbQ==","signatures":[{"sig":"MEUCIH+s74Fy9+7gVdDCUyPqJUuUAIkgEPRcZn7eAPVz+ARSAiEAgQ5wJLVTL1/xcriHQCP+CPzwW17ExhgEzP8tMaqVNAk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":149898},"type":"module","gitHead":"658e7770032f0b62f86cefc141a678ad385bdcd3","scripts":{"export:dev":"node scripts/export-release.mjs dev","export:main":"node scripts/export-release.mjs main"},"_npmUser":{"name":"bfunbot","email":"info@b.fun"},"openclaw":{"extensions":["./plugin.ts"]},"repository":{"url":"git+https://github.com/freeedevs/bfun-ai.git","type":"git"},"_npmVersion":"11.6.1","description":"CLI, OpenClaw plugin, and agent skill for creating and trading B.Fun meme tokens on BSC","directories":{},"_nodeVersion":"24.11.0","dependencies":{"viem":"2.47.4","axios":"1.13.6","dotenv":"16.6.1","commander":"12.1.0"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/bfun-ai_0.5.3_1775046576262_0.09983126016210964","host":"s3://npm-registry-packages-npm-production"}},"0.5.4":{"name":"@b-fun/bfun-ai","version":"0.5.4","description":"CLI, OpenClaw plugin, and agent skill for creating and trading B.Fun meme tokens on BSC","bin":{"bfun":"bin/bfun.js"},"repository":{"type":"git","url":"git+https://github.com/bfun-ai/bfun-ai.git"},"homepage":"https://github.com/bfun-ai/bfun-ai#readme","openclaw":{"extensions":["./plugin.ts"]},"type":"module","keywords":["bfun","bsc","binance","meme","memecoin","token","cli","agent","skill","openclaw"],"author":{"name":"B.Fun"},"license":"MIT","dependencies":{"axios":"1.13.6","commander":"12.1.0","dotenv":"16.6.1","viem":"2.47.4"},"bugs":{"url":"https://github.com/bfun-ai/bfun-ai/issues"},"_id":"@b-fun/bfun-ai@0.5.4","_nodeVersion":"24.11.0","_npmVersion":"9.3.1","dist":{"integrity":"sha512-K7P0txLK1YLsBr6wQtP+qOPL3eruUv7VLqyzRLiDsmvVaiREPDIz+EqRjnxjK2ojj76C1/4PKyJpw/yjkzqtXw==","shasum":"b021b2532fc1db157027d9c40fcdcc6cb477a555","tarball":"https://registry.npmjs.org/@b-fun/bfun-ai/-/bfun-ai-0.5.4.tgz","fileCount":39,"unpackedSize":149763,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIG8NkCU20ESF4KOwFD2btnetucx2yQOBiOMWezxylm5BAiAzL2CfGjYXwnvWag4kTXUSlEafQq81KYfiLfzoq1cFuA=="}]},"_npmUser":{"name":"bfunbot","email":"info@b.fun"},"directories":{},"maintainers":[{"name":"bfunbot","email":"info@b.fun"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bfun-ai_0.5.4_1775556790092_0.7429216498875935"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-24T06:20:40.653Z","modified":"2026-04-07T10:13:10.383Z","0.4.1":"2026-03-24T06:20:40.856Z","0.4.2":"2026-03-24T06:22:11.424Z","0.5.0":"2026-03-24T09:25:06.496Z","0.5.1":"2026-03-24T10:52:57.480Z","0.5.2":"2026-03-24T14:01:06.279Z","0.5.3":"2026-04-01T12:29:36.449Z","0.5.4":"2026-04-07T10:13:10.235Z"},"bugs":{"url":"https://github.com/bfun-ai/bfun-ai/issues"},"author":{"name":"B.Fun"},"license":"MIT","homepage":"https://github.com/bfun-ai/bfun-ai#readme","keywords":["bfun","bsc","binance","meme","memecoin","token","cli","agent","skill","openclaw"],"repository":{"type":"git","url":"git+https://github.com/bfun-ai/bfun-ai.git"},"description":"CLI, OpenClaw plugin, and agent skill for creating and trading B.Fun meme tokens on BSC","maintainers":[{"name":"bfunbot","email":"info@b.fun"}],"readme":"# @b-fun/bfun-ai\n\n> **⚠️ This tool operates on BSC mainnet with real funds.** Never share your private key or seed phrase. Use a dedicated low-balance wallet for trading. Always verify token addresses, amounts, and chain before executing write commands.\n\n`@b-fun/bfun-ai` provides B.Fun automation in a single npm package with three layers:\n\n- `bfun` CLI for direct terminal use\n- OpenClaw plugin for installing the bundled skill\n- `skills/bfun-integration` for agent-guided create, quote, and trade workflows\n\nThe CLI delegates to the existing Commander program in `src/index.js` and always loads `.env` from the current working directory before execution.\n\n**Requirements:** Node.js 18+ and npm 9+.\n\n## Install\n\n### Option 1: Global CLI\n\n```bash\nnpm install -g @b-fun/bfun-ai@latest\nbfun --help\n```\n\n### Option 2: Clone and run locally\n\n```bash\ngit clone https://github.com/bfun-ai/bfun-ai.git\ncd bfun-ai\nnpm install\nnpx bfun --help\n```\n\n### Option 3: OpenClaw plugin + skill\n\nSee [Install as OpenClaw Plugin](#install-as-openclaw-plugin) below.\n\n## Release Mapping\n\nThe source tree stays canonical and production-clean:\n\n- `main` exports `@b-fun/bfun-ai`\n- `dev` exports `bfun-agent-dev`\n\nThe source manifests and docs always keep the production identity. The dev/test package identity is introduced only when generating export artifacts with `npm run export:main` or `npm run export:dev`, which write to `dist/release/<channel>/` without mutating the source tree.\n\n## Environment Variables (without OpenClaw)\n\nWhen you **do not** use OpenClaw, the CLI reads `PRIVATE_KEY` and `BSC_RPC_URL` from the process environment. Set them in one of these ways:\n\n### Option 1: `.env` file in the working directory\n\nCreate a file named `.env` in the directory where you run `bfun` commands:\n\n```bash\n# .env (do not commit this file)\nPRIVATE_KEY=your_hex_private_key_with_or_without_0x_prefix\nBSC_RPC_URL=https://bsc-dataseed.binance.org\n```\n\nThe CLI automatically loads `.env` from the current working directory via dotenv.\n\n### Option 2: export in the shell\n\n```bash\nexport PRIVATE_KEY=your_hex_private_key\nexport BSC_RPC_URL=https://bsc-dataseed.binance.org\nbfun create --name \"My Token\" --symbol \"MTK\" --image ./logo.png --description \"Example\" --pair ETH\n```\n\n- **PRIVATE_KEY**: Required for any command that signs or sends a transaction (`create`, `buy`, `sell`, `send`, `8004-register`). Hex string; `0x` prefix optional.\n- **BSC_RPC_URL**: Optional. BSC RPC endpoint; if unset, the CLI uses a default public BSC RPC.\n- **Security**: Do not commit `.env` or share your private key. Add `.env` to `.gitignore` if you use a `.env` file.\n\n## Install as OpenClaw Plugin\n\nThis repo is an OpenClaw-compatible plugin. Install so the skill is loaded and `PRIVATE_KEY` / `BSC_RPC_URL` are only injected for this skill (via `skills.entries`):\n\n```bash\nopenclaw plugins install @b-fun/bfun-ai\n```\n\nThen in `~/.openclaw/openclaw.json` set:\n\n```json\n{\n  \"skills\": {\n    \"entries\": {\n      \"bfun-ai\": {\n        \"enabled\": true,\n        \"env\": {\n          \"PRIVATE_KEY\": \"0x...\",\n          \"BSC_RPC_URL\": \"https://bsc-dataseed.binance.org\"\n        }\n      }\n    }\n  }\n}\n```\n\nAfter modifying `~/.openclaw/openclaw.json`, restart OpenClaw for changes to take effect.\n\nSee [skills/bfun-integration/SKILL.md](skills/bfun-integration/SKILL.md) for the full OpenClaw config section and environment variable details.\n\n## Quick Start\n\n### Read-only commands\n\n```bash\nbfun config\nbfun verify\nbfun token-list --limit 5\nbfun rankings now_trending --limit 10\nbfun token-info 0xTokenAddress\nbfun token-get 0xTokenAddress\nbfun quote-buy 0xTokenAddress 0.01\nbfun quote-sell 0xTokenAddress 1000\nbfun tax-info 0xTokenAddress\n```\n\n### Write commands\n\n```bash\nbfun buy 0xTokenAddress 0.01 --slippage 500\nbfun sell 0xTokenAddress 1000 --slippage 500\nbfun send 0xRecipient 0.01\nbfun send 0xRecipient 100 --token 0xTokenAddress\n```\n\n### ERC-8004 Identity NFT\n\n```bash\n# Query balance (read-only, no PRIVATE_KEY needed if address provided)\nbfun 8004-balance 0xWalletAddress\n\n# Register (mint) an identity NFT (requires PRIVATE_KEY)\nbfun 8004-register \"MyAgent\" --image \"https://example.com/logo.png\" --description \"My trading agent\"\n```\n\nTokens created by wallets holding an ERC-8004 Identity NFT are marked as **Agent Created** on-chain. Default contract: `0x8004A169FB4a3325136EB29fA0ceB6D2e539a432` (BSC mainnet).\n\n### Create a token\n\n```bash\nbfun create \\\n  --name \"My Token\" \\\n  --symbol \"MTK\" \\\n  --image ./logo.png \\\n  --description \"Example token\" \\\n  --pair ETH\n```\n\nThe `create` command also supports advanced vesting, tax, vault, collateral-pair, and optional first-buy parameters. See [skills/bfun-integration/references/create-flow.md](skills/bfun-integration/references/create-flow.md) for the full parameter model.\n\n## Agent Usage\n\nWhen installed as an OpenClaw plugin, the bundled skill guides the agent to:\n\n1. Inspect market state with `token-list`, `rankings`, `token-info`, and `token-get`\n2. Quote trades before execution with `quote-buy` or `quote-sell`\n3. Confirm risk acceptance before any write operation\n4. Execute `buy`, `sell`, `send`, or `create` only through the CLI\n\nPrimary skill file:\n\n- [skills/bfun-integration/SKILL.md](skills/bfun-integration/SKILL.md)\n\nReference material:\n\n- [skills/bfun-integration/references/create-flow.md](skills/bfun-integration/references/create-flow.md)\n- [skills/bfun-integration/references/trade-flow.md](skills/bfun-integration/references/trade-flow.md)\n- [skills/bfun-integration/references/token-phases.md](skills/bfun-integration/references/token-phases.md)\n- [skills/bfun-integration/references/contract-addresses.md](skills/bfun-integration/references/contract-addresses.md)\n- [skills/bfun-integration/references/errors.md](skills/bfun-integration/references/errors.md)\n\n## Troubleshooting\n\n| Problem | Solution |\n|---------|----------|\n| `PRIVATE_KEY is not set` | Set `PRIVATE_KEY` in `.env` or export it in the shell |\n| RPC connection timeout | Set `BSC_RPC_URL` to a different BSC RPC endpoint |\n| `TransfersRestricted` on `send` | Token is still in bonding curve phase; use `sell` instead |\n| `InsufficientFirstBuyFee` on `create` | First buy amount is below the minimum; check the error message for the required amount |\n| `graduated` phase — cannot trade | Token is migrating to DEX; wait and re-check with `bfun token-info` |\n| Slippage exceeded | Increase `--slippage` (in basis points, e.g. `500` = 5%) |\n\nFor a full list of error codes and solutions, see [skills/bfun-integration/references/errors.md](skills/bfun-integration/references/errors.md).\n\n## Command Summary\n\nRead-only:\n\n- `bfun config`\n- `bfun verify`\n- `bfun token-info <tokenAddress>`\n- `bfun token-get <tokenAddress>`\n- `bfun token-list [--sort <value>] [--kw <keyword>] [--offset <n>] [--limit <n>]`\n- `bfun rankings <orderBy> [--limit <n>]`\n- `bfun quote-buy <tokenAddress> <bnbAmount> [--slippage <bps>]`\n- `bfun quote-sell <tokenAddress> <tokenAmount> [--slippage <bps>]`\n- `bfun tax-info <tokenAddress> [--user <address>]`\n- `bfun events [fromBlock] [--toBlock <block>] [--chunk <n>]`\n\nWrite:\n\n- `bfun buy <tokenAddress> <bnbAmount> [--slippage <bps>]`\n- `bfun sell <tokenAddress> <tokenAmount> [--slippage <bps>]`\n- `bfun send <toAddress> <amount> [--token <tokenAddress>]`\n- `bfun create ...`\n- `bfun 8004-register <name> [--image <url>] [--description <text>]`\n\nERC-8004 (read-only):\n\n- `bfun 8004-balance [address]`\n\nAll 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\": [...] }`.\n","readmeFilename":"README.md"}