npm package: @qretaio/repo
Description: Universal CLI for repository operations - lint, build, format, test across languages
Author: Qreta IO
Latest version: 0.7.0

# @qretaio/repo

Universal CLI for repository operations - lint, format, build, and test across multiple programming languages.

A standard Node.js npm package that works on **Node.js**, **Bun**, and **Deno** (through Node.js compatibility).

## Features

- **Auto-detection**: Automatically detects project types (Node.js, Python, Rust, Go, JVM)
- **Cross-language commands**: `lint`, `fmt`, `build`, `test` work across all detected projects
- **Context gathering**: Generate repository context for AI/LLM consumption
- **Multi-runtime**: Use with Node.js, Bun, or Deno

## Installation

```bash
npm install -g @qretaio/repo
```

## For AI Agents

This package includes a skill for AI agents (Claude Code, etc.) to use repo CLI effectively.

```bash
# Install the skill for Claude Code
npx skills add @qretaio/repo
```

The skill is located in `skills/repo-cli/` and provides AI agents with:

- When to use repo CLI commands
- Command reference and options
- Workflow patterns for common tasks

## Usage

```bash
# Run linters for all detected projects
repo lint

# Auto-fix formatting issues
repo fmt --fix

# Build all projects
repo build

# Run all tests
repo test

# Gather repository context (for AI/LLM)
repo context --tree
```

## Commands

### `lint`

Run linters for detected project types.

```bash
repo lint              # Check all linters
repo lint --fix        # Auto-fix where available
repo lint --list       # List available linters
repo lint -t nodejs    # Only lint Node.js projects
```

### `fmt`

Check or apply formatting.

```bash
repo fmt               # Check formatting
repo fmt --fix         # Apply formatting fixes
repo fmt --list        # List available formatters
```

### `build`

Build all detected projects.

```bash
repo build             # Build all projects
repo build --check     # Run faster checks instead of full build
repo build --list      # List build commands
```

### `test`

Run tests across all projects.

```bash
repo test              # Run all tests
repo test --watch      # Run in watch mode (if supported)
repo test --coverage   # Run with coverage (if supported)
```

### `context`

Gather repository context for AI/LLM consumption.

```bash
repo context           # Output Markdown context
repo context --json    # Output as JSON
repo context --tree    # Include file tree
repo context -o ctx.md # Write to file
```

## Supported Project Types

| Type    | Detection Files                      | Linters             | Formatters             |
| ------- | ------------------------------------ | ------------------- | ---------------------- |
| Node.js | `package.json`                       | ESLint, TypeScript  | Prettier, ESLint --fix |
| Python  | `pyproject.toml`, `requirements.txt` | Ruff, Pylint        | Ruff format, Black     |
| Rust    | `Cargo.toml`                         | Clippy              | rustfmt                |
| Go      | `go.mod`                             | go vet, staticcheck | gofmt                  |
| JVM     | `build.gradle*`, `pom.xml`           | Checkstyle          | Spotless               |

## Development

```bash
# Install dependencies
npm install

# Run in development mode
npm run dev <command>

# Build for distribution
npm run build

# Type checking
npm run typecheck
```

## License

MIT