> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/block/goose/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment Variables

> Complete reference for Goose environment variables

Goose supports extensive configuration through environment variables, allowing you to override settings, customize behavior, and integrate with CI/CD pipelines.

## Provider Configuration

### GOOSE\_PROVIDER

Override the configured provider.

**Values**: Provider name (e.g., `anthropic`, `openai`, `databricks`)

**Example**:

```bash theme={null}
export GOOSE_PROVIDER=anthropic
goose session start
```

**Default**: Value from `~/.config/goose/config.yaml`

### GOOSE\_MODEL

Override the configured model.

**Values**: Model identifier (e.g., `claude-4.5-sonnet`, `gpt-4`)

**Example**:

```bash theme={null}
export GOOSE_MODEL=claude-4.5-sonnet
goose session start
```

**Default**: Value from configuration

### Provider-Specific API Keys

Each provider has its own API key environment variable:

#### Anthropic

```bash theme={null}
export ANTHROPIC_API_KEY=sk-ant-...
```

#### OpenAI

```bash theme={null}
export OPENAI_API_KEY=sk-...
```

#### OpenRouter

```bash theme={null}
export OPENROUTER_API_KEY=sk-or-...
```

#### Databricks

```bash theme={null}
export DATABRICKS_HOST=https://your-workspace.databricks.com
export DATABRICKS_TOKEN=dapi...
```

#### Google

```bash theme={null}
export GOOGLE_API_KEY=AIza...
```

#### Groq

```bash theme={null}
export GROQ_API_KEY=gsk_...
```

#### Ollama

```bash theme={null}
export OLLAMA_HOST=http://localhost:11434
```

## Mode Configuration

### GOOSE\_MODE

Set the operational mode for goose.

**Values**:

* `auto`: Full autonomy, no approval required
* `approve`: All actions require approval
* `smart_approve`: File modifications require approval
* `chat`: No tools or file modifications

**Example**:

```bash theme={null}
export GOOSE_MODE=smart_approve
goose session start
```

**Default**: `auto`

**Use cases**:

* `auto`: Rapid development, trusted environments
* `approve`: Maximum control, learning goose
* `smart_approve`: Balance of speed and safety
* `chat`: Simple Q\&A, no file access

## Telemetry and Privacy

### GOOSE\_TELEMETRY\_OFF

Disable anonymous telemetry collection.

**Values**: `1` or `true` to disable

**Example**:

```bash theme={null}
export GOOSE_TELEMETRY_OFF=1
```

**Default**: Telemetry enabled (opt-in during setup)

**What we collect**:

* Operating system and version
* Provider and model used
* Extension usage counts (names only)
* Session metrics (duration, tokens)
* Error types (no messages)

**What we never collect**:

* Conversation content
* Code or file contents
* API keys or credentials
* Personal information

## CLI Behavior

### GOOSE\_CLI\_MIN\_PRIORITY

Control tool output verbosity in CLI.

**Values**: Float from `0.0` to `1.0`

* `0.0`: Show all tool output
* `0.2`: Medium importance and above
* `0.8`: High importance only

**Example**:

```bash theme={null}
# Show only important output
export GOOSE_CLI_MIN_PRIORITY=0.8
goose session start
```

**Default**: `0.0` (show all)

**Configuration via CLI**:

```bash theme={null}
goose configure
# Select "goose settings" > "Tool Output"
```

### GOOSE\_WORKING\_DIR

Set default working directory for sessions.

**Example**:

```bash theme={null}
export GOOSE_WORKING_DIR=/path/to/project
goose session start
```

**Default**: Current directory

## Security Configuration

### GOOSE\_DISABLE\_KEYRING

Disable system keyring, use file-based secret storage.

**Values**: `1`, `true`, or any non-empty string

**Example**:

```bash theme={null}
export GOOSE_DISABLE_KEYRING=true
goose configure
```

**Default**: Keyring enabled

**Platforms**:

* macOS: Uses system Keychain
* Windows: Uses Credential Manager
* Linux: Uses Secret Service (requires D-Bus)

**Security note**: File-based storage saves secrets to `~/.config/goose/secrets.yaml` in plain text. Only use when keyring is unavailable.

## Extension Configuration

### Extension Environment Variables

Extensions can define custom environment variables. Common patterns:

```bash theme={null}
# API keys for extension services
export GDRIVE_API_KEY=your-key
export SLACK_BOT_TOKEN=xoxb-...

# Service endpoints
export WIKI_SERVER_URL=http://localhost:8000
export MCP_SERVER_URL=http://localhost:3000/messages

# Extension-specific settings
export MEMORY_STORAGE_PATH=/custom/path
export DEVELOPER_SHELL=/bin/zsh
```

Refer to extension documentation for specific variables.

## Advanced Configuration

### GOOSE\_TOOLSHIM

Enable experimental tool shimming with local models.

**Values**: `1` or `true`

**Example**:

```bash theme={null}
export GOOSE_TOOLSHIM=true
export GOOSE_TOOLSHIM_OLLAMA_MODEL=llama3.2
goose session start
```

**Use case**: Use local model to interpret tool calls from providers without native tool support.

### GOOSE\_TOOLSHIM\_OLLAMA\_MODEL

Specify Ollama model for tool shimming.

**Example**:

```bash theme={null}
export GOOSE_TOOLSHIM_OLLAMA_MODEL=qwen3
```

**Requires**: `GOOSE_TOOLSHIM=true`

### Max Turns Configuration

Limit autonomous agent turns before requiring user input.

**Configuration via settings**:

