Skip to main content
This quickstart walks you through getting up and running with greg in your terminal: installing the standalone binary, setting up your preferred model provider, exploring a repository, applying safe code edits, verifying solutions with tests, and managing multi-turn sessions.
greg is distributed as a self-contained native binary with zero runtime dependencies. You do not need Node.js, Bun, or Python installed to run official releases. For manual downloads or building from source, see Installation.
This page covers:

Prerequisites

Before beginning, ensure you have:
  • A terminal emulator (bash, zsh, fish, or terminal multiplexer).
  • An existing project directory or Git repository to test in.
  • An API key for your preferred frontier AI model provider (Anthropic, Google Gemini, OpenAI, DeepSeek, Groq, or OpenRouter).

Step 1: Install Greg

Install greg using the official installation script for macOS, Linux, or WSL:
The script automatically detects your operating system and CPU architecture, downloads the matching precompiled binary, places it in ~/.greg/bin, and updates your shell profile (PATH). Once the installer completes, open a new terminal window and verify the installation:
You can update greg to the latest release at any time by running greg update.

Step 2: Configure Your Model Provider

Set your provider API key as an environment variable and configure your default frontier model. Choose your provider below:
Verify your active configuration:
Add your export statement to your shell profile (~/.zshrc or ~/.bashrc) so your credentials load automatically in every terminal session.

Step 3: Ask Your First Question

Navigate to any project repository:
Ask greg to inspect and summarize the codebase:
greg autonomously discovers your directory structure using Glob, inspects package manifests and configurations using Read, and streams a clean answer directly to stdout. Try more targeted exploration queries:
greg runs by default in fail-closed read-only mode. It can read files and query language servers to answer questions, but will never modify files or run dangerous commands without your explicit consent.

Step 4: Make Your First Code Change

To permit greg to create or edit files, pass --permission-mode acceptEdits:
greg will:
  1. Locate src/utils/strings.ts (or create it if it does not exist).
  2. Inspect your repository’s formatting, casing, and style conventions.
  3. Automatically record a pre-mutation snapshot checkpoint before touching disk.
  4. Apply the edits cleanly.

Safe Edits with Instant Rollback

Every file mutation made by greg is backed by a content-addressed snapshot. If you ever want to revert changes:

Step 5: Run Tests & Verify Solutions

Instruct greg to diagnose an issue and verify its fix by executing your test runner. Use --allowed-tools to authorize specific shell commands safely:
greg writes the test file, executes bun test, evaluates the test output, and resolves any assertion failures until all tests pass.

Step 6: Pipe Terminal Data into Greg

greg follows the Unix philosophy: clean Markdown and code stream to stdout, while diagnostic logs remain isolated on stderr. You can pipe data from standard terminal utilities directly into greg:

Step 7: Continue Conversations with -c

greg automatically organizes your work into workspace-scoped persistent threads. Use -c (or --continue) to continue your task across multiple turns without repeating context:
View past sessions in the current workspace:

Essential Commands Cheat Sheet


Next Steps

Now that you have completed your first task, explore these guides to unlock greg’s full capabilities:
  • Common Workflows: In-depth step-by-step recipes for bug fixing, refactoring, test generation, and CI automation.
  • Managing Threads: Master multi-turn persistence, time-travel branching (--resume-session-at), and checkpoint rollbacks.
  • Managing Providers: Configure credentials, base URL overrides, reasoning effort, and fallback chains across 13+ providers.
  • Installation Guide: Detailed setup for all operating systems, offline releases, and source compilation.