npm package: @kamino-finance/squads-kamino-cli
Description: ```    _____    ____      __  __   ___       ____     _____             __ __    ___       __  ___   ____   _   __   ____   / ___/   / __ \    / / / /  /   |     / __ \   / ___/            / //_/   /   |     /  |/  /  /  _/  / | / /  / __ \   \__ \   / / 
Latest version: 1.0.2

```
   _____    ____      __  __   ___       ____     _____             __ __    ___       __  ___   ____   _   __   ____
  / ___/   / __ \    / / / /  /   |     / __ \   / ___/            / //_/   /   |     /  |/  /  /  _/  / | / /  / __ \
  \__ \   / / / /   / / / /  / /| |    / / / /   \__ \   ______   / ,<     / /| |    / /|_/ /   / /   /  |/ /  / / / /
 ___/ /  / /_/ /   / /_/ /  / ___ |   / /_/ /   ___/ /  /_____/  / /| |   / ___ |   / /  / /  _/ /   / /|  /  / /_/ /
/____/   \___\_\   \____/  /_/  |_|  /_____/   /____/           /_/ |_|  /_/  |_|  /_/  /_/  /___/  /_/ |_/   \____/

```

## Squads CLI

Interact with the Squads Multisig Program through a simple CLI.

### Requirements

Nodejs version >= 16

### !! Make sure your ledger is connected and unlocked when you run the cli. !!

### Installing & Updating the CLI tool

- install
  `npm install -g @kamino-finance/squads-kamino-cli`
- set path
  to find path: `which squads-kamino-cli`
  to set path: `echo -n 'export PATH=<WHICH_PATH>:$PATH'` >> ~/.zshrc | (on MAC) where <WHICH_PATH> is the output from above

- update
  `npm update --g @kamino-finance/squads-kamino-cli`

### Running the tool

Running the simple command will start the tool and ask a few setup questions for the wallet and the network cluster.\
`squads-kamino-cli`

### CLI help

`squads-kamino-cli --help` should display all available commands and arguments

### .env file

```
CLUSTER=
LEDGER_ADDRESS_KEY=
IRONFORGE_CLUSTER=
```

#### Input file should only contain base58 transaction/instructions separated by newlines

### Examples

- Get multisigs
  `yarn cli create-transaction-from-instructions-file --cluster https://rpc.url --ledger-address-key 0 --multisig BxdLNhoRXVs45wTVAZBrYQUkxbex5zXFCaJtsuRpoqMj  --file-path ./ixns.in`
- Transactions from file - print
  `yarn cli create-transaction-from-instructions-file --cluster https://rpc.url --ledger-address-key 0 --multisig E35i5qn7872eEmBt15e5VGhziUBzCTm43XCSWvDoQNNv --file-path ./ixns.in --title 'Squads cli test add token' --mode print`
- Transactions from file - print, using .env for cluster and ledger-pubkey, using squad name instead of multisig pubkey
  `yarn cli create-transaction-from-instructions-file --squad kamino --file-path ./ixns.in --title 'Squads cli test add token' --mode print`
- With .env file from file
  `yarn cli create-transaction-from-instructions-file --multisig 7Pd2qaTnHmbfwcdVnf812xz2mdWz8G6sQxEjc3t7NChz --file-path ./ixns.in --title 'Squads cli test add token' --mode propose`
- Program upgrade proposal (THIS WILL ONLY CREATE A PROGRAM UPGRADE BUT IT WILL NOT INITIATE IT)
  `yarn cli create-program-upgrade --multisig BxdLNhoRXVs45wTVAZBrYQUkxbex5zXFCaJtsuRpoqMj --program-id SLendK7ySfcEzyaFqy93gDnD3RtrpXJcnRwb6zFHJSh --buffer EnYZG1528vJQpGmEFSCR4KLVy8aoShzSUt6zBECyP7mg --refund-address sadmBTQm5HJsyzWHEjV4YwG9CiahZKVDVqAyS4Wx1zH --title 'Squads cli test program upgrade' --mode propose`

## Squads Cli to approve and execute

https://github.com/Squads-Protocol/squads-cli

`npm install -g @sqds/cli` - to install

`squads-cli --cluster <RPC>` - to run
This will prompt you with `Enter the path of your wallet file or ledger` -> ``usb://ledger` - works for some ledgers, or `usb://ledger?key=0` - you know it worked when you see the right `Connected wallet:`.
!! Make sure your ledger is connected and unlocked when you run the cli.

When you press `Choose multisig` it will let you select from all the multisig your wallet is part of.
For reference:
`BbM3mbcLsa3QcYEVx8iovwfKaA1iZ6DK5fEbbtHwS3N8` - KFarms
`A9rQoX1sictAQkyXxaZA8nz674xutHwoqpK2mwLyexCZ` - KLend
`E35i5qn7872eEmBt15e5VGhziUBzCTm43XCSWvDoQNNv` - Kamino MS
`BxdLNhoRXVs45wTVAZBrYQUkxbex5zXFCaJtsuRpoqMj` - KLend Staging

After choosing the multisig, you can interact with squads. The most useful interaction is to approve and execute transactions, especially when the v3 UI is not responsive. To do so select `Transactions` and then select a tranmsaction. (The latest transactions are always at the end of the list -> scroll all the way down or just go up past the `<- Go back` option and you should see the latest ones, or the non-executed ones if there are any)

You can also create or asamble transactions using this CLI but it's a lot slower than just using squads-kamino-cli