@bagsfm/bags-cli) is a terminal tool that wraps the Bags API and SDK into simple commands. It lets you trade tokens, launch tokens, claim fees, manage fee share configs, and more all without writing code.
Requirements
- Node.js 18 or later
Installation
Install globally via npm:bags binary is available in your terminal:
Quick Start with bags setup
The fastest way to get going is the first-run wizard. It configures your RPC endpoint, imports your wallet, and authenticates in a single command:
- Solana RPC URL — defaults to
https://api.mainnet-beta.solana.comif left blank - Private key — accepts a base58-encoded key or a JSON integer array
- Auth mode —
wallet(default) ormanual - API key — only when using
manualmode - MFA code — only in
walletmode if your account has MFA enabled
In non-interactive environments,
manual mode fails fast if no API key is provided (via --api-key or --input-json).
Once setup completes, you’ll see a summary with your wallet address, masked API key, auth mode, and RPC URL.
Manual Setup (Step by Step)
If you prefer to configure each piece individually:1. Create or Import a Wallet
Generate a new Solana keypair:~/.config/bags/keypair.json.
2. Authenticate
Log in using either auth mode:wallet mode.
3. Configure Settings
Set your preferred RPC endpoint and commitment level:4. Verify
Check that everything is working:Configuration Files
All CLI state lives under~/.config/bags/:
Global Options
Every command supports these global flags:
The
--input-json flag is useful for scripting. Explicit CLI flags take precedence over values in the JSON object:
Output Modes
Control how the CLI formats its output:
View your current settings at any time:
Uninstalling
Remove credentials and keypair:Next Steps
- Browse the full CLI Command Reference to see every available command.
- Follow any of the How-to Guides each guide includes CLI alternatives alongside the SDK examples.
