> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lyzr.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Build and run your first GitAgent in 5 minutes.

## Prerequisites

* Python 3.9+
* An OpenAI API key (or any supported model provider)
* Git

## Step 1: Install GitAgent

```bash theme={null}
pip install gitagent
```

## Step 2: Initialize a new agent

```bash theme={null}
mkdir my-agent && cd my-agent
git init
gitagent init
```

`gitagent init` creates the OpenGAP directory structure:

```
my-agent/
├── agent.yaml
├── skills/
│   └── hello.py
├── hooks/
└── flows/
```

## Step 3: Review the manifest

Open `agent.yaml`:

```yaml theme={null}
name: my-agent
version: "1.0.0"
description: "My first GitAgent"

model:
  provider: openai
  name: gpt-4o
  temperature: 0.0

entrypoint: skills/hello.py

memory:
  enabled: false
```

## Step 4: Look at the sample skill

Open `skills/hello.py`:

```python theme={null}
from gitagent import skill

@skill(
    name="greet",
    description="Greet the user by name"
)
def greet(name: str) -> str:
    """Return a personalized greeting."""
    return f"Hello, {name}! I'm your GitAgent."
```

Skills are plain Python functions decorated with `@skill`. The `description` is what the LLM reads to decide when to call it.

## Step 5: Set your API key

```bash theme={null}
export OPENAI_API_KEY=sk-...
```

## Step 6: Run the agent

```bash theme={null}
gitagent run "Please greet Alice"
```

Output:

```
> Running my-agent
> Calling skill: greet(name="Alice")
> Hello, Alice! I'm your GitAgent.
```

## Step 7: Add a real skill

Replace `skills/hello.py` with a more useful skill:

```python theme={null}
from gitagent import skill
import httpx

@skill(
    name="get_weather",
    description="Get the current weather for a city"
)
def get_weather(city: str) -> dict:
    """Fetch current weather data for a city."""
    response = httpx.get(
        "https://wttr.in/{city}?format=j1".format(city=city)
    )
    data = response.json()
    return {
        "city": city,
        "temp_c": data["current_condition"][0]["temp_C"],
        "description": data["current_condition"][0]["weatherDesc"][0]["value"]
    }
```

Run it:

```bash theme={null}
gitagent run "What's the weather in London?"
```

## Step 8: Commit your agent

```bash theme={null}
git add .
git commit -m "feat: initial agent with weather skill"
```

Your agent is now version-controlled. Any change to a skill is a reviewable commit.

## What's next

* [Installation](./installation) — install options, updating, and troubleshooting
* [Agent Structure](./agent-structure) — full directory layout and manifest reference
* [Skills](./skills) — skill types, inputs, outputs, and best practices
* [Built-in Tools](./built-in-tools) — tools that come with GitAgent (web search, file ops, etc.)
* [SkillsFlow](./skillsflow) — compose skills into multi-step workflows
