Skip to main content
The Bags CLI (@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
Verify your Node version:

Installation

Install globally via npm:
Or run directly without installing:
After installing globally, the 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:
The wizard prompts you for:
  1. Solana RPC URL — defaults to https://api.mainnet-beta.solana.com if left blank
  2. Private key — accepts a base58-encoded key or a JSON integer array
  3. Auth modewallet (default) or manual
  4. API key — only when using manual mode
  5. MFA code — only in wallet mode if your account has MFA enabled
You can also pass everything as flags for non-interactive use:
Manual mode example:
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:
Or import an existing key:
The keypair is saved to ~/.config/bags/keypair.json.

2. Authenticate

Log in using either auth mode:
Manual mode example:
If your account has MFA enabled, you’ll be prompted for the code in 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/:
Never share your keypair.json or credentials.json. These files contain secrets that grant full access to your wallet and API key.

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:
Uninstall the package:

Next Steps