# Install Saga CLI

{% hint style="info" %}
**Good to know:** You would need a computer which has a decent and reliable connection to the internet. Additionally, if you have a firewall, you will need to ensure that outbound traffic is allowed for port 443 (HTTPS).
{% endhint %}

## Installation (Linux or Mac)

At the shell prompt, type to unarchive and install the cli in the desired path

```
tar -xzf <tar.gz file downloaded> -C <directory to install sagacli>
```

Example:

```
tar -xzf pegasus.tar.gz -C /usr/local/bin/
```

{% hint style="info" %}
Depending on the folder you decide to install `sagacli` to, you may need to use `sudo` permissions i.e. prefixing your command with sudo. Also check if the directory `<directory to install sagacli>` in step 1 is already in the PATH e.g. on Linux
{% endhint %}

If the directory is not in the `PATH`, add it to the `PATH` depending on your host operating system and shell used. Example, on Linux you would use:

```
export PATH=$PATH:<directory to install sagacli>
```

We recommend adding this change to your shell's profile (`~/.profile` or `~/.bashrc` or `~/.bash_profile`).

{% hint style="info" %}
On Linux and Mac, ensure you source the profile updates e.g. `source ~/.profile` or `source ~/.bash_profile` etc., depending on the file you updated.
{% endhint %}

{% hint style="warning" %}
On some versions of MacOS, you will need to remove the newly downloaded binary from quarantine by using the following command in your terminal:\
\
`xattr -d com.apple.quarantine /path/to/sagacli`&#x20;
{% endhint %}

Test that `sagacli` has been installed by running `sagacli` from any shell prompt. You should get an output like this:

```
Interact with Pegasus

Usage:
  sagacli [command]

Available Commands:
  account     Account queries and transactions subcommands
  chainlet    Chainlet queries and transaction subcommands
  completion  Generate the autocompletion script for the specified shell
  config      Create or query an application CLI configuration file
  help        Help about any command
  keys        Manage your application's keys
  status      Query configured systems status
  tx          Transactions queries subcommands

Flags:
      --controller string          controller grpc url (host:port) (default "https://controller.testnet-sp1.sagarpc.io")
      --from string                Name of private key used to sign (default "bogdan_local")
  -h, --help                       help for sagacli
      --keyring-backend string     Select keyring's backend (os|file|test) (default "file")
      --ledger                     Use the connected Ledger device for signing tx
  -l, --loglevel string            commands logging level (default "info")
      --network-rpc string         <host>:<port> to tendermint rpc interface for remote chain (default "https://spc.testnet-sp1.sagarpc.io")
  -o, --output string              output type <text|json> (default "text")
      --platform-chain-id string   The SPC network chain ID (default "spc-testnet-1")
  -v, --version                    version for sagacli

Use "sagacli [command] --help" for more information about a command.

```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.saga.xyz/sagacli/install-saga-cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
