> ## Documentation Index
> Fetch the complete documentation index at: https://docs.glam.systems/llms.txt
> Use this file to discover all available pages before exploring further.

# GLAM CLI

> Operate with the GLAM Command Line Interface

The GLAM CLI provides a powerful command-line interface for interacting with the GLAM Protocol.

## Getting Started

<Steps>
  <Step title="Install">
    ```bash theme={null}
    npm install -g @glamsystems/glam-cli
    ```

    This installs the CLI and makes it available in the shell as `glam-cli`.
  </Step>

  <Step title="Configure">
    The GLAM CLI by default expects a configuration file at the following path:

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

    You can also specify a different path to the configuration using the `-C` or `--config` flag:

    ```bash theme={null}
    glam-cli -C /path/to/config.json [options] [command]
    ```

    At minimum, you need to provide `cluster`, `json_rpc_url`, and `keypair_path` in the configuration file (full list of options can be found [here](#configuration-options)):

    ```json theme={null}
    {
      "cluster": "mainnet-beta",
      "json_rpc_url": "https://api.mainnet-beta.solana.com",
      "keypair_path": "/path/to/your/keypair.json"
    }
    ```
  </Step>

  <Step title="Run">
    Check the version of the CLI:

    ```
    glam-cli -V
    ```

    Show help:

    ```
    glam-cli -h
    ```
  </Step>
</Steps>

## Commands Overview

| Command         | Description                            |
| --------------- | -------------------------------------- |
| `env`           | Display current environment setup      |
| `vault`         | Create, close, manage vaults           |
| `invest`        | Investor operations (subscribe/redeem) |
| `manage`        | Manager operations (fulfill, fees)     |
| `delegate`      | Manage vault delegates and permissions |
| `integration`   | Manage integration programs            |
| `jupiter`       | Jupiter swap                           |
| `kamino-lend`   | Kamino lending integration             |
| `kamino-vaults` | Kamino vaults integration              |
| `kamino-farms`  | Kamino farms integration               |
| `cctp`          | Cross-chain token bridge               |

## Configuration Options

* `cluster`: Value must be one of `mainnet-beta`, `devnet`, or `localnet`.
* `json_rpc_url`: The URL of your preferred Solana JSON RPC endpoint.
* `keypair_path`: Path to your keypair JSON file.
* `tx_rpc_url`: Optional. If not set it defaults to `json_rpc_url`. Use this to specify a separate RPC endpoint for landing transactions.
* `jupiter_api_key`: Required if Jupiter swap is used. Obtain an API key from the [Jupiter Developer Portal](https://portal.jup.ag/).
* `websocket_disabled`: Optional. If set to `true` the CLI will not attempt to use WebSocket methods. This can be useful if you are using a RPC provider that does not support WebSocket.
* `priority_fee`:
  * `micro_lamports`: Optional. If 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`, `Low`, `Medium`, `High`, `VeryHigh`, `UnsafeMax`, `Default` (more info can be found [here](https://docs.helius.dev/solana-apis/priority-fee-api)).
  * `helius_api_key`: Optional. Only applied if cluster is `mainnet-beta`. If not provided `level` will be ignored. The API key is needed to call Helius priority fee endpoint.
* `glam_staging`: Optional. If set to `true` the CLI will use GLAM mainnet staging programs.
* `glam_state`: Optional. Sets the default active vault state. You can also set this later using the `set` command.

### Dynamic Priority Fee

Use this template if you have a Helius API key and want to use dynamic priority fee:

```json theme={null}
{
  "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"
  },
}
```

The SDK will call Helius [Priority Fee API](https://www.helius.dev/docs/priority-fee-api) to get priority fee estimate in micro-lamports. The actual priority fee of a transaction is calculated as `micro_lamports * CU_consumed`.

### Static Priority Fee

If a fixed priority fee amount is preferred:

```json theme={null}
{
  "cluster": "mainnet-beta",
  "json_rpc_url": "https://your-preferred-rpc-provider.com",
  "keypair_path": "/path/to/your/keypair.json",
  "priority_fee": {
    "micro_lamports": 500000
  },
}
```

* `micro_lamports`: Specifies a fixed priority fee per CU in micro-lamports (1,000,000 micro-lamports = 1 lamport). Actual priority fee is calculated as `micro_lamports * CU_consumed`.
* Use this method when dynamic fee adjustment is unnecessary or unavailable.
