> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.pensar.dev/apex/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.pensar.dev/apex/_mcp/server.

# Getting Started

> Install and configure Pensar Apex for AI-powered penetration testing

## Prerequisites

* **API Key** for your chosen AI provider (Anthropic recommended)

> **Info**
>
> After installing, run `pensar doctor` to check for optional dependencies (like
> nmap) and install them automatically.

## Installation

Install Apex using your preferred method:

#### macOS/Linux

`bash curl -fsSL https://pensarai.com/install.sh | bash `

#### Homebrew

`bash brew tap pensarai/tap brew install apex `

#### Windows

`powershell irm https://www.pensarai.com/apex.ps1 | iex `

#### npm

`bash npm install -g @pensar/apex ` Requires
[Node.js](https://nodejs.org)

> **Success**
>
> Apex is now installed! You can run it from anywhere by typing `pensar` in your
> terminal.

## Configuration

Before running Apex, you need to configure your AI provider API key. Apex supports multiple providers, but **Anthropic is recommended** for best results.

#### Anthropic (Recommended)

Get your API key from [console.anthropic.com](https://console.anthropic.com/).

> **Success**
>
> Anthropic models (especially Claude Sonnet 4.5) provide the best performance for penetration testing tasks.

#### OpenAI

Get your API key from [platform.openai.com](https://platform.openai.com/).

Apex uses GPT 5.5 as the default OpenAI model when OpenAI is your highest-priority configured provider.

#### Google

Get your API key from [aistudio.google.com](https://aistudio.google.com/).

Google provides access to Gemini models through the Generative AI API.

#### OpenRouter

Get your API key from [openrouter.ai](https://openrouter.ai/).

OpenRouter provides access to multiple AI models through a single API.

#### AWS Bedrock

Configure AWS credentials with Bedrock access.

Ensure you have access to Anthropic Claude models in AWS Bedrock.

#### Pensar Console (Managed)

Use the `/login` command inside Apex to connect to [Pensar Console](https://console.pensar.dev) for managed inference — no API key required.

![Provider selection screen](/home/runner/work/apex/apex/fern/docs/assets/providers.png)

> **Info**
>
> **Tip:** You'll configure your API key directly in Apex using the `/providers`
> command — no environment variables needed!

## Running Apex

Launch Apex by running:

```bash
pensar
```

This will start the interactive terminal interface where you can access all Apex commands.

![Apex Home Screen](/apex/_fern-files/_img/0e4b07bda4218ff0aaf0f4c120fef70ebb7fc98102d7a34cc2148b058ffd0a89.webp)

## CLI Commands

Apex also supports headless CLI commands for CI/CD and scripting:

```bash
pensar pentest --target <url>               # Run a full pentest orchestration
pensar targeted-pentest --target <url>      # Run a targeted pentest
pensar login                                # Connect to Pensar Console from the CLI
pensar login status                         # Show current login connection status
pensar login logout                         # Disconnect from Pensar Console
pensar pentests                             # List/get/dispatch pentests
pensar issues                               # List/get/update security issues
pensar fixes <issueId>                      # List/get security fixes
pensar logs <issueId>                       # List/search agent execution logs
pensar upgrade                              # Update to the latest version
pensar doctor                               # Check & install optional dependencies
pensar uninstall                            # Fully remove Pensar (interactive)
pensar uninstall --force                    # Fully remove Pensar (no confirmation)
```

## Using Kali Linux Container (Optional)

For **best performance** and maximum compatibility with security tools, we recommend running Apex in the included Kali Linux container:

#### Clone the Repository

`bash git clone https://github.com/pensarai/apex.git cd apex/container `

#### Configure Environment

`bash cp env.example .env # Edit .env and add your API keys `

#### Start Container

`bash docker compose up --build -d `

#### Enter Container

`bash docker compose exec kali-apex bash `

#### Run Apex

Inside the container, run: `bash pensar `

> **Info**
>
> **Linux Users:** Consider using `network_mode: host` in `docker-compose.yml`
> for comprehensive network scanning capabilities.

## First Steps

Now that Apex is installed, here's how to get started:

#### Login to Pensar

Run `/login` to login to Pensar.

#### Select Model

Run `/models` to choose which AI model to use

#### Start Testing

Run `/pentest` to launch an autonomous penetration test, or `/operator` for
an interactive session

#### /pentest

Launch an autonomous penetration testing swarm against your target.

#### /operator

Start an interactive operator session with step-by-step control.

#### /providers

Connect your AI provider and configure API keys.

#### /models

Select which AI model to use for testing.

## Next Steps

#### [Commands Reference](/apex/tui-slash-commands/help)

Learn about all available commands in Apex.

#### [AI Providers](/apex/tui-slash-commands/providers)

Configure your AI provider for testing.

#### [Model Selection](/apex/tui-slash-commands/models)

Choose the right AI model for your needs.

#### [Start Testing](/apex/tui-slash-commands/pentest)

Launch your first penetration test.

## Need Help?

If you encounter any issues or have questions, reach out to our support team at [team@pensarai.com](mailto:team@pensarai.com).