An open API service indexing awesome lists of open source software.

https://github.com/alireza29675/yar-agent

Yar — Understand Complex Codebases Fast ⚡ 🚀
https://github.com/alireza29675/yar-agent

agent claude-agent-sdk code-analysis code-understanding yar

Last synced: 6 months ago
JSON representation

Yar — Understand Complex Codebases Fast ⚡ 🚀

Awesome Lists containing this project

README

          

# Yar — Understand Complex Codebases Fast

[![npm version](https://badge.fury.io/js/yar-agent.svg)](https://www.npmjs.com/package/yar-agent)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Yar is an CLI agent, built with [Claude Agent SDK](https://docs.claude.com/en/api/agent-sdk/overview), which analyzes complex and large codebases and generate documentation. It reads code, understands architecture, and creates **onboarding guides and presentations** automatically.


CLI Command
    
Generated Presentation



Run CLI command → Get presentation

## ⚙️ Installation

```bash
npm install -g yar-agent
```

### 📋 Requirements

- Node.js 18+
- [Claude Code CLI](https://claude.com/code) installed and configured

## 🤖 Usage

### Study a codebase

```bash
yar study .
```

Creates `GUIDE.md` by default. Customize output:

```bash
yar study . -o ONBOARDING.md
```

> see this onboarding guide, generated by Yar: [CONTRIBUTOR_ONBOARDING.md](./CONTRIBUTOR_ONBOARDING.md)

or direct the agent to focus on specific areas:

```bash
yar study . -m "I'm joining this project as security engineer. Focus on security patterns"
```

### Trace Codebase history

```bash
yar timeline .
```

Creates `TIMELINE.md` by default. Customize output:

```bash
yar timeline . -o HISTORY.md
```

### Create a presentation

To consume the documentations faster, you can use Yar to quickly generate a presentation:

```bash
yar present -f GUIDE.md
```

Creates `GUIDE.slides.html` and serves it by default. Customize:

```bash
yar present -f GUIDE.md -o onboarding.html --no-serve
```

or combine multiple documentations into a single presentation:

```bash
yar present -f ONBOARDING.md -f TIMELINE.md
```

or direct the agent to focus on specific aspects, or style the presentation:

```bash
yar present -f ONBOARDING.md -f TIMELINE.md -m "Explain the API layer more detailed, and of course use dark theme with blue accents!"
```

Complete usage documentation: [USAGE.md](./USAGE.md)

## ➕ Features

**Autonomous exploration**: AI agents use Read, Grep, Glob, and other tools to navigate code like a developer would.

**Automatic updates**: Running commands on existing output files updates them with new findings rather than overwriting.

**CI/CD integration**: Can be run in GitHub Actions or other CI systems to keep documentation current.

```yaml
- name: Update documentation
run: yar study .
```

> 💡 Tip: if the output file already exists, Yar will first read it and then automatically update it with new findings rather than overwriting it completely.

**Progressive output**: Agents write analysis incrementally using Write and Edit tools, with file access restricted to specified output paths.

**Piped input**: Accepts stdin for additional context.

```bash
git diff | yar study .
```

## 🤝 Contributing

See [CONTRIBUTOR_ONBOARDING.md](./CONTRIBUTOR_ONBOARDING.md) for architecture and development workflow.

Update the contributor guide:
```bash
pnpm onboarding:update
```

## Why this name?

In Farsi (my mother language), YAR (یار) means companion.

## Links

- [npm package](https://www.npmjs.com/package/yar-agent)
- [GitHub](https://github.com/Alireza29675/yar)
- [Issues](https://github.com/Alireza29675/yar/issues)

## License

MIT © Alireza Sheikholmolouki