GLAM CLI is under active development and is subject to frequent change. It’s highly recommended to use the latest version. If you encounter any issue, please submit it on GitHub

Getting Started

1

Install

npm install -g @glamsystems/glam-cli

This will install the CLI and make it available in your terminal as glam-cli.

2

Configure

The CLI expects a configuration file at ~/.config/glam/config.json. The file should contain the following content:

{
  "cluster": "",
  "json_rpc_url": "",
  "tx_rpc_url": "",
  "keypair_path": "",
  "priority_fee": {
    "micro_lamports": 0,
    "level": "",
    "helius_api_key": ""
  },
  "glam_state": ""
}

At minimum, you need to provide cluster, json_rpc_url, and keypair_path:

{
  "cluster": "mainnet-beta",
  "json_rpc_url": "https://api.mainnet-beta.solana.com",
  "keypair_path": "/path/to/your/keypair.json",
}
3

Run

Check the version of the CLI:

glam-cli -V

Show help:

glam-cli -h

Docker

1

Pull the Docker Image

A pre-built docker image is available on Github. To pull the latest image, run:

docker pull ghcr.io/glamsystems/glam-cli:latest
2

Run the CLI inside Docker Container

The docker image doesn’t come with a configuration file or a keypair. Instead, you’ll need to provide them to the container by mounting a volume from a host directory to the container’s /workspace directory.

Create a local directory (for example, $HOME/.glam-cli-docker) and place both the configuration file and keypair into it. Assuming your keypair filename is keypair.json, the directory and the config file should look like the following:

$ ls $HOME/.glam-cli-docker
config.json  keypair.json

Run the following command to start the container and get the CLI ready to use:

docker run -it --rm \
  -v $HOME/.glam-cli-docker:/workspace \
  ghcr.io/glamsystems/glam-cli:latest bash

Now that you’re inside the container, you can use the CLI:

root@id:/mnt/glam# node dist/cli/main.js env

Wallet connected: [redacted]
RPC endpoint: [redacted]
Priority fee: {
  level: 'Min',
  helius_api_key: '[redacted]'
}

Configuration

The GLAM CLI expects a configuration file at the following path:

  • macOS / Linux: ~/.config/glam/config.json
  • Windows: %USERPROFILE%\.config\glam\config.json

This file defines how the CLI connects to Solana, sets transaction fees, and points to the appropriate GLAM state.

Use this template if you have a Helius account and want dynamic priority fee management:

{
  "cluster": "mainnet-beta",
  "json_rpc_url": "https://your-preferred-rpc-provider.com",
  "keypair_path": "/path/to/your/keypair.json",
  "priority_fee": {
    "level": "High",
    "helius_api_key": "YOUR_HELIUS_API_KEY"
  },
  "glam_state": "YOUR_GLAM_STATE_PUBKEY"
}

Here’s a quick explanation of each field:

  • cluster: Value must be one of mainnet-betadevnet, or localnet.
  • json_rpc_url: The URL of your preferred Solana JSON RPC endpoint.
  • tx_rpc_url: Optional. If not set it defaults to json_rpc_url. Use this to specify a separate RPC endpoint you want to use for landing transactions.
  • keypair_path: Path to your keypair JSON file.
  • priority_fee: provided, level and helius_api_key will be ignored.
    • level: Optional (defaults to Min). Only applied if cluster is mainnet-beta. Other options are Min, LowMediumHighVeryHighUnsafeMaxDefault (more info can be found here).
    • helius_api_key: Optional. Only applied if cluster is mainnet-beta. If not provided level will be ignored. The API key is needed to fetch the priority fee estimate from Helius.
  • glam_state: Optional. If you want to set a default active GLAM state, you can do so here. Alternatively, you can use the set command to set the active GLAM state later on.

Static Priority Fee

Use this version if you don’t want to use Helius, or prefer a fixed fee model:

{
  "cluster": "mainnet-beta",
  "json_rpc_url": "https://your-preferred-rpc-provider.com",
  "keypair_path": "/path/to/your/keypair.json",
  "priority_fee": {
    "micro_lamports": 500000
  },
  "glam_state": "YOUR_GLAM_STATE_PUBKEY"
}
  • micro_lamports: Specifies a fixed transaction fee in micro-lamports
    (1 lamport = 1,000,000 micro-lamports)
    This bypasses the need for Helius.

Use this method in stable environments where dynamic fee adjustment is unnecessary or unavailable.