Metadata-Version: 2.5
Name: agentharnesses-cli
Version: 0.1.8
Summary: CLI tools for agentharnesses.io
Project-URL: Homepage, https://agentharnesses.io
Project-URL: Repository, https://github.com/agentharnesses/cli
License-Expression: Apache-2.0
Requires-Python: >=3.10
Requires-Dist: click>=8.1
Requires-Dist: harnesses-ref>=0.1.0
Description-Content-Type: text/markdown

# agentharnesses-cli

CLI for [agentharnesses.io](https://agentharnesses.io) — scaffold and manage Agent Harnesses.

## Installation

```bash
pip install agentharnesses-cli
```

## Usage

```bash
ahar --help
```

### `ahar init`

Initialize a new harness in the current directory:

```bash
ahar init
```

Optionally specify a name (defaults to the directory name):

```bash
ahar init my-harness
```

Always scaffolds `HARNESS.md` — the one thing the standard actually requires:

```
my-harness/
└── HARNESS.md                       # entry point and agent identity
```

Everything else is opt-in, since it may not fit the target repo. With no flags, `init` asks
interactively:

```
Set up this harness as:
  plain  -- just HARNESS.md, no Claude Code configuration
  claude -- also wire up .claude/ (skills, settings) for Claude Code
Choose [plain]: claude

Which skills should be installed?
  Install agent-harnesses? (progressive disclosure explorer -- ...) [Y/n]:
  Install harnessify? (surveys this repo and authors real routing for it -- ...) [Y/n]:
```

Choosing `claude` and at least one skill installs from
[agentharnesses/metaskill](https://github.com/agentharnesses/metaskill) (cloned fresh at init
time, so you always get the latest version):

```
├── .gitignore                       # excludes .claude/settings.json, metaskill session state
├── .leaf-detectors                  # skill=SKILL.md -- needed for agent-harnesses' own leaf detection
└── .claude/
    ├── settings.json                # registers the harness as a Claude Code plugin -- merged
    │                                 # into any existing settings.json, never overwritten
    └── skills/
        ├── agent-harnesses/          # progressive-disclosure exploration (if selected)
        └── harnessify/               # authors real routing for a bare repo (if selected)
```

For scripted/CI use, flags skip the dialogue entirely:

```bash
ahar init --plain                                    # HARNESS.md only, no prompt
ahar init --claude                                    # for Claude Code, both skills, no prompt
ahar init --claude --agent-harnesses --no-harnessify  # for Claude Code, agent-harnesses only
ahar init --metaskill                                 # deprecated alias for --claude with both skills
```

`--agent-harnesses`/`--harnessify` (and `--metaskill`) imply `--claude` on their own — no need to
pass both. If a `.claude/` folder already exists in the target directory, `init` treats that as a
standing signal the repo wants Claude Code integration and installs both skills automatically,
skipping the dialogue.

### `ahar validate`

Validate a harness directory structure:

```bash
ahar validate ./my-harness
```

### `ahar read`

Read a property from a harness's `HARNESS.md` frontmatter:

```bash
ahar read ./my-harness name
ahar read ./my-harness description
```

### `ahar prompt`

Render a harness as prompt XML for agent injection:

```bash
ahar prompt ./my-harness
```

These commands are backed by [harnesses-ref](https://pypi.org/project/harnesses-ref/), the reference implementation for the Agent Harnesses standard.

## Publishing

Releases are published to PyPI automatically when a version tag is pushed:

```bash
git tag v1.0.0
git push origin v1.0.0
```

The GitHub Actions workflow builds the package and publishes it via trusted publishing (no API token required). The version is derived from the tag via `hatch-vcs`.

## License

Apache 2.0
