---
title: Installation
description: Install GitKB and initialize your first knowledge base.
---

# Installation

## Install the GitKB CLI

GitKB is distributed as a single binary. Install it with your preferred method:

### Homebrew (macOS)

```bash
brew install gitkb/tap/gitkb
```

### Install script (macOS / Linux)

```bash
curl -fsSL https://get.gitkb.com/install.sh | bash
```

### mise

Install release builds from GitHub via [mise](https://mise.jdx.dev/):

```bash
mise use github:gitkb/gitkb-releases
```

Run in your project to record the tool in mise config, or configure globally per [mise docs](https://mise.jdx.dev/).

### Verify installation

```bash
git-kb --version
```

If you use GitKB Desktop with mise, ensure your shell `PATH` includes mise shims, or choose the `git-kb` binary in Desktop Settings when the app is launched from Finder.

## Initialize a knowledge base

Navigate to your project root and initialize:

```bash
cd your-project
git-kb init
```

This creates a `.kb/` directory in your project root with the knowledge base and its configuration.

## What's in `.kb/`?

```
.kb/
├── .gitignore       # Commits only the shared files below
├── config.toml      # KB configuration
├── AGENTS.md        # Agent guide for this KB
├── rules/           # Shared agent rules (when installed)
├── skills/          # Shared agent skills (when installed)
└── workspaces/      # Pending edits, isolated by Git worktree
    └── main/        # Default checkout workspace
```

GitKB keeps your committed documents and history in its own local store under `.kb/`, along with indexes it can rebuild. Edit documents through the checkout workspace, then use `git-kb commit` to record the changes; leave every other file under `.kb/` to GitKB.

The generated `.kb/.gitignore` commits only `.gitignore`, `config.toml`, `AGENTS.md`, `rules/` and `skills/` to your Git repository. The store, indexes, locks and workspaces stay local: teammates fetch documents from a remote or rebuild them. Add your own lines at the end of `.kb/.gitignore`; a later line wins.

Ask GitKB for the current workspace rather than assuming a path, especially in a linked Git worktree:

```bash
git-kb workspace resolve --json
```

## Optional: colorized Markdown output

GitKB can pipe `git-kb show` output through [glow](https://github.com/charmbracelet/glow) for syntax-highlighted, styled Markdown in your terminal.

Install glow via Homebrew or [see glow's install docs](https://github.com/charmbracelet/glow#installation) for other methods:

```bash
brew install glow
```

Then add to `.kb/config.toml`:

```toml
[pager]
markdown = "glow -p -w 0"
```

See [Configuration](/docs/reference/configuration/) for details.

## Start using code intelligence immediately

Code intelligence works on any Git repo right after installation — no `git-kb init` required:

```bash
cd your-project
git-kb code index
git-kb code symbols authenticate --json
git-kb code callers authenticate --json
```

See [Code Intelligence](/docs/core-concepts/code-intelligence/) for the full command reference, or continue to the [Quick Start](/docs/getting-started/quick-start/) for the full setup.

## Next steps

- [Quick Start](/docs/getting-started/quick-start/) — Create and sync project documents
- [Code Intelligence](/docs/core-concepts/code-intelligence/) — Start with code intelligence alone
