> For the complete documentation index, see [llms.txt](https://docs.tensorx.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tensorx.ai/ai-coding-assistants/goose.md).

# Goose

Use TensorX models with Goose — the open-source, on-machine AI agent by Block (Square).

***

## Overview

[Goose](https://block.github.io/goose) is an open-source AI agent built by Block (formerly Square) that runs on your machine and helps with coding, DevOps, and general development tasks. With 32K+ GitHub stars and support for declarative custom providers, it's easy to connect to TensorX.

{% hint style="success" %}
**Why Goose + TensorX?**

* 🪿 **On-machine agent** — Runs locally, full access to your filesystem and tools
* 🔌 **MCP support** — Connect to any tool via Model Context Protocol extensions
* 🖥️ **Desktop + CLI** — Electron desktop app and terminal interface
* 🔒 **Privacy-first** — Your code stays on your machine, EU-hosted models
* 💰 **Cost-effective** — Powerful open-source models at a fraction of the cost
  {% endhint %}

***

## Prerequisites

* **macOS, Linux, or Windows**
* A TensorX API key ([sign up here](https://app.tensorx.ai/register))

***

## Installation

{% tabs %}
{% tab title="macOS (Homebrew)" %}

```bash
brew install block/tap/goose
```

{% endtab %}

{% tab title="Linux / macOS (curl)" %}

```bash
curl -fsSL https://github.com/block/goose/releases/latest/download/download_cli.sh | bash
```

{% endtab %}

{% tab title="Desktop App" %}
Download from [block.github.io/goose](https://block.github.io/goose)
{% endtab %}
{% endtabs %}

***

## Configuration

### Option 1: Using OpenAI-Compatible Provider

Set environment variables and configure Goose:

```bash
export TENSORX_API_KEY=your-tensorx-api-key-here
```

Then configure via the CLI:

```bash
goose configure
```

When prompted:

1. Choose **OpenAI Compatible** as the provider
2. Enter `https://api.tensorx.ai/v1` as the base URL
3. Enter your model name: `z-ai/glm-5.1`

### Option 2: Settings File

Edit `~/.config/goose/config.yaml`:

```yaml
GOOSE_PROVIDER: openai-compatible
GOOSE_MODEL: z-ai/glm-5.1
OPENAI_BASE_URL: https://api.tensorx.ai/v1
OPENAI_API_KEY: your-tensorx-api-key-here
```

{% hint style="warning" %}
Replace `your-tensorx-api-key-here` with your actual TensorX API key from [app.tensorx.ai](https://app.tensorx.ai/dashboard).
{% endhint %}

***

## Recommended Models

| Use Case      | Model                         | Why                                       |
| ------------- | ----------------------------- | ----------------------------------------- |
| **Coding** ⭐  | `z-ai/glm-5.1`                | Best coding performance, strong reasoning |
| **Reasoning** | `deepseek/deepseek-r1-0528`   | Complex analysis and planning             |
| **Functions** | `minimax/minimax-m2.5`        | Function calling, reasoning               |
| **Vision**    | `moonshotai/kimi-k2.5`        | Image understanding, large context        |
| **General**   | `deepseek/deepseek-chat-v3.1` | Balanced performance and cost             |
| **Fast**      | `minimax/minimax-m2`          | Quick responses, cost-sensitive           |

***

## Usage

Start an interactive session:

```bash
goose session
```

Or run a one-shot command:

```bash
goose run "refactor the auth module to use JWT tokens"
```

Goose can:

* Read and edit files in your project
* Run terminal commands
* Search your codebase
* Connect to external tools via MCP extensions

***

## Troubleshooting

### Model Not Responding

1. Verify your API key: `echo $TENSORX_API_KEY`
2. Test the connection:

   ```bash
   curl https://api.tensorx.ai/v1/models \
     -H "Authorization: Bearer $TENSORX_API_KEY"
   ```

### Provider Not Found

Run `goose configure` to reconfigure your provider settings.

***

## See Also

* [Goose Documentation](https://block.github.io/goose)
* [Goose on GitHub](https://github.com/block/goose)
* [Goose Custom Providers](https://github.com/block/goose/blob/main/CUSTOM_DISTROS.md)
* [TensorX Models](https://tensorx.ai/models)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.tensorx.ai/ai-coding-assistants/goose.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.
