---
title: Installation
description: Install the TheGitAI AI coding assistant with npm, sign in, open a repository, and hand it a real task. Works on macOS, Linux, and Windows.
---

# Installation

This page installs the CLI, a command-line tool called `ai`. For the desktop
app, see [Install the Desktop App](/docs/desktop/install-the-desktop-app).

## Install with npm

```bash
npm i -g @thegitai/cli
```

This installs the `ai` command globally so you can run it from inside any
repository.

## Verify the install

```bash
ai --help
```

You should see the usage summary. If `ai` isn't found, make sure your global
npm bin directory is on your `PATH`.

::tip
TheGitAI works on the repo in your current working directory. `cd` into a
project first, then run `ai`.
::

## Staying up to date

`ai` checks on every start whether a newer release is published, and offers to
install it for you. TheGitAI works best on the latest version, and an older CLI
may not work optimally. You can skip the offer for that start, but it asks again
next time - see
[CLI Reference](/docs/reference/cli-reference#updates).

## Start the first session

Move into a real repository and launch the agent. There is no separate sign-in
step: if you aren't signed in, `ai` shows the sign-in screen first and then
starts the session.

```bash
cd your-project
ai
```

Then ask for the complete result, including the validation you want:

```text
Trace the failing API test, fix the underlying bug, run the focused suite, and
review the final diff for regressions.
```

See [Authentication](/docs/getting-started/authentication) for browser and
headless sign-in, or [What It Can Do](/docs/core-features/what-it-can-do) for the
complete capability guide.