```bash theme={null}
goose configure
# Select "goose settings" > "Max Turns"
```

## Claude-Specific Configuration

### CLAUDE\_THINKING\_TYPE

Configure extended thinking mode for Claude models.

**Values**:

* `adaptive`: Claude decides when to think (recommended)
* `enabled`: Fixed token budget for thinking
* `disabled`: No extended thinking

**Example**:

```bash theme={null}
export CLAUDE_THINKING_TYPE=adaptive
```

**Supported models**: claude-4.5-sonnet and newer

### CLAUDE\_THINKING\_EFFORT

Set adaptive thinking effort level.

**Values**:

* `low`: Minimal thinking
* `medium`: Moderate thinking
* `high`: Deep reasoning (default)
* `max`: No constraints (Opus 4.6 only)

**Example**:

```bash theme={null}
export CLAUDE_THINKING_TYPE=adaptive
export CLAUDE_THINKING_EFFORT=high
```

### CLAUDE\_THINKING\_BUDGET

Set fixed token budget for thinking mode.

**Values**: Integer (tokens)

**Example**:

```bash theme={null}
export CLAUDE_THINKING_TYPE=enabled
export CLAUDE_THINKING_BUDGET=16000
```

## Gemini-Specific Configuration

### GEMINI\_THINKING\_LEVEL

Configure thinking level for Gemini 3 models.

**Values**:

* `low`: Better latency, lighter reasoning
* `high`: Deeper reasoning, higher latency

**Example**:

```bash theme={null}
export GEMINI_THINKING_LEVEL=high
```

## Development and Debugging

### RUST\_LOG

Control Rust logging verbosity.

**Values**:

* `error`: Only errors
* `warn`: Warnings and errors
* `info`: General information
* `debug`: Detailed debugging
* `trace`: Very verbose

**Example**:

```bash theme={null}
export RUST_LOG=debug
goose session start
```

Module-specific logging:

```bash theme={null}
export RUST_LOG=goose=debug,goose_mcp=trace
```

### GOOSE\_TEST\_ERROR

Enable test error mode in desktop app (development only).

**Example**:

```bash theme={null}
export GOOSE_TEST_ERROR=true
npm run start:test-error
```

## CI/CD Integration

Example GitHub Actions workflow:

```yaml theme={null}
name: Code Review
on: [pull_request]

jobs:
  review:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      
      - name: Install Goose
        run: |
          curl -fsSL https://getgoose.ai/install.sh | bash
      
      - name: Run Review
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
          GOOSE_PROVIDER: anthropic
          GOOSE_MODEL: claude-4.5-sonnet
          GOOSE_MODE: auto
          GOOSE_TELEMETRY_OFF: 1
        run: |
          goose run --recipe code-review
```

## Configuration Precedence

Goose loads configuration in this order (highest to lowest priority):

1. **Environment variables** (highest priority)
2. **Configuration file** (`~/.config/goose/config.yaml`)
3. **Default values** (lowest priority)

**Example**:

```bash theme={null}
# config.yaml has GOOSE_PROVIDER=openai
# This overrides it:
export GOOSE_PROVIDER=anthropic
goose session start  # Uses anthropic
```

## Secrets Precedence

Secrets follow this precedence:

1. **Environment variables** (e.g., `ANTHROPIC_API_KEY`)
2. **System keyring** (if enabled)
3. **Secrets file** (`~/.config/goose/secrets.yaml` if keyring disabled)

**Security best practice**: Use environment variables in CI/CD, keyring for local development.

## Common Patterns

### Project-Specific Configuration

Create `.env` file in project root:

```bash theme={null}
# .env
GOOSE_MODE=smart_approve
GOOSE_WORKING_DIR=/workspace/myproject
GOOSE_CLI_MIN_PRIORITY=0.2
```

Load and run:

```bash theme={null}
source .env
goose session start
```

### Multiple Provider Setup

Switch between providers:

```bash theme={null}
# Use Anthropic
alias goose-claude="GOOSE_PROVIDER=anthropic GOOSE_MODEL=claude-4.5-sonnet goose"

# Use OpenAI
alias goose-gpt="GOOSE_PROVIDER=openai GOOSE_MODEL=gpt-4 goose"

goose-claude session start
```

### Secure CI Configuration

```bash theme={null}
# Never hardcode secrets
# Use CI secret management:
export ANTHROPIC_API_KEY=${{ secrets.ANTHROPIC_API_KEY }}

# Disable telemetry in CI
export GOOSE_TELEMETRY_OFF=1

# Use auto mode for automation
export GOOSE_MODE=auto
```

## Platform-Specific Paths

### macOS/Linux

* Config: `~/.config/goose/config.yaml`
* Secrets: `~/.config/goose/secrets.yaml`
* Sessions: `~/.config/goose/sessions/`
* Logs: `~/.local/share/goose/logs/`

### Windows

* Config: `%APPDATA%\goose\config.yaml`
* Secrets: `%APPDATA%\goose\secrets.yaml`
* Sessions: `%APPDATA%\goose\sessions\`
* Logs: `%APPDATA%\goose\logs\`

## Troubleshooting

### Verify environment variables

```bash theme={null}
env | grep GOOSE
env | grep ANTHROPIC
```

### Test configuration

```bash theme={null}
goose info  # Shows active configuration
```

### Clear and reconfigure

```bash theme={null}
# Backup current config
cp ~/.config/goose/config.yaml ~/.config/goose/config.yaml.bak

# Remove config
rm -rf ~/.config/goose/

# Reconfigure
goose configure
```
