Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
276 changes: 209 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,100 +1,242 @@
<a href="https://www.warp.dev">
<img width="1024" alt="Warp Agentic Development Environment product preview" src="https://github.com/user-attachments/assets/9976b2da-2edd-4604-a36c-8fd53719c6d4" />
</a>
# Warp AI — Self-Contained AI Terminal Agent

<p align="center">
<a href="https://www.warp.dev">Website</a>
·
<a href="https://www.warp.dev/code">Code</a>
·
<a href="https://www.warp.dev/agents">Agents</a>
·
<a href="https://www.warp.dev/terminal">Terminal</a>
·
<a href="https://www.warp.dev/drive">Drive</a>
·
<a href="https://docs.warp.dev">Docs</a>
·
<a href="https://www.warp.dev/blog/how-warp-works">How Warp Works</a>
</p>
> This is a fork of [warpdotdev/warp](https://github.com/warpdotdev/warp), modified to add a self-contained AI agent that works with any OpenAI-compatible API — no Warp account or backend server required.

> [!NOTE]
> OpenAI is the founding sponsor of the new, open-source Warp repository, and the new agentic management workflows are powered by GPT models.
**Author:** [goshitsarch](https://github.com/goshitsarch) (goshitsarch@gmail.com)

<h1></h1>
> AI tools (OpenClaude with GLM-5.1) were used to accelerate the development of these modifications. All code was designed, reviewed, and validated by a human developer.

## About
---

[Warp](https://www.warp.dev) is an agentic development environment, born out of the terminal. Use Warp's built-in coding agent, or bring your own CLI agent (Claude Code, Codex, Gemini CLI, and others).
## What This Fork Adds

## Installation
### 1. `warp-ai` CLI Agent (`crates/warp_ai_cli/`)

You can [download Warp](https://www.warp.dev/download) and [read our docs](https://docs.warp.dev/) for platform-specific instructions.
A Rust CLI that acts as a fully autonomous sysadmin agent. It:

## Warp Contributions Overview Dashboard
- Accepts a prompt and system prompt from files
- Calls any **OpenAI-compatible API** (DeepSeek, LiteLLM, Ollama, Together, local models, etc.)
- Uses **function calling / tool use** to autonomously execute tasks
- Streams responses in real-time to the terminal

Explore [build.warp.dev](https://build.warp.dev) to:
- Watch thousands of Oz agents triage issues, write specs, implement changes, and review PRs
- View top contributors and in-flight features
- Track your own issues with GitHub sign-in
- Click into active agent sessions in a web-compiled Warp terminal
**Available tools:**

## Licensing
| Tool | Description |
|------|-------------|
| `run_command` | Execute any shell command via `sh -c` — get stdout, stderr, exit code |
| `read_file` | Read file contents |
| `write_file` | Write to a file (creates parent dirs if needed) |
| `list_directory` | List files with `ls -la` |

Warp's UI framework (the `warpui_core` and `warpui` crates) are licensed under the [MIT license](LICENSE-MIT).
The agent loop runs until the task is complete: LLM calls tools, results are sent back, LLM decides next step, repeat. Maximum 50 turns by default.

The rest of the code in this repository is licensed under the [AGPL v3](LICENSE-AGPL).
### 2. WarpAi Harness (`app/src/ai/agent_sdk/driver/harness/warp_ai.rs`)

## Open Source & Contributing
A [ThirdPartyHarness](https://github.com/warpdotdev/warp/blob/master/app/src/ai/agent_sdk/driver/harness/mod.rs) implementation that integrates the `warp-ai` CLI into Warp's agent mode:

Warp's client codebase is open source and lives in this repository. We welcome community contributions and have designed a lightweight workflow to help new contributors get started. For the full contribution flow, read our [CONTRIBUTING.md](CONTRIBUTING.md) guide.
- Spawns `warp-ai` in the terminal
- Writes system prompt to a temp file (customizable via `~/.config/warp-ai/system-prompt.txt`)
- **Bypasses Warp's server** — no `resolve_prompt()` call, no account needed
- Conversations are local-only (no server save)

> [!TIP]
> **Chat with contributors and the Warp team** in the [`#oss-contributors`](https://warpcommunity.slack.com/archives/C0B0LM8N4DB) Slack channel — a good place for ad-hoc questions, design discussion, and pairing with maintainers. New here? [Join the Warp Slack community](https://go.warp.dev/join-preview) first, then jump into `#oss-contributors`.
### 3. Default Harness Setting (Settings UI)

### Issue to PR
A new "Default AI harness" dropdown in **Settings > Features**:

Before filing, [search existing issues](https://github.com/warpdotdev/warp/issues?q=is%3Aissue+is%3Aopen+sort%3Areactions-%2B1-desc) for your bug or feature request. If nothing exists, [file an issue](https://github.com/warpdotdev/warp/issues/new/choose) using our templates. Security vulnerabilities should be reported privately as described in [CONTRIBUTING.md](CONTRIBUTING.md#reporting-security-issues).
- **None** — default, uses Warp's built-in Oz agent
- **Warp AI** — new tabs/sessions auto-launch the `warp-ai` CLI agent

Once filed, a Warp maintainer reviews the issue and may apply a readiness label: [`ready-to-spec`](https://github.com/warpdotdev/warp/issues?q=is%3Aissue+is%3Aopen+label%3Aready-to-spec) signals the design is open for contributors to spec out, and [`ready-to-implement`](https://github.com/warpdotdev/warp/issues?q=is%3Aissue+is%3Aopen+label%3Aready-to-implement) signals the design is settled and code PRs are welcome. Anyone can pick up a labeled issue — mention **@oss-maintainers** on an issue if you'd like it considered for a readiness label.
Stored in `~/.warp/settings.toml` at `general.default_harness`.

### Building the Repo Locally
### 4. Server Bypass

To build and run Warp from source:
Added `requires_server_prompt_resolution()` to the `ThirdPartyHarness` trait. Harnesses that return `false` skip the server-side prompt resolution call. This is the mechanism that makes the whole system work without Warp's backend.

---

## Quick Start

### 1. Build

```bash
# Build Warp with the warp-ai binary included
./script/bootstrap
./script/run
```

The `warp-ai` binary is built automatically as part of the workspace.

### 2. Configure Your AI Provider

Set environment variables (or create a config file):

```bash
# Required: your API key
export WARP_AI_API_KEY="sk-your-key-here"

# Optional: defaults to OpenAI
export WARP_AI_BASE_URL="https://api.deepseek.com/v1"
export WARP_AI_MODEL="deepseek-chat"
```

Or create `~/.config/warp-ai/config.json`:

```json
{
"api_key": "sk-your-key-here",
"base_url": "https://api.deepseek.com/v1",
"model": "deepseek-chat"
}
```

### 3. Use It

**Option A: Auto-launch (recommended)**

1. Open Warp
2. Go to **Settings > Features**
3. Set "Default AI harness" to **Warp AI**
4. New tabs automatically start the AI agent

**Option B: Manual launch**

```bash
warp --harness warp-ai -p "check disk usage and clean up temp files over 1GB"
```

**Option C: Standalone CLI**

```bash
./script/bootstrap # platform-specific setup
./script/run # build and run Warp
./script/presubmit # fmt, clippy, and tests
echo "show me running services on this machine" > /tmp/prompt.txt
echo "You are a sysadmin assistant." > /tmp/sys.txt
WARP_AI_API_KEY=sk-xxx warp-ai --prompt-file /tmp/prompt.txt --system-prompt-file /tmp/sys.txt
```

---

## Example Usage

```
You: set up nginx with a reverse proxy to localhost:3000

[run_command] sudo apt install -y nginx
[OK] Reading package lists... Setting up nginx...

[run_command] sudo tee /etc/nginx/sites-available/myapp
[OK] Wrote 247 bytes to /etc/nginx/sites-available/myapp

[run_command] sudo ln -sf /etc/nginx/sites-available/myapp /etc/nginx/sites-enabled/
[OK]

[run_command] sudo nginx -t && sudo systemctl reload nginx
[OK] nginx: configuration syntax is ok...

Nginx is configured and running. Your app at localhost:3000 is now
reverse-proxied through nginx on port 80.
```

See [WARP.md](WARP.md) for the full engineering guide, including coding style, testing, and platform-specific notes.
---

## Supported Providers

Any API that implements the OpenAI chat completions interface with streaming and function calling:

## Joining the Team
| Provider | Base URL | Notes |
|----------|----------|-------|
| OpenAI | `https://api.openai.com/v1` | Default |
| DeepSeek | `https://api.deepseek.com/v1` | Good value |
| Together AI | `https://api.together.xyz/v1` | |
| Groq | `https://api.groq.com/openai/v1` | Fast inference |
| LiteLLM Proxy | `http://localhost:4000/v1` | Local proxy for any provider |
| Ollama | `http://localhost:11434/v1` | Local models |
| Any OpenAI-compatible | Custom | |

Interested in joining the team? See our [open roles](https://www.warp.dev/careers).
---

## Support and Questions
## Custom System Prompt

1. See our [docs](https://docs.warp.dev/) for a comprehensive guide to Warp's features.
2. Join our [Slack Community](https://go.warp.dev/join-preview) to connect with other users and get help from the Warp team — contributors hang out in [`#oss-contributors`](https://warpcommunity.slack.com/archives/C0B0LM8N4DB).
3. Try our [Preview build](https://www.warp.dev/download-preview) to test the latest experimental features.
4. Mention **@oss-maintainers** on any issue to escalate to the team — for example, if you encounter problems with the automated agents.
Override the default sysadmin-focused system prompt by creating:

## Code of Conduct
```
~/.config/warp-ai/system-prompt.txt
```

We ask everyone to be respectful and empathetic. Warp follows the [Code of Conduct](CODE_OF_CONDUCT.md). To report violations, email warp-coc at warp.dev.
---

## Open Source Dependencies
## Architecture

We'd like to call out a few of the [open source dependencies](https://docs.warp.dev/help/licenses) that have helped Warp to get off the ground:
```
User → Warp Terminal → WarpAiHarness → spawns `warp-ai` CLI → OpenAI-compatible API
run_command / read_file / write_file / list_directory
```

### Request Flow

```
1. User types prompt in Warp
2. WarpAiHarness writes prompt + system prompt to temp files
3. Spawns: warp-ai --prompt-file <path> --system-prompt-file <path>
4. CLI sends prompt + tools to LLM API
5. LLM responds with tool calls (e.g., run_command("mkdir deploy"))
6. CLI executes tools locally, sends results back to LLM
7. Repeat steps 5-6 until LLM says done
8. Response streams to Warp terminal
```

* [Tokio](https://github.com/tokio-rs/tokio)
* [NuShell](https://github.com/nushell/nushell)
* [Fig Completion Specs](https://github.com/withfig/autocomplete)
* [Warp Server Framework](https://github.com/seanmonstar/warp)
* [Alacritty](https://github.com/alacritty/alacritty)
* [Hyper HTTP library](https://github.com/hyperium/hyper)
* [FontKit](https://github.com/servo/font-kit)
* [Core-foundation](https://github.com/servo/core-foundation-rs)
* [Smol](https://github.com/smol-rs/smol)
---

## Files Added

| File | Purpose |
|------|---------|
| `crates/warp_ai_cli/Cargo.toml` | CLI crate definition |
| `crates/warp_ai_cli/src/main.rs` | Agent loop entry point |
| `crates/warp_ai_cli/src/client.rs` | OpenAI-compatible streaming client with tool call parsing |
| `crates/warp_ai_cli/src/config.rs` | Config resolution (env > CLI > config file) |
| `crates/warp_ai_cli/src/tools.rs` | Tool definitions and execution |
| `app/src/ai/agent_sdk/driver/harness/warp_ai.rs` | WarpAiHarness + WarpAiHarnessRunner |

## Files Modified

| File | Change |
|------|--------|
| `crates/warp_cli/src/agent.rs` | Added `Harness::WarpAi` enum variant |
| `app/src/terminal/cli_agent.rs` | Added `CLIAgent::WarpAi` + all match arms |
| `app/src/ai/agent_sdk/driver/harness/mod.rs` | Registered harness, added `requires_server_prompt_resolution()` |
| `app/src/ai/agent_sdk/driver.rs` | Server bypass guard in `prepare_harness()` |
| `app/src/ai/agent/conversation.rs` | Added `AIAgentHarness::WarpAi` |
| `app/src/ai/harness_display.rs` | Display name, icon, conversions |
| `app/src/ai/agent_sdk/mod.rs` | Telemetry label |
| `app/src/settings/ai.rs` | `DefaultHarness` enum + setting registration |
| `app/src/settings_view/features_page.rs` | Dropdown widget + auto-launch UI |
| `app/src/pane_group/mod.rs` | Auto-launch on new pane |
| `app/src/workspace/view.rs` | Auto-launch on new tab |
| `app/src/server/telemetry/events.rs` | `CLIAgentType::WarpAi` |
| `app/src/terminal/view/ambient_agent/*.rs` | UI updates |
| `app/src/pane_group/pane/local_harness_launch.rs` | Local launch support |
| `app/src/ai/blocklist/history_model/conversation_loader.rs` | Conversation loading |
| Various other files | Exhaustive match updates for new enum variants |

---

## Limitations

- **Agent mode only** — passive suggestions, autosuggestions, and AI command search still require Warp's backend
- **No conversation resume** — conversations are not persisted between sessions
- **No MCP tools** — the CLI uses its own built-in tools, not Warp's MCP tool system
- **Function calling required** — the LLM must support OpenAI-style function calling for the agent loop to work

---

## License

Same as upstream Warp:
- `warpui_core` and `warpui` crates: [MIT license](LICENSE-MIT)
- Everything else (including new code): [AGPL v3](LICENSE-AGPL)

## Credits

- [Warp](https://github.com/warpdotdev/warp) by the Warp team — the incredible terminal this is built on
- AI development assistance: [OpenClaude](https://github.com/anthropics/claude-code) with GLM-5.1
- Maintained by [goshitsarch](https://github.com/goshitsarch)
1 change: 1 addition & 0 deletions app/src/ai/agent/conversation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3525,6 +3525,7 @@ pub enum AIAgentHarness {
ClaudeCode,
Gemini,
Codex,
WarpAi,
Unknown,
}

Expand Down
48 changes: 28 additions & 20 deletions app/src/ai/agent_sdk/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1560,26 +1560,34 @@ impl AgentDriver {
skill,
attachments_dir,
} => {
let skill = skill
.as_ref()
.map(|parsed_skill| ResolvePromptAttachedSkill {
name: parsed_skill.name.clone(),
content: parsed_skill.content.clone(),
path: Some(parsed_skill.path.to_string_lossy().to_string()),
});
let request = ResolvePromptRequest {
skill,
attachments_dir: attachments_dir.clone(),
};
let resolved = server_api
.resolve_prompt(request)
.await
.map_err(AgentDriverError::PromptResolutionFailed)?;
(
Cow::Owned(resolved.prompt),
resolved.system_prompt,
resolved.resumption_prompt,
)
if !harness.requires_server_prompt_resolution() {
let prompt_text = skill
.as_ref()
.map(|s| s.content.clone())
.unwrap_or_default();
(Cow::Owned(prompt_text), None, None)
} else {
let skill = skill
.as_ref()
.map(|parsed_skill| ResolvePromptAttachedSkill {
name: parsed_skill.name.clone(),
content: parsed_skill.content.clone(),
path: Some(parsed_skill.path.to_string_lossy().to_string()),
});
let request = ResolvePromptRequest {
skill,
attachments_dir: attachments_dir.clone(),
};
let resolved = server_api
.resolve_prompt(request)
.await
.map_err(AgentDriverError::PromptResolutionFailed)?;
(
Cow::Owned(resolved.prompt),
resolved.system_prompt,
resolved.resumption_prompt,
)
}
}
};

Expand Down
Loading