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

# CLI

> Install and use the Squads CLI to interact with Squads Protocol from the command line

Use the Squads CLI to create multisigs, manage configuration, vote on proposals, and execute transactions from the command line.

## Installation

Install with Cargo (requires [Rust](https://www.rust-lang.org/tools/install)):

```bash theme={null}
cargo install squads-multisig-cli
```

Verify the installation:

```bash theme={null}
squads-multisig-cli --help
```

## Wallet support

The Squads CLI supports the same wallet types as the Solana CLI.

<Tabs>
  <Tab title="File system wallet">
    Specify the keypair path:

    ```bash theme={null}
    squads-multisig-cli example-command --keypair /path/to/keypair.json
    ```
  </Tab>

  <Tab title="Ledger">
    Specify the Ledger device URL:

    ```bash theme={null}
    # Default derivation path
    squads-multisig-cli example-command --keypair usb://ledger

    # Custom derivation path
    squads-multisig-cli example-command --keypair usb://ledger/BsNsvfXqQTtJnagwFWdBS7FBXgnsK8VZ5CmuznN85swK?key=0/0
    ```

    Read more about Ledger derivation paths [here](https://docs.anza.xyz/cli/wallets/hardware/ledger).
  </Tab>
</Tabs>

## Global parameters

These are available on every command. Optional unless noted.

| Parameter | Description |
| - | - |
| `--rpc-url` | Solana RPC endpoint. Defaults to mainnet |
| `--program-id` | Multisig program ID. Defaults to the standard Squads V4 program |
| `--keypair` | Path to your keypair file **(required)** |

## Commands

### multisig-create

Create a new multisig with initial members and a threshold.

```bash theme={null}
multisig-create --keypair <KEYPAIR_PATH> --members <MEMBER_LIST> --threshold <THRESHOLD> [--config-authority <CONFIG_AUTHORITY>] [--rent-collector <RENT_COLLECTOR>]
```

| Parameter | Required | Description |
| - | - | - |
| `--members` | Yes | List of members' public keys with permissions |
| `--threshold` | Yes | Number of approvals required to execute |
| `--config-authority` | No | Address given unilateral control over the multisig configuration (members, threshold). Setting it makes the multisig controlled instead of autonomous |
| `--rent-collector` | No | Address that receives the rent reclaimed from closed transaction accounts (executed, rejected, cancelled, or stale). If omitted, rent reclamation is turned off |

**Permission values:**

| Permission | Value |
| - | - |
| Proposer | 1 |
| Voter | 2 |
| Executor | 4 |
| All (Proposer + Voter + Executor) | 7 |

**Examples:**

```bash theme={null}
# Create multisig with two members
multisig-create --keypair /path/to/keypair.json \
  --members "Member1PubKey,Permission1 Member2PubKey,Permission2" \
  --threshold 2

# Create multisig with Config Authority
multisig-create --keypair /path/to/keypair.json \
  --config-authority <CONFIG_AUTHORITY_PUBKEY> \
  --members "Member1PubKey,Permission1 Member2PubKey,Permission2" \
  --threshold 1
```

### config-transaction-create

Create a config change transaction for your multisig.

```bash theme={null}
config-transaction-create --keypair <KEYPAIR_PATH> --multisig-pubkey <MULTISIG_PUBLIC_KEY> --action <ACTION> [--memo <MEMO>]
```

| Parameter | Required | Description |
| - | - | - |
| `--multisig-pubkey` | Yes | Public key of the multisig account |
| `--action` | Yes | Configuration action to execute |
| `--memo` | No | Memo for the transaction |

**Supported actions:**

<AccordionGroup>
  <Accordion title="AddMember">
    ```bash theme={null}
    config-transaction-create --keypair /path/to/keypair.json \
      --multisig-pubkey <MULTISIG_PUBLIC_KEY> \
      --action "AddMember <NEW_MEMBER_PUBLIC_KEY> <PERMISSIONS>"
    ```
  </Accordion>

  <Accordion title="RemoveMember">
    ```bash theme={null}
    config-transaction-create --keypair /path/to/keypair.json \
      --multisig-pubkey <MULTISIG_PUBLIC_KEY> \
      --action "RemoveMember <MEMBER_PUBLIC_KEY>"
    ```
  </Accordion>

  <Accordion title="ChangeThreshold">
    ```bash theme={null}
    config-transaction-create --keypair /path/to/keypair.json \
      --multisig-pubkey <MULTISIG_PUBLIC_KEY> \
      --action "ChangeThreshold <NEW_THRESHOLD>"
    ```
  </Accordion>

  <Accordion title="SetTimeLock">
    ```bash theme={null}
    config-transaction-create --keypair /path/to/keypair.json \
      --multisig-pubkey <MULTISIG_PUBLIC_KEY> \
      --action "SetTimeLock <TIME_LOCK_VALUE>"
    ```
  </Accordion>

  <Accordion title="AddSpendingLimit">
    ```bash theme={null}
    config-transaction-create --keypair /path/to/keypair.json \
      --multisig-pubkey <MULTISIG_PUBLIC_KEY> \
      --action "AddSpendingLimit <CREATE_KEY> <VAULT_INDEX> <MINT> <AMOUNT> <PERIOD> <MEMBERS> <DESTINATIONS>"
    ```

    `<PERIOD>` must be one of `OneTime`, `Day`, `Week`, or `Month` (case-sensitive). `<MEMBERS>` and `<DESTINATIONS>` are comma-separated lists of public keys.
  </Accordion>

  <Accordion title="RemoveSpendingLimit">
    ```bash theme={null}
    config-transaction-create --keypair /path/to/keypair.json \
      --multisig-pubkey <MULTISIG_PUBLIC_KEY> \
      --action "RemoveSpendingLimit <SPENDING_LIMIT_PUBKEY>"
    ```
  </Accordion>

  <Accordion title="SetRentCollector">
    ```bash theme={null}
    config-transaction-create --keypair /path/to/keypair.json \
      --multisig-pubkey <MULTISIG_PUBLIC_KEY> \
      --action "SetRentCollector <NEW_RENT_COLLECTOR_PUBKEY>"
    ```
  </Accordion>
</AccordionGroup>

### config-transaction-execute

Execute an approved config change transaction.

```bash theme={null}
config-transaction-execute --keypair <KEYPAIR_PATH> --multisig-pubkey <MULTISIG_PUBLIC_KEY> --transaction-index <TRANSACTION_INDEX>
```

| Parameter | Required | Description |
| - | - | - |
| `--multisig-pubkey` | Yes | Public key of the multisig account |
| `--transaction-index` | Yes | Index of the transaction to execute |

```bash theme={null}
config-transaction-execute --keypair /path/to/keypair.json \
  --multisig-pubkey <MULTISIG_PUBLIC_KEY> \
  --transaction-index 1
```

### proposal-vote

Cast a vote on a transaction.

```bash theme={null}
proposal-vote --keypair <KEYPAIR_PATH> --multisig-pubkey <MULTISIG_PUBLIC_KEY> --transaction-index <TRANSACTION_INDEX> --action <ACTION> [--memo <MEMO>]
```

| Parameter | Required | Description |
| - | - | - |
| `--multisig-pubkey` | Yes | Public key of the multisig account |
| `--transaction-index` | Yes | Index of the transaction to vote on |
| `--action` | Yes | Vote action: `Approve`, `Reject`, or `Cancel` |
| `--memo` | No | Memo for the vote |

**Examples:**

```bash theme={null}
# Approve
proposal-vote --keypair /path/to/keypair.json \
  --multisig-pubkey <MULTISIG_PUBLIC_KEY> \
  --transaction-index 1 --action Approve

# Reject
proposal-vote --keypair /path/to/keypair.json \
  --multisig-pubkey <MULTISIG_PUBLIC_KEY> \
  --transaction-index 1 --action Reject

# Cancel
proposal-vote --keypair /path/to/keypair.json \
  --multisig-pubkey <MULTISIG_PUBLIC_KEY> \
  --transaction-index 1 --action Cancel
```

### vault-transaction-create

Create a new vault transaction with a custom transaction message.

```bash theme={null}
vault-transaction-create --keypair <KEYPAIR_PATH> --multisig-pubkey <MULTISIG_PUBLIC_KEY> --vault-index <VAULT_INDEX> --transaction-message <TRANSACTION_MESSAGE> [--memo <MEMO>]
```

| Parameter | Required | Description |
| - | - | - |
| `--multisig-pubkey` | Yes | Public key of the multisig account |
| `--vault-index` | Yes | Index of the vault |
| `--transaction-message` | Yes | Transaction message payload |
| `--memo` | No | Memo for the transaction |

```bash theme={null}
vault-transaction-create --keypair /path/to/keypair.json \
  --multisig-pubkey <MULTISIG_PUBLIC_KEY> \
  --vault-index 1 \
  --transaction-message 1 --transaction-message 2 --transaction-message 3
```

### vault-transaction-execute

Execute a vault transaction once it's reached the approval threshold.

```bash theme={null}
vault-transaction-execute --keypair <KEYPAIR_PATH> --multisig-pubkey <MULTISIG_PUBLIC_KEY> --transaction-index <TRANSACTION_INDEX>
```

| Parameter | Required | Description |
| - | - | - |
| `--multisig-pubkey` | Yes | Public key of the multisig account |
| `--transaction-index` | Yes | Index of the transaction to execute |

```bash theme={null}
vault-transaction-execute --keypair /path/to/keypair.json \
  --multisig-pubkey <MULTISIG_PUBLIC_KEY> \
  --transaction-index 1
```

### vault-transaction-accounts-close

Close the proposal and transaction accounts for a vault transaction. Rent gets returned to the multisig's rent collector.

```bash theme={null}
vault-transaction-accounts-close --keypair <KEYPAIR_PATH> --multisig-pubkey <MULTISIG_PUBLIC_KEY> --transaction-index <TRANSACTION_INDEX> --rent-collector <RENT_COLLECTOR_PUBKEY>
```

| Parameter | Required | Description |
| - | - | - |
| `--multisig-pubkey` | Yes | Public key of the multisig account |
| `--transaction-index` | Yes | Index of the transaction to close |
| `--rent-collector` | Yes | Public key for collecting rent |

```bash theme={null}
vault-transaction-accounts-close --keypair /path/to/keypair.json \
  --multisig-pubkey <MULTISIG_PUBLIC_KEY> \
  --transaction-index 1 \
  --rent-collector <RENT_COLLECTOR_PUBKEY>
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.