CLI for the Bags.fm API. Launch tokens, swap, claim fees, manage wallets — all from your terminal.
Built for use by AI coding agents (Claude Code, etc.) via the included Claude Code Skill, or by humans directly.
git clone https://github.com/glittercowboy/cli-bags.git
cd cli-bags
npm install
npm run build
npm linkThis installs bags as a global command.
bags config initYou'll be prompted for:
- API key — get one at dev.bags.fm
- RPC URL — Solana RPC endpoint (default:
https://api.mainnet-beta.solana.com) - Commitment —
confirmed(recommended),finalized, orprocessed - Private key — base58 Solana keypair (needed for signing transactions)
Config is stored at ~/.bags/config.json with 0600 permissions.
This repo includes a Claude Code Skill at SKILL/bags-fm/SKILL.md that teaches AI agents how to operate the CLI.
What the skill provides:
- Complete command reference with every flag and option
- Domain knowledge (how Bags.fm works, token lifecycle, fee sharing mechanics)
- Common workflows (buy, sell, launch, claim fees)
- Safety rules (dry-run first, check balances, confirm before spending)
- Unit conversions (SOL to lamports)
- Known quirks and troubleshooting
To use with Claude Code, copy the skill into your Claude Code skills directory:
cp -r SKILL/bags-fm ~/.claude/skills/bags-fmThen any Claude Code session can operate the Bags CLI autonomously — "launch a token", "buy 0.1 SOL of GSD", "claim my fees", etc.
bags token leaderboard # Top tokens by lifetime fees
bags token feed # Browse recent launches
bags token fees --mint <addr> # Lifetime fees for a token
bags token creators --mint <addr> # List creators and fee claimers
bags token info --name "X" --symbol "X" --description "X" --image ./logo.png
bags token launch --name "X" --symbol "X" --description "X" --image ./logo.png \
--claimers '[{"wallet":"...","bps":10000}]' --initial-buy 0.1bags trade quote --in SOL --out <mint> --amount 100000000 # Get quote (0.1 SOL)
bags trade swap --in SOL --out <mint> --amount 100000000 # Execute swap
bags trade swap --in <mint> --out SOL --amount <n> # Sell tokensUse SOL as shorthand for wrapped SOL. Amounts are in lamports (1 SOL = 1,000,000,000).
bags claim positions # List claimable fees
bags claim execute # Claim all fees
bags claim stats --mint <addr> # Per-creator claim stats
bags claim events --mint <addr> # Claim historybags fee-share list # Tokens where you're admin
bags fee-share lookup --username X --provider twitter
bags fee-share create --mint <addr> --claimers '[{"wallet":"...","bps":5000}]'
bags fee-share update --mint <addr> --claimers '<json>'
bags fee-share transfer --mint <addr> --new-admin <addr>bags partner create # Create partner config
bags partner stats # Claimed/unclaimed fees
bags partner claim # Claim partner feesbags pool leaderboard # Top tokens by fees
bags pool list [--migrated] # All pools
bags pool info --mint <addr> # Pool details for a tokenbags dex check --mint <addr> # Check order availability
bags dex order --mint <addr> --description "X" --icon-url <url> --header-url <url>
bags dex pay --order-uuid <uuid> --signature <sig>bags incorporate start-payment # Initiate payment
bags incorporate submit --details '<json>'
bags incorporate start --token <addr>
bags incorporate details --token <addr>
bags incorporate listbags tx send --tx <base58> # Send signed transaction
bags tx bundle --txs <base58,...> # Send Jito bundle
bags tx bundle-status --ids <id,...> # Check bundle status
bags tx jito-fees # Current tip fee levelsRequires Moltbook account:
bags auth init --username <moltbook>
bags auth login --identifier <id> --secret <s> --post-id <id>
bags keys list
bags keys create --name <name>
bags wallet list
bags wallet export --address <addr>bags config init # Interactive setup
bags config show # Show current config
bags config set api-key <key> # Set API key
bags config set rpc-url <url> # Set RPC URL
bags config set private-key <base58> # Set signing key
bags config set commitment confirmed # Set commitment level
bags ping # Health check--json Output raw JSON (all commands)
--profile <n> Use a named config profile
--dry-run Sign but don't submit (transaction commands)
bags config set active-profile trading
bags --profile trading trade swap ...| Amount | Lamports |
|---|---|
| 0.001 SOL | 1,000,000 |
| 0.01 SOL | 10,000,000 |
| 0.1 SOL | 100,000,000 |
| 1 SOL | 1,000,000,000 |
1,000 requests per hour per account (across all API keys).
MIT