# no-mistakes CLI Commands: Complete Guide to Repository Automation

> Master repository automation with no-mistakes CLI commands. Explore init, doctor, run, status, and more for efficient project management and AI agent integration.

- Repository: [Kun Chen/no-mistakes](https://github.com/kunchenguid/no-mistakes)
- Tags: how-to-guide
- Published: 2026-06-28

---

**no-mistakes exposes ten primary sub-commands—including init, doctor, run, status, attach, axi, rerun, stats, and eject—that manage repository initialization, pipeline execution, and AI agent interactions.**

The `no-mistakes` CLI is a Go-based automation tool built with the Cobra framework. Located in the `kunchenguid/no-mistakes` repository, it provides a comprehensive command set for managing repository workflows, running CI pipelines, and interfacing with AI agents. Understanding the commands available in no-mistakes is essential for teams automating code review and deployment processes.

## Core Commands Overview

The CLI exposes the following sub-commands, each implemented in dedicated source files under `internal/cli/`:

- **`init`** – Initialise a repository by creating [`.no-mistakes.yaml`](https://github.com/kunchenguid/no-mistakes/blob/main/.no-mistakes.yaml) and configuring the fork URL. Implemented in [`internal/cli/init.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/cli/init.go).
- **`doctor`** – Run diagnostic health checks on git status, database connections, and configuration. Implemented in [`internal/cli/doctor.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/cli/doctor.go).
- **`run`** – Execute the full pipeline including lint, test, review, PR creation, and CI monitoring. This is the default action when no sub-command is specified. Implemented in [`internal/cli/root.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/cli/root.go).
- **`status`** – Display the current run state (queued, running, awaiting agent, or finished). Implemented in [`internal/cli/status.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/cli/status.go).
- **`attach`** – Attach a terminal UI to a live daemon run for interactive monitoring. Implemented in [`internal/cli/attach.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/cli/attach.go).
- **`axi`** – Drive the agent interface for step-by-step pipeline execution and gated prompts. Implemented in [`internal/cli/axi.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/cli/axi.go).
- **`rerun`** – Re-execute a completed or failed run while preserving context. Implemented in [`internal/cli/rerun.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/cli/rerun.go).
- **`stats`** – Show aggregate statistics about run success rates and timings. Implemented in [`internal/cli/stats.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/cli/stats.go).
- **`eject`** – Remove the no-mistakes daemon and clean up all state. Implemented in [`internal/cli/eject.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/cli/eject.go).
- **`help`** and **`version`** – Standard Cobra outputs for documentation and version information.

## Detailed Command Usage

### Initialize a Repository (init)

The `init` command sets up a new repository for no-mistakes automation. It creates the configuration file and records the fork URL.

```bash
no-mistakes init --fork-url https://github.com/yourname/no-mistakes-fork

```

This command writes [`.no-mistakes.yaml`](https://github.com/kunchenguid/no-mistakes/blob/main/.no-mistakes.yaml) to the current directory and validates the git remote configuration.

### Execute the Pipeline (run)

The `run` command executes the complete automation pipeline. When you invoke `no-mistakes` without arguments, it defaults to this behavior.

```bash
no-mistakes

```

The pipeline performs the following steps sequentially:

1. Runs linting and unit tests.
2. Opens a pull request if changes are detected.
3. Invokes the configured AI agent (Claude, Copilot, etc.) for gated review steps.
4. Monitors CI status and pushes updates.

### Check System Health (doctor)

Use `doctor` to validate your environment before running pipelines. It checks git status, database connectivity, and configuration integrity.

```bash
no-mistakes doctor

```

The command exits with a non-zero status if any health checks fail, preventing problematic runs.

### Monitor Run Status (status)

The `status` command queries the daemon to display the current execution state.

```bash
no-mistakes status

```

Possible states include `queued`, `running`, `awaiting_agent`, and `completed`.

### Interact with AI Agents (axi)

The `axi` command provides the agent interface for interactive pipeline steps. When a gated step requires human input, this command displays prompts and captures responses.

```bash
no-mistakes axi

```

You will see interactive prompts such as:

```

? Review the suggested change: (y/N) y

```

For programmatic responses used by internal test harnesses, use `no-mistakes axi respond`.

### Re-run Failed Pipelines (rerun)

After fixing a failed build or test, use `rerun` to restart a specific run ID while preserving previous context.

```bash
no-mistakes rerun <run-id>

```

This command retrieves the historical run configuration from the database and re-executes the pipeline.

### Attach to Live Sessions (attach)

The `attach` command connects your terminal to a running daemon process for real-time monitoring.

```bash
no-mistakes attach

```

This displays live logs and status updates from active pipeline executions.

### View Statistics (stats)

Generate aggregate reports about your repository's automation history.

```bash
no-mistakes stats

```

This outputs success rates, average execution times, and failure categorization.

### Clean Up Installation (eject)

The `eject` command completely removes the no-mistakes daemon and deletes all local state databases.

```bash
no-mistakes eject

```

Use this when retiring the tool from a repository or debugging installation issues.

## Implementation Architecture

According to the source code in `kunchenguid/no-mistakes`, the command structure is defined in [`cmd/no-mistakes/main.go`](https://github.com/kunchenguid/no-mistakes/blob/main/cmd/no-mistakes/main.go), which initializes the Cobra root command. The default `run` behavior is implemented in [`internal/cli/root.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/cli/root.go), while each sub-command resides in its own file under `internal/cli/`. This modular structure allows developers to import specific command logic for testing or extension.

To discover the full command list dynamically, execute:

```bash
no-mistakes --help

```

Each sub-command supports its own `--help` flag (e.g., `no-mistakes init --help`) for detailed parameter documentation.

## Summary

- **no-mistakes** provides ten primary commands for repository automation: **init**, **doctor**, **run**, **status**, **attach**, **axi**, **rerun**, **stats**, **eject**, and **help/version**.
- The **run** command is the default action when no sub-command is specified, executing the complete CI pipeline.
- **init** creates [`.no-mistakes.yaml`](https://github.com/kunchenguid/no-mistakes/blob/main/.no-mistakes.yaml) and configures repository settings, while **eject** removes all traces of the tool.
- **axi** enables interactive AI agent workflows, and **rerun** allows recovery from failed executions.
- All command implementations are located in `internal/cli/` with the entry point at [`cmd/no-mistakes/main.go`](https://github.com/kunchenguid/no-mistakes/blob/main/cmd/no-mistakes/main.go).

## Frequently Asked Questions

### What is the default command when running no-mistakes?

When you execute `no-mistakes` without specifying a sub-command, it defaults to the **run** command. As implemented in [`internal/cli/root.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/cli/root.go), this executes the full pipeline including linting, testing, PR creation, and CI monitoring.

### How do I view all available commands in no-mistakes?

Run `no-mistakes --help` to display the complete list of top-level commands and their descriptions. Each sub-command also supports its own `--help` flag for detailed usage information (e.g., `no-mistakes init --help`).

### Which command handles AI agent interactions?

The **axi** command drives the agent interface. Located in [`internal/cli/axi.go`](https://github.com/kunchenguid/no-mistakes/blob/main/internal/cli/axi.go), it manages step-by-step pipeline execution and displays gated prompts when the AI requires human input or approval.

### Where is the command logic implemented in the source code?

The entry point is [`cmd/no-mistakes/main.go`](https://github.com/kunchenguid/no-mistakes/blob/main/cmd/no-mistakes/main.go), which defines the Cobra root command. Individual command implementations reside in `internal/cli/` with specific files like [`init.go`](https://github.com/kunchenguid/no-mistakes/blob/main/init.go), [`doctor.go`](https://github.com/kunchenguid/no-mistakes/blob/main/doctor.go), [`status.go`](https://github.com/kunchenguid/no-mistakes/blob/main/status.go), and [`axi.go`](https://github.com/kunchenguid/no-mistakes/blob/main/axi.go) containing the respective logic for each sub-command.