# CLI configuration

Prakasa API is fully compatible with the OpenAI API standard. This means you can use your favorite command-line tools to access Claude 3.5, GPT-4o, and Gemini Pro directly from your terminal.

Below are the configuration guides for the most popular open-source CLI tools.

***

### 1. AIChat (Recommended)

AIChat is a powerful, all-in-one CLI tool written in Rust. It features syntax highlighting, role management, and REPL mode.

#### Installation

macOS / Linux (Homebrew)

Bash

```
brew install aichat
```

Windows (Winget)

PowerShell

```
winget install aichat
```

#### Configuration

Run `aichat` once to generate the config file, then edit it:

* Config Path:
  * macOS/Linux: `~/.config/aichat/config.yaml`
  * Windows: `%APPDATA%\aichat\config.yaml`

Edit `config.yaml`:

YAML

```
model: claude-3-5-sonnet-20240620  # Default model
clients:
  - type: openai
    name: prakasa
    api_key: sk-prakasa-...        # Your Prakasa API Key
    api_base: https://api.prakasa.me/v1
```

#### Usage

Bash

```
# Chat Mode
aichat

# One-off Command
aichat "Write a Python script to scrape a website"

# Execute Shell Command (Danger Mode)
aichat -e "Find all files larger than 100MB"
```

***

### 2. Shell-GPT (sgpt)

Shell-GPT allows you to generate shell commands, code snippets, and documentation directly in your terminal using Python.

#### Installation

Requires Python 3.8+.

Bash

```
pip install shell-gpt
```

#### Configuration

Set the environment variables in your shell profile (`~/.zshrc` or `~/.bashrc`):

Bash

```
export OPENAI_API_HOST="https://api.prakasa.me/v1"
export OPENAI_API_KEY="sk-prakasa-..."
```

Reload your shell:

Bash

```
source ~/.zshrc
```

#### Usage

Bash

```
# Generate Shell Commands
sgpt -s "Kill process running on port 3000"

# Code Generation
sgpt --code "Write a Dockerfile for a Node.js app"

# Chat with specific model
sgpt --model claude-3-5-sonnet-20240620 "Explain quantum computing"
```

***

### 3. LLM (Simon Willison's Tool)

LLM is a CLI utility and Python library for interacting with Large Language Models. It supports a plugin system for extended functionality.

#### Installation

Bash

```
pip install llm
```

#### Configuration

Configure the default OpenAI key to point to Prakasa:

Bash

```
# Set API Key
llm keys set openai
# Paste your key: sk-prakasa-...

# Set Custom Endpoint (Important!)
export OPENAI_API_BASE="https://api.prakasa.me/v1"
```

#### Usage

Bash

```
# Pipe content to LLM
cat prompt.txt | llm -m gpt-4o

# System Prompt
llm -s "You are a cynical poet" "Describe the internet"
```

***

### 4. Advanced: Curl (Raw Request)

For debugging or integration into scripts, you can always use raw `curl`.

Bash

```
curl https://api.prakasa.me/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer sk-prakasa-..." \
  -d '{
    "model": "claude-3-5-sonnet-20240620",
    "messages": [{"role": "user", "content": "Hello CLI!"}],
    "stream": true
  }'
```

***

#### 💡 Pro Tip: Model Aliases

To save time, we recommend adding aliases to your shell configuration for frequently used models.

Add to `~/.zshrc`:

Bash

```
# Quick Chat with Claude 3.5
alias claude='sgpt --model claude-3-5-sonnet-20240620'

# Quick Chat with GPT-4o
alias gpt4='sgpt --model gpt-4o'
```

Usage:

Bash

```
claude "Review this git diff" < git diff
```


---

# 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.prakasa.me/cli-configuration.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.
