mirror of https://github.com/aliasrobotics/cai.git
Merge branch 'aliasrobotics:main' into support-model-fix
This commit is contained in:
commit
881c25b18c
|
|
@ -195,31 +195,32 @@ This document provides documentation for all commands available in the CAI (Cont
|
|||
### **Parallel Execution (`parallel.py`)**
|
||||
### **ParallelCommand**
|
||||
- **Command**: `/parallel`
|
||||
- **Purpose**: Manage parallel agent configurations
|
||||
- **Purpose**: Configure and run parallel agent workflows with isolated contexts
|
||||
- **Features**:
|
||||
- Configure multiple agents
|
||||
- Set different models per agent
|
||||
- Execute agents in parallel
|
||||
- Manage parallel configurations
|
||||
- Add/remove/list parallel agents
|
||||
- Queue prompts per agent or broadcast to all agents
|
||||
- Execute queued prompts with `/parallel run`
|
||||
- Merge results back into the main context
|
||||
- Exit parallel mode with or without merge
|
||||
|
||||
### **Run Parallel (`run.py`)**
|
||||
### **RunCommand**
|
||||
- **Command**: `/run`
|
||||
- **Purpose**: Execute queued prompts in parallel mode
|
||||
### **Queue Management (`queue.py`)**
|
||||
### **QueueCommand**
|
||||
- **Command**: `/queue`
|
||||
- **Purpose**: Manage sequential prompt queue independently from parallel mode
|
||||
- **Features**:
|
||||
- Queue prompts for different agents
|
||||
- Execute all queued prompts
|
||||
- Manage parallel execution
|
||||
- Collect results from multiple agents
|
||||
- Add prompts to queue
|
||||
- List queued prompts
|
||||
- Run queued prompts sequentially
|
||||
- Clear queue safely
|
||||
|
||||
### **Merge Histories (`merge.py`)**
|
||||
### **MergeCommand**
|
||||
- **Command**: `/merge`
|
||||
- **Purpose**: Merge agent message histories (alias for `/parallel merge`)
|
||||
- **Purpose**: Merge parallel agent contexts into main context and exit parallel mode
|
||||
- **Features**:
|
||||
- Combine histories from multiple agents
|
||||
- Integrate parallel conversation results
|
||||
- Shortcut for parallel merge functionality
|
||||
- Integrate parallel conversation results into the current main thread
|
||||
- Automatically leave parallel mode after successful merge
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -343,18 +344,20 @@ cai
|
|||
### Advanced Features
|
||||
```bash
|
||||
# Set up parallel execution
|
||||
/parallel create agent1 --model gpt-4
|
||||
/parallel create agent2 --model claude-3
|
||||
/parallel add red_teamer
|
||||
/parallel add network_traffic_analyzer
|
||||
|
||||
# Queue prompts
|
||||
/run queue agent1 "Analyze this code"
|
||||
/run queue agent2 "Review the analysis"
|
||||
# Add prompts (per agent or all)
|
||||
/parallel prompt all "Scan 192.168.1.0/24"
|
||||
|
||||
# Execute in parallel
|
||||
/run execute
|
||||
/parallel run
|
||||
|
||||
# Merge results
|
||||
# Merge all parallel contexts into main context and exit parallel mode
|
||||
/merge
|
||||
|
||||
# Optional: exit without merging contexts
|
||||
/parallel clear
|
||||
```
|
||||
|
||||
### Integration Examples
|
||||
|
|
|
|||
|
|
@ -291,10 +291,9 @@ cai --version
|
|||
|
||||
### Issue: "Rate limit exceeded"
|
||||
|
||||
**This shouldn't happen with CAI PRO** (unlimited tokens). If you see this:
|
||||
The client will automatically pause until the appropriate time frame has passed and then retry the iteration without interrupting the session.
|
||||
|
||||
1. Check for typos in your `ALIAS_API_KEY`
|
||||
2. Contact support immediately: support@aliasrobotics.com
|
||||
If this is happening frequently, consider compacting the context with `/compact`.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,96 @@
|
|||
# Claude Code
|
||||
|
||||
!!! danger "Third-Party Scaffolding — Privacy & Security Warning"
|
||||
Third-party scaffoldings may be serving your data outside your environment.
|
||||
For **privacy** and **cybersecurity refusal optimization**, use **CAI** to obtain the best performance.
|
||||
|
||||
Claude Code is Anthropic's official CLI for agentic coding. Because it speaks the **Anthropic API format** natively, it cannot talk directly to the Alias API (which is OpenAI-compatible). A small proxy is required to translate between the two.
|
||||
|
||||
!!! warning "Support Disclaimer"
|
||||
Alias Robotics **does not provide support** for developments or integrations related to Claude Code. This page documents API compatibility only. Alias simply allows usage of the Alias API through your preferred scaffolding.
|
||||
|
||||
---
|
||||
|
||||
## How It Works
|
||||
|
||||
```
|
||||
Claude Code → Anthropic API format
|
||||
↓
|
||||
claude-code-proxy (localhost:8082)
|
||||
↓
|
||||
OpenAI-compatible format → Alias API
|
||||
```
|
||||
|
||||
The proxy ([github.com/1rgs/claude-code-proxy](https://github.com/1rgs/claude-code-proxy)) intercepts Anthropic-format requests from Claude Code and forwards them to any OpenAI-compatible backend — in this case, the Alias API.
|
||||
|
||||
---
|
||||
|
||||
## Setup
|
||||
|
||||
### 1. Get your Alias API Key
|
||||
|
||||
An `ALIAS_API_KEY` (format: `sk-...`) can be obtained from either of the following:
|
||||
|
||||
- **[CAI PRO](https://aliasrobotics.com/cybersecurityai.php)** — full cybersecurity AI platform with access to `alias1` and other models.
|
||||
- **[Alias LLMs](https://aliasrobotics.com/aliasLLMs.php)** — acquire `alias2-mini` and other Alias language models directly.
|
||||
|
||||
### 2. Clone and configure the proxy
|
||||
|
||||
```bash
|
||||
git clone https://github.com/1rgs/claude-code-proxy.git
|
||||
cd claude-code-proxy
|
||||
```
|
||||
|
||||
Create a `.env` file:
|
||||
|
||||
```bash
|
||||
# Point to the Alias API
|
||||
OPENAI_API_KEY="sk-your-alias-api-key-here"
|
||||
OPENAI_BASE_URL="https://api.aliasrobotics.com:666/"
|
||||
|
||||
# Map Claude model names to Alias models
|
||||
BIG_MODEL="alias1"
|
||||
SMALL_MODEL="alias1"
|
||||
|
||||
PREFERRED_PROVIDER="openai"
|
||||
```
|
||||
|
||||
### 3. Run the proxy
|
||||
|
||||
Install `uv` if needed, then start the server:
|
||||
|
||||
```bash
|
||||
uv run uvicorn server:app --host 0.0.0.0 --port 8082 --reload
|
||||
```
|
||||
|
||||
Or with Docker:
|
||||
|
||||
```bash
|
||||
docker run -d --env-file .env -p 8082:8082 ghcr.io/1rgs/claude-code-proxy:latest
|
||||
```
|
||||
|
||||
### 4. Launch Claude Code via the proxy
|
||||
|
||||
```bash
|
||||
ANTHROPIC_BASE_URL=http://localhost:8082 claude
|
||||
```
|
||||
|
||||
To avoid setting this every time, export it in your shell profile:
|
||||
|
||||
```bash
|
||||
echo 'export ANTHROPIC_BASE_URL=http://localhost:8082' >> ~/.zshrc
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Verification
|
||||
|
||||
Inside Claude Code, run a quick prompt and confirm the response is served via `alias1`. Token usage and billing will appear in your Alias account.
|
||||
|
||||
---
|
||||
|
||||
## Related
|
||||
|
||||
- [CAI PRO Quickstart](../cai_pro_quickstart.md)
|
||||
- [Available Models](../cai_list_of_models.md)
|
||||
- [Environment Variables](../environment_variables.md)
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
# Codex CLI
|
||||
|
||||
!!! danger "Third-Party Scaffolding — Privacy & Security Warning"
|
||||
Third-party scaffoldings may be serving your data outside your environment.
|
||||
For **privacy** and **cybersecurity refusal optimization**, use **CAI** to obtain the best performance.
|
||||
|
||||
[Codex CLI](https://github.com/openai/codex) is OpenAI's open-source terminal-based AI coding agent. Because it uses the **OpenAI API format** natively, it can connect directly to the Alias API without any proxy.
|
||||
|
||||
!!! warning "Support Disclaimer"
|
||||
Alias Robotics **does not provide support** for developments or integrations related to Codex CLI. This page documents API compatibility only. Alias simply allows usage of the Alias API through your preferred scaffolding.
|
||||
|
||||
---
|
||||
|
||||
## Setup
|
||||
|
||||
### 1. Get your Alias API Key
|
||||
|
||||
An `ALIAS_API_KEY` (format: `sk-...`) can be obtained from either of the following:
|
||||
|
||||
- **[CAI PRO](https://aliasrobotics.com/cybersecurityai.php)** — full cybersecurity AI platform with access to `alias1` and other models.
|
||||
- **[Alias LLMs](https://aliasrobotics.com/aliasLLMs.php)** — acquire `alias2-mini` and other Alias language models directly.
|
||||
|
||||
### 2. Install Codex CLI
|
||||
|
||||
```bash
|
||||
npm install -g @openai/codex
|
||||
```
|
||||
|
||||
### 3. Configure environment variables
|
||||
|
||||
```bash
|
||||
export OPENAI_API_KEY="sk-your-alias-api-key-here"
|
||||
export OPENAI_BASE_URL="https://api.aliasrobotics.com:666/"
|
||||
```
|
||||
|
||||
To persist these, add them to your shell profile (`~/.zshrc`, `~/.bashrc`, etc.):
|
||||
|
||||
```bash
|
||||
echo 'export OPENAI_API_KEY="sk-your-alias-api-key-here"' >> ~/.zshrc
|
||||
echo 'export OPENAI_BASE_URL="https://api.aliasrobotics.com:666/"' >> ~/.zshrc
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
### 4. Run Codex with an Alias model
|
||||
|
||||
```bash
|
||||
codex --model alias1
|
||||
```
|
||||
|
||||
Or set the model inline per session:
|
||||
|
||||
```bash
|
||||
OPENAI_API_KEY="sk-your-alias-api-key-here" \
|
||||
OPENAI_BASE_URL="https://api.aliasrobotics.com:666/" \
|
||||
codex --model alias1
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Notes
|
||||
|
||||
- The Alias API is fully OpenAI-compatible — no additional configuration is required beyond pointing the base URL and API key.
|
||||
- Use `alias1` for best cybersecurity performance, or `alias0` for a faster, lighter alternative.
|
||||
- Token usage and billing appear in your Alias account dashboard.
|
||||
|
||||
---
|
||||
|
||||
## Related
|
||||
|
||||
- [CAI PRO Quickstart](../cai_pro_quickstart.md)
|
||||
- [Available Models](../cai_list_of_models.md)
|
||||
- [Environment Variables](../environment_variables.md)
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
# OpenCode
|
||||
|
||||
!!! danger "Third-Party Scaffolding — Privacy & Security Warning"
|
||||
Third-party scaffoldings may be serving your data outside your environment.
|
||||
For **privacy** and **cybersecurity refusal optimization**, use **CAI** to obtain the best performance.
|
||||
|
||||
[OpenCode](https://opencode.ai) is an open-source, terminal-based AI coding assistant. It supports OpenAI-compatible providers, which means the Alias API can be plugged in directly without any proxy.
|
||||
|
||||
!!! warning "Support Disclaimer"
|
||||
Alias Robotics **does not provide support** for developments or integrations related to OpenCode. This page documents API compatibility only. Alias simply allows usage of the Alias API through your preferred scaffolding.
|
||||
|
||||
---
|
||||
|
||||
## Setup
|
||||
|
||||
### 1. Get your Alias API Key
|
||||
|
||||
An `ALIAS_API_KEY` (format: `sk-...`) can be obtained from either of the following:
|
||||
|
||||
- **[CAI PRO](https://aliasrobotics.com/cybersecurityai.php)** — full cybersecurity AI platform with access to `alias1` and other models.
|
||||
- **[Alias LLMs](https://aliasrobotics.com/aliasLLMs.php)** — acquire `alias2-mini` and other Alias language models directly.
|
||||
|
||||
### 2. Install OpenCode
|
||||
|
||||
```bash
|
||||
npm install -g opencode-ai
|
||||
```
|
||||
|
||||
Or via Homebrew (macOS):
|
||||
|
||||
```bash
|
||||
brew install sst/tap/opencode
|
||||
```
|
||||
|
||||
### 3. Configure the Alias provider
|
||||
|
||||
OpenCode uses a `~/.config/opencode/config.json` file. Add a custom OpenAI-compatible provider pointing to the Alias API:
|
||||
|
||||
```json
|
||||
{
|
||||
"provider": {
|
||||
"alias": {
|
||||
"api": "https://api.aliasrobotics.com:666/",
|
||||
"name": "Alias Robotics",
|
||||
"env": ["ALIAS_API_KEY"]
|
||||
}
|
||||
},
|
||||
"model": "alias/alias1"
|
||||
}
|
||||
```
|
||||
|
||||
Then export your key:
|
||||
|
||||
```bash
|
||||
export ALIAS_API_KEY="sk-your-alias-api-key-here"
|
||||
```
|
||||
|
||||
### 4. Run OpenCode
|
||||
|
||||
```bash
|
||||
opencode
|
||||
```
|
||||
|
||||
OpenCode will pick up the configured provider and route requests to the Alias API.
|
||||
|
||||
---
|
||||
|
||||
## Alternative: environment variable approach
|
||||
|
||||
If you prefer not to edit the config file, OpenCode also respects standard OpenAI environment variables:
|
||||
|
||||
```bash
|
||||
export OPENAI_API_KEY="sk-your-alias-api-key-here"
|
||||
export OPENAI_BASE_URL="https://api.aliasrobotics.com:666/"
|
||||
opencode --model alias1
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Notes
|
||||
|
||||
- Use `alias1` for best cybersecurity performance, or `alias0` for a faster, lighter alternative.
|
||||
- Token usage and billing appear in your Alias account dashboard.
|
||||
|
||||
---
|
||||
|
||||
## Related
|
||||
|
||||
- [CAI PRO Quickstart](../cai_pro_quickstart.md)
|
||||
- [Available Models](../cai_list_of_models.md)
|
||||
- [Environment Variables](../environment_variables.md)
|
||||
|
|
@ -77,6 +77,14 @@ nav:
|
|||
- Commands Reference: cli/commands_reference.md
|
||||
- Advanced Usage: cli/advanced_usage.md
|
||||
|
||||
# ========================================
|
||||
# SUPPORTING OTHER CLIs
|
||||
# ========================================
|
||||
- Supporting Other CLIs:
|
||||
- Claude Code: other_cli/claude_code.md
|
||||
- Codex CLI: other_cli/codex.md
|
||||
- OpenCode: other_cli/opencode.md
|
||||
|
||||
# ========================================
|
||||
# CORE CONCEPTS
|
||||
# ========================================
|
||||
|
|
|
|||
Loading…
Reference in New Issue