feat: adds cursor-agent as a cli provider (#4101)
Signed-off-by: Roshan Bhatia <rshnbhatia@gmail.com> Co-authored-by: Michael Neale <michael.neale@gmail.com> Co-authored-by: Angie Jones <jones.angie@gmail.com>
This commit is contained in:
@@ -45,6 +45,7 @@ Goose also supports special "pass-through" providers that work with existing CLI
|
||||
| Provider | Description | Requirements |
|
||||
|-----------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| [Claude Code](https://www.anthropic.com/claude-code) (`claude-code`) | Uses Anthropic's Claude CLI tool with your Claude Code subscription. Provides access to Claude with 200K context limit. | Claude CLI installed and authenticated, active Claude Code subscription |
|
||||
| [Cursor Agent](https://docs.cursor.com/en/cli/overview) (`cursor-agent`) | Uses Cursor's AI CLI tool with your Cursor subscription. Provides access to GPT-5, Claude 4, and other models through the cursor-agent command-line interface. | cursor-agent CLI installed and authenticated |
|
||||
| [Gemini CLI](https://ai.google.dev/gemini-api/docs) (`gemini-cli`) | Uses Google's Gemini CLI tool with your Google AI subscription. Provides access to Gemini with 1M context limit. | Gemini CLI installed and authenticated |
|
||||
|
||||
:::tip CLI Providers
|
||||
@@ -144,14 +145,7 @@ To configure your chosen provider or see available options, run `goose configure
|
||||
│
|
||||
◓ Checking your configuration...
|
||||
└ Configuration saved successfully
|
||||
```
|
||||
Set the model for an individual session using the [`run` command](/docs/guides/goose-cli-commands.md#run-options):
|
||||
|
||||
```bash
|
||||
goose run --model goose-claude-4-sonnet -t "initial prompt"
|
||||
```
|
||||
|
||||
|
||||
```
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
|
||||
@@ -2,18 +2,22 @@
|
||||
sidebar_position: 8
|
||||
title: CLI Providers
|
||||
sidebar_label: CLI Providers
|
||||
description: Use Claude Code or Gemini CLI subscriptions in Goose
|
||||
description: Use Claude Code, Cursor Agent, or Gemini CLI subscriptions in Goose
|
||||
---
|
||||
|
||||
# CLI Providers
|
||||
|
||||
Goose supports pass-through providers that integrate with existing CLI tools from Anthropic and Google. These providers allow you to use your existing Claude Code and Google Gemini CLI subscriptions through Goose's interface, adding session management, persistence, and workflow integration capabilities to these tools.
|
||||
Goose can make use of pass-through providers that integrate with existing CLI tools from Anthropic, Cursor, and Google. These providers allow you to use your existing Claude Code, Cursor Agent, and Google Gemini CLI subscriptions through Goose's interface, adding session management, persistence, and workflow integration capabilities to these tools.
|
||||
|
||||
:::warning
|
||||
|
||||
These providers don’t fully support all Goose features, may have platform or capability limitations, and can sometimes require advanced debugging if issues arise. They’re included here purely as a convenience.
|
||||
|
||||
## Why Use CLI Providers?
|
||||
|
||||
CLI providers are useful if you:
|
||||
|
||||
- already have a Claude Code or Google Gemini CLI subscription and want to use it through Goose instead of paying per token
|
||||
- already have a Claude Code, Cursor, or Google Gemini CLI subscription and want to use it through Goose instead of paying per token
|
||||
- need session persistence to save, resume, and export conversation history
|
||||
- want to use Goose recipes and scheduled tasks to create repeatable workflows
|
||||
- prefer unified commands across different AI providers
|
||||
@@ -57,6 +61,20 @@ The Claude Code provider integrates with Anthropic's [Claude CLI tool](https://c
|
||||
- Active Claude Code subscription
|
||||
- CLI tool authenticated with your Anthropic account
|
||||
|
||||
### Cursor Agent
|
||||
|
||||
The Cursor provider integrates with Cursor's [CLI agent](https://docs.cursor.com/en/cli/installation), providing access to through your existing subscription.
|
||||
|
||||
**Features:**
|
||||
|
||||
- integrates with Cursor Agent CLI coding tasks.
|
||||
- ideal for code-related workflows and file interactions.
|
||||
|
||||
**Requirements:**
|
||||
|
||||
- cursor-agent tool installed and configured.
|
||||
- CLI tool authenticated.
|
||||
|
||||
### Gemini CLI
|
||||
|
||||
The Gemini CLI provider integrates with Google's [Gemini CLI tool](https://ai.google.dev/gemini-api/docs), providing access to Gemini models through your Google AI subscription.
|
||||
@@ -103,6 +121,40 @@ The Gemini CLI provider integrates with Google's [Gemini CLI tool](https://ai.go
|
||||
◇ Enter a model from that provider:
|
||||
│ default
|
||||
```
|
||||
## Cursor Agent
|
||||
|
||||
1. **Install Cursor agent Tool**
|
||||
|
||||
Follow the [installation instructions for Cursor Agent](https://docs.cursor.com/en/cli/installation) to install and configure the cursor agent tool.
|
||||
|
||||
2. **Authenticate with Cursor**
|
||||
|
||||
Ensure your Cursor Agent is authenticated and working
|
||||
|
||||
3. **Configure goose**
|
||||
|
||||
Set the provider environment variable:
|
||||
|
||||
```bash
|
||||
export goose_provider=cursor-agent
|
||||
```
|
||||
|
||||
Or configure through the Goose CLI using `goose configure`:
|
||||
|
||||
```bash
|
||||
┌ goose-configure
|
||||
│
|
||||
◇ What would you like to configure?
|
||||
│ configure providers
|
||||
│
|
||||
◇ Which model provider should we use?
|
||||
│ Cursor Agent
|
||||
│
|
||||
◇ Model fetch complete
|
||||
│
|
||||
◇ Enter a model from that provider:
|
||||
│ default
|
||||
```
|
||||
|
||||
### Gemini CLI
|
||||
|
||||
@@ -171,6 +223,14 @@ goose session
|
||||
| `GOOSE_PROVIDER` | Set to `claude-code` to use this provider | None |
|
||||
| `CLAUDE_CODE_COMMAND` | Path to the Claude CLI command | `claude` |
|
||||
|
||||
|
||||
### Cursor Agent Configuration
|
||||
|
||||
| Environment Variable | Description | Default |
|
||||
|---------------------|-------------|---------|
|
||||
| `GOOSE_PROVIDER` | Set to `cursor-agent` to use this provider | None |
|
||||
| `CURSOR_AGENT_COMMAND` | Path to the Cursor Agent command | `cursor-agent` |
|
||||
|
||||
### Gemini CLI Configuration
|
||||
|
||||
| Environment Variable | Description | Default |
|
||||
@@ -182,16 +242,18 @@ goose session
|
||||
|
||||
### System Prompt Filtering
|
||||
|
||||
Both CLI providers automatically filter out Goose's extension information from system prompts since these CLI tools have their own tool ecosystems. This prevents conflicts and ensures clean interaction with the underlying CLI tools.
|
||||
The CLI providers automatically filter out Goose's extension information from system prompts since these CLI tools have their own tool ecosystems. This prevents conflicts and ensures clean interaction with the underlying CLI tools.
|
||||
|
||||
### Message Translation
|
||||
|
||||
- **Claude Code**: Converts Goose messages to Claude's JSON message format, handling tool calls and responses appropriately
|
||||
- **Cursor Agent**: Converts Goose messages to Cursor's JSON message format, handling tool calls and responses appropriately
|
||||
- **Gemini CLI**: Converts messages to simple text prompts with role prefixes (Human:/Assistant:)
|
||||
|
||||
### Response Processing
|
||||
|
||||
- **Claude Code**: Parses JSON responses to extract text content and usage information
|
||||
- **Cursor Agent**: Parses JSON responses to extract text content and usage information
|
||||
- **Gemini CLI**: Processes plain text responses from the CLI tool
|
||||
|
||||
## Error Handling
|
||||
|
||||
Reference in New Issue
Block a user