> ## 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.

# General Commands

## Environment

### View Environment Setup

Display the current CLI configuration including connected wallet, RPC endpoint, and active vault.

```bash theme={null}
glam-cli env
```

***

## Vault Management

### List Vaults

List GLAM vaults accessible to the connected wallet.

* `--owner-only`, `-o`: Only show vaults owned by the connected wallet
* `--all`, `-a`: Show all GLAM vaults
* `--type`, `-t`: Filter by type (`vault` or `tokenizedVault`)

```bash theme={null}
glam-cli vault list [--owner-only] [--all] [--type <type>]
```

### Set Active Vault

Set the active GLAM vault for subsequent CLI operations. Saves the vault state to the config file.

```bash theme={null}
glam-cli vault set <state>
```

### View Vault Details

View a GLAM vault by its state pubkey.

* `--compact`, `-c`: Output as compact JSON
* `state`: If not provided, the current active vault is used

```bash theme={null}
glam-cli vault view [--compact] [state]
```

### Create a Vault

Create a new GLAM vault from a JSON template file.

* See the [templates directory](https://github.com/glamsystems/glam/tree/main/cli/templates) for available templates

```bash theme={null}
glam-cli vault create <path-to-template.json>
```

### Close a Vault

Close a GLAM vault. Only the owner can close a vault. Tokenized vaults cannot be closed if mint supply is greater than 0.

* `state`: If not provided, the current active vault is used
* `--yes`, `-y`: Skip confirmation prompt

```bash theme={null}
glam-cli vault close [state] [--yes]
```

### Update Owner

Transfer vault ownership to a new owner.

* `--name`, `-n`: Optionally set a new portfolio manager name
* `--yes`, `-y`: Skip confirmation prompt

```bash theme={null}
glam-cli vault update-owner <new-owner> [--name <name>] [--yes]
```

### Enable/Disable Vault

Enable a GLAM vault.

```bash theme={null}
glam-cli vault enable [--yes]
```

Disable a GLAM vault.

```bash theme={null}
glam-cli vault disable [--yes]
```

### Extend State Account

Extend the GLAM state account by additional bytes. Useful when the state account needs more space.

```bash theme={null}
glam-cli vault extend <bytes> [--yes]
```

***

## Asset Management

### View Balances

Get token balances for the vault.

* `--all`, `-a`: Show all assets including token accounts with 0 balance

```bash theme={null}
glam-cli vault token-balances [--all]
```

### View Holdings

Get all vault holdings including token balances and positions across integrated protocols.

```bash theme={null}
glam-cli vault holdings
```

### Close Token Accounts

Close vault token accounts by specifying mint addresses, or use `--empty` to close all zero-balance token accounts.

* `mints`: One or more mint addresses of token accounts to close

```bash theme={null}
glam-cli vault close-token-accounts <mints...> [--yes]
glam-cli vault close-token-accounts --empty [--yes]
```

<Info>
  Token programs prevent closing token accounts with non-zero balances.
</Info>

### List Asset Allowlist

List the vault's asset allowlist and corresponding token accounts.

```bash theme={null}
glam-cli vault list-assets
```

### Add Asset to Allowlist

Add an asset to the vault's allowlist.

```bash theme={null}
glam-cli vault allowlist-asset <asset> [--yes]
```

### Remove Asset from Allowlist

Remove an asset from the vault's allowlist.

```bash theme={null}
glam-cli vault remove-asset <asset> [--yes]
```

***

## SOL Wrapping

### Wrap SOL

Wrap SOL into wSOL.

```bash theme={null}
glam-cli vault wrap <amount> [--yes]
```

### Unwrap wSOL

Unwrap all wSOL back to SOL.

```bash theme={null}
glam-cli vault unwrap [--yes]
```

***

## Vault Templates

When creating a vault with `glam-cli vault create <template>`, the template is a JSON file that defines the vault configuration. Templates are available in the [CLI templates directory](https://github.com/glamsystems/glam/tree/main/cli/templates).

### Template Structure

A vault template has two top-level sections:

```json theme={null}
{
  "state": { /* StateModel fields */ },
  "mint": { /* MintModel fields (tokenized vaults only) */ }
}
```

### StateModel Fields

<table>
  <thead>
    <tr>
      <th style={{width: "30%"}}>Field</th>
      <th style={{width: "30%"}}>Type</th>
      <th style={{width: "40%"}}>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>`accountType`</td>
      <td>`"vault"` | `"tokenizedVault"` | `"singleAssetVault"`</td>
      <td>Vault type</td>
    </tr>

    <tr>
      <td>`name`</td>
      <td>`string`</td>
      <td>Vault display name</td>
    </tr>

    <tr>
      <td>`enabled`</td>
      <td>`boolean`</td>
      <td>Whether the vault is active</td>
    </tr>

    <tr>
      <td>`baseAssetMint`</td>
      <td>`string`</td>
      <td>Base asset mint address</td>
    </tr>

    <tr>
      <td>`assets`</td>
      <td>`string[]`</td>
      <td>Allowlisted asset mint addresses</td>
    </tr>

    <tr>
      <td>`uri`</td>
      <td>`string`</td>
      <td>Vault metadata URI</td>
    </tr>

    <tr>
      <td>`portfolioManagerName`</td>
      <td>`string`</td>
      <td>Display name of the portfolio manager</td>
    </tr>

    <tr>
      <td>`borrowable`</td>
      <td>`string[]`</td>
      <td>Assets allowed for borrowing</td>
    </tr>

    <tr>
      <td>`reduceOnly`</td>
      <td>`boolean`</td>
      <td>If true, vault can only reduce positions</td>
    </tr>

    <tr>
      <td>`anyLst`</td>
      <td>`boolean`</td>
      <td>If true, any LST is accepted for staking</td>
    </tr>

    <tr>
      <td>`timelockDuration`</td>
      <td>`number`</td>
      <td>Timelock duration in seconds</td>
    </tr>
  </tbody>
</table>

### MintModel Fields (Tokenized Vaults)

<table>
  <thead>
    <tr>
      <th style={{width: "32%"}}>Field</th>
      <th style={{width: "28%"}}>Type</th>
      <th style={{width: "40%"}}>Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>`name`</td>
      <td>`string`</td>
      <td>Token metadata name</td>
    </tr>

    <tr>
      <td>`symbol`</td>
      <td>`string`</td>
      <td>Token metadata symbol (max 32 chars)</td>
    </tr>

    <tr>
      <td>`baseAssetMint`</td>
      <td>`string`</td>
      <td>Base asset mint address</td>
    </tr>

    <tr>
      <td>`maxCap`</td>
      <td>`number`</td>
      <td>Maximum vault capacity in base units</td>
    </tr>

    <tr>
      <td>`minSubscription`</td>
      <td>`number`</td>
      <td>Minimum subscription amount in base units</td>
    </tr>

    <tr>
      <td>`minRedemption`</td>
      <td>`number`</td>
      <td>Minimum redemption amount in base units</td>
    </tr>

    <tr>
      <td>`lockupPeriod`</td>
      <td>`number`</td>
      <td>Lockup period for new shares in seconds</td>
    </tr>

    <tr>
      <td>`defaultAccountStateFrozen`</td>
      <td>`boolean`</td>
      <td>If true, new token accounts are frozen by default</td>
    </tr>

    <tr>
      <td>`feeStructure`</td>
      <td>`object`</td>
      <td>Fee configuration (see below)</td>
    </tr>

    <tr>
      <td>`notifyAndSettle`</td>
      <td>`object`</td>
      <td>Notice and settlement periods</td>
    </tr>

    <tr>
      <td>`allowlist`</td>
      <td>`string[]`</td>
      <td>Allowlisted subscriber addresses</td>
    </tr>

    <tr>
      <td>`blocklist`</td>
      <td>`string[]`</td>
      <td>Blocklisted subscriber addresses</td>
    </tr>
  </tbody>
</table>

### Example: Vault

```json theme={null}
{
  "state": {
    "accountType": "vault",
    "name": "My Treasury",
    "enabled": true,
    "baseAssetMint": "So11111111111111111111111111111111111111112",
    "assets": ["So11111111111111111111111111111111111111112"]
  }
}
```

### Example: Single Asset Vault

```json theme={null}
{
  "state": {
    "accountType": "singleAssetVault",
    "name": "USDC Vault",
    "enabled": true,
    "baseAssetMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    "assets": ["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"]
  }
}
```
