#### Getting started

# Terminal UI

The Grok Build TUI runs Grok Build in your terminal as the `grok` command. Use it interactively, headlessly in scripts or bots, or through the Agent Client Protocol (ACP) in other apps. For the desktop app, see the [Agents Window](/build).

## Install

Run the command for your system. It downloads the latest stable release and adds `grok` to your `PATH`:

```bash customLanguage="bashMacLinux"
curl -fsSL https://x.ai/cli/install.sh | bash
```

```bash customLanguage="powershell"
irm https://x.ai/cli/install.ps1 | iex
```

## Run Grok

Start Grok in your project folder:

```bash customLanguage="bash"
cd your-project
grok
```

If your shell can't find `grok`, open a new terminal.

On first launch, Grok opens your browser to sign in, and keeps you signed in after that. If there is no browser, use another method:

| Where you're working | Sign in with | Command |
| -------------------- | ------------ | ------- |
| Your own machine | Browser | `grok` |
| SSH or a remote machine | Device code | `grok login --device-auth` |
| CI and scripts | API key | `export XAI_API_KEY="xai-..."` |

For every sign-in option, see [Authentication](/build/enterprise#authentication).

## Ask your first question

At the prompt, start with a question that works in any repository:

```text
Explain this repo.
```

Grok reads the files it needs, shows each step as it runs, and answers with a summary of the codebase. Once you see that, the install, sign-in and project are all working.

Then point it at a file with `@`:

```text
@src/main.rs Walk me through this file.
```

In a session, `/usage` shows your credit usage.

## Run headlessly

Headless mode is ideal for scripts, automations, or integration into other apps:

```bash customLanguage="bash"
grok -p "Explain this codebase"
grok -p "Explain the architecture" --output-format streaming-json
```

For its flags and output formats, see [Headless and Scripting](/build/cli/headless-scripting).

## Update

One command updates Grok for both interactive and headless use:

```bash customLanguage="bash"
grok update
```

To see what each release changed, read the [Changelog](https://x.ai/changelog/build).

## Requirements

* macOS (Apple silicon or Intel) or Linux (x86\_64 or arm64). On Windows, use PowerShell, Git Bash or WSL.
* A terminal, and a project folder to run Grok in.
* A SpaceXSI account to sign in with, or an API key.

## Features

* [Plugins, skills](/build/features/skills-plugins-marketplaces) and [MCP servers](/build/features/mcp-servers). Extend what Grok can do.
* [Agent Dashboard](/build/features/dashboard). Every session at a glance, and which agents need input.
* [Modes and Commands](/build/modes-and-commands). Switch modes with Shift+Tab and use slash commands.
* [CLI Reference](/build/cli/reference). The `grok` subcommands and common flags.

## Next

* [Custom Models](/build/settings/reference#modelid). Use any model through `~/.grok/config.toml`.
* [Grok 4.7 on the API](/developers/grok-4-7#using-the-api). Call the model from your own agent or tool.
* [Enterprise Deployments](/build/enterprise)
* [Grok Bot](/grok-bot/overview): AI teammates on a cloud computer
