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

# Installation & Setup

> Install GlooCode and connect it to your Gloo AI account in under 5 minutes.

This guide walks you through installing GlooCode, connecting your Gloo AI credentials, and running your first task. The whole process takes about 5 minutes.

## Prerequisites

Before you start, make sure you have:

* **macOS or Linux** (ARM64 or x64) — see [platform support](/gloocode/overview#platform-support)
* **A Gloo AI account** — [sign up here](https://studio.ai.gloo.com/sign-up) if you don't have one
* **API credentials** — you'll create these in Step 2 below

## Step 1: Install the Binary

Run the installer script. It detects your OS and architecture, downloads the correct binary, and adds it to your PATH.

```bash theme={null}
curl -fsSL https://gloocode.ai.gloo.com/install.sh | sh
```

The installer places the binary in your PATH (typically `/usr/local/bin/gloocode` on macOS) and updates your shell profile if needed.

<Warning>
  **Open a new terminal window** after installing. Your current session won't have the updated PATH until you do.
</Warning>

Verify it worked in a new terminal:

```bash theme={null}
gloocode --version
```

If you see a version number, the install succeeded. If you get "command not found", see [Troubleshooting](#command-not-found-gloocode) below.

## Step 2: Connect Your Credentials

GlooCode needs a **Client ID** and **Client Secret** to authenticate with Gloo AI. These are the same credentials used by the [Completions API](/api-guides/completions-v2) and [SDKs](/api-guides/sdks-and-libraries) — if you already have a set, you can reuse them.

### Option A: Let GlooCode prompt you (easiest)

If you launch GlooCode without credentials configured, it will automatically prompt you to enter your Client ID and Client Secret interactively. Just run `gloocode` and follow the prompts.

### Option B: Set environment variables

If you prefer to configure credentials ahead of time (or want them available to scripts and CI), add them to your shell profile (`~/.zshrc`, `~/.bashrc`, or `~/.config/fish/config.fish`):

```bash theme={null}
export GLOO_AI_CLIENT_ID=<your-client-id>
export GLOO_AI_CLIENT_SECRET=<your-client-secret>
```

Then open a new terminal or reload your shell:

```bash theme={null}
source ~/.zshrc   # or ~/.bashrc
```

### Getting your credentials

If you don't have credentials yet:

1. Sign in to [Gloo AI Studio](https://studio.ai.gloo.com/)
2. Go to **API Credentials** in the sidebar (or [open it directly](https://studio.ai.gloo.com/api-credentials))
3. Click **Create New Key** — copy both the **Client ID** and **Client Secret**

<Warning>
  GlooCode cannot function without these credentials. Every model request routes through your Gloo AI account, so there is no way to skip this step.
</Warning>

<Tip>
  If you don't have a Gloo AI account yet, [create one](https://studio.ai.gloo.com/sign-up) and set up billing to enable API access. The [Developer Quickstart](/getting-started/quickstart-developers) walks through account setup step by step.
</Tip>

### Changing credentials later

To switch to different credentials, update the environment variables in your shell profile and open a new terminal. GlooCode reads credentials fresh on each launch.

## Step 3: Launch GlooCode

Navigate to any project directory and start GlooCode:

```bash theme={null}
cd ~/my-project
gloocode
```

You'll land in the **TUI** (terminal user interface). Type a task in natural language and GlooCode will plan the approach, write the code, run tests, and commit the result. You can review and approve every change before it lands.

### Example Prompts

Not sure what to try first? Here are some good starting points:

| Prompt                                                  | What GlooCode will do                                      |
| ------------------------------------------------------- | ---------------------------------------------------------- |
| `Explain this codebase`                                 | Read your project structure and give you an overview       |
| `Add input validation to the signup form`               | Find the form, add validation logic, write tests           |
| `Find and fix the failing test in src/auth`             | Diagnose the failure, fix the root cause, verify it passes |
| `Refactor the payment module to use the new Stripe API` | Plan the migration, update the code, run tests             |

## Updating GlooCode

Re-run the installer to update to the latest version:

```bash theme={null}
curl -fsSL https://gloocode.ai.gloo.com/install.sh | sh
```

The installer checks your current version and only downloads if an update is available.

You can also use the built-in update command:

```bash theme={null}
gloocode update
```

## Troubleshooting

### "Authentication failed" or "No credentials found"

GlooCode can't find or validate your API credentials. Check that your environment variables are set:

```bash theme={null}
echo $GLOO_AI_CLIENT_ID
echo $GLOO_AI_CLIENT_SECRET
```

If either prints empty, add them to your shell profile and reload (see [Step 3](#step-3-configure-your-environment)). If both are set but authentication still fails, verify the values match what's shown on the [API Credentials page](https://studio.ai.gloo.com/api-credentials) in Studio.

### "Command not found: gloocode"

The most common cause is running the command in the same terminal session where you installed. Open a **new** terminal window and try again.

If it still doesn't work, check where the binary was installed:

```bash theme={null}
which gloocode       # should show /usr/local/bin/gloocode or ~/bin/gloocode
ls /usr/local/bin/gloocode ~/bin/gloocode 2>/dev/null
```

If the binary exists but isn't on your PATH, add its directory manually:

```bash theme={null}
export PATH="/usr/local/bin:$HOME/bin:$PATH"
```

Add this line to your shell profile (`~/.zshrc` or `~/.bashrc`) so it persists across sessions.

### Unexpected update prompts

If GlooCode shows update prompts for versions that don't match the latest GlooCode release, you may have both GlooCode and OpenCode (the open-source project GlooCode is built on) installed. The two share some internal configuration, and OpenCode's update mechanism can interfere.

To fix this, remove the OpenCode binary and keep only GlooCode:

```bash theme={null}
which opencode       # find where it's installed
rm $(which opencode) # remove it
```

Then restart GlooCode — the spurious update prompts should stop.

### Binary won't run on Linux

On older Linux systems, the installer may select the wrong libc variant. If you see errors about missing shared libraries:

* Check your libc: `ldd --version` (glibc) or `musl-ldd --version` (musl)
* The installer auto-detects this, but you can also download the correct variant manually from the install URL

## Next Steps

<CardGroup cols={2}>
  <Card title="Agents" icon="users" href="/gloocode/agents">
    Learn about the four built-in agents and how to create custom agents for specialized workflows.
  </Card>

  <Card title="Supported Models" icon="microchip" href="/api-guides/supported-models">
    See all available models — any of them can power your custom GlooCode agents.
  </Card>
</CardGroup>
