# Installation

Installing and configuring **FlexoCLI** takes just a few steps. Follow this guide to set up your environment and start leveraging **AI-powered DeFi analytics** in minutes.

***

{% stepper %}
{% step %}

### Clone the repository

First, download the latest version of **Flexo CLI** from GitHub and navigate to the project directory:

```sh
git clone https://github.com/flexosh/cli.git
cd flexo-cli
```

This gives you access to the full Flexo **CLI framework**, ready for installation.
{% endstep %}

{% step %}

### Install dependencies

Ensure all required packages are installed by running:

```sh
npm install
```

This will **fetch and install** all necessary dependencies, ensuring a **smooth experience** when using **Flexo CLI**.
{% endstep %}

{% step %}

### Generate a wallet keypair

Flexo CLI interacts with the **Solana blockchain**, so you need a **valid wallet**.

```sh
# Generate new keypair
solana-keygen new --outfile ~/.config/solana/flexo-wallet.json

# Set default wallet
solana config set --keypair ~/.config/solana/flexo-wallet.json

# Verify wallet setup
solana address
solana balance
```

**Fund your wallet with SOL** to interact with blockchain-based features seamlessly.
{% endstep %}

{% step %}

### Set up environment variables

Flexo CLI requires certain **environment variables** to function properly. Configure these in a `.env` file or export them in your terminal:

```sh
OPENAI_API_KEY=<your-openai-api-key>
SOL_WALLET_KEY=<your-wallet-private-key>
API_URL=https://api.flexo.sh
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com
```

{% endstep %}

{% step %}

### You're ready to start

With everything set up, you can now explore **Flexo CLI’s powerful features**. Run your first command to ensure the setup works:

```sh
npm run flexo
```

{% hint style="info" %}
**To explore all the available CLI commands, head over to** our [command guide](https://docs.flexo.sh/flexo-cli/commands).
{% endhint %}
{% endstep %}
{% endstepper %}

***

{% hint style="warning" %}
Never expose your **API keys** or **private wallet keys** in **public repositories**. Use `.gitignore` to prevent the `.env` file from being committed, and consider **secure storage solutions** like **AWS Secrets Manager** or **environment variable encryption**.
{% endhint %}
