# Installing Haystack

Set up Haystack on your GitHub repositories.

## Overview

Installing Haystack takes less than 2 minutes and gives you AI-powered code review on all your pull requests.

## Requirements

- A GitHub account
- At least one repository (public or private)
- Repository admin access (to install GitHub Apps)

## Sign in to haystackeditor.com

1. Visit [haystackeditor.com](https://haystackeditor.com)
2. Click "Sign in with GitHub"
3. Authorize the Haystack application

## Install Haystack

1. Visit the [Haystack GitHub App](https://github.com/apps/haystack-code-reviewer-pr-hook/installations/new)
2. Click "Install"
3. Choose which repositories to enable:
   - All repositories (recommended)
   - Or select specific repos

### Permissions

Haystack requests read-only access to:
- **Code**: To analyze PR diffs
- **Pull requests**: To fetch PR metadata
- **Issues**: To understand linked issues

We never write to your repository without explicit action.

## Configure Your Repo

For basic usage, no configuration is needed. Haystack works automatically.

To scan your repo for rules, CI signals, and review policies (recommended):

```bash
# Install the CLI
npm install -g @haystackeditor/cli

# Authenticate (GitHub device flow), then run the setup wizard
haystack login
haystack setup

# Non-interactive / coding-agent version
haystack setup --repo owner/name --yes
```

Coding agents: see the [agent setup skill](/skill.md) for the full non-interactive flow, including `haystack setup --json` (NDJSON agent mode) and the `haystack mcp` MCP server.

## Next Steps

- [Use PR Chat](/docs/pr-chat) - Chat with AI about your PR
- [Set up Verification](/docs/verification-flow) - Automated testing
- [Configure Auth](/docs/authentication) - For protected apps
