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

# Development

> Install dependencies, run tests, build distributions, and publish HEVN CLI.

## Local setup

Install dependencies with Poetry:

```bash theme={null}
poetry install
poetry run hevn --help
```

Run commands against a selected environment:

```bash theme={null}
poetry run hevn --env dev account get
poetry run hevn --env local login
```

## Tests and lint

Run tests:

```bash theme={null}
poetry run pytest
```

Run lint:

```bash theme={null}
poetry run ruff check .
```

## Build

Build source and wheel distributions:

```bash theme={null}
poetry build
```

Smoke test a local wheel:

```bash theme={null}
pipx install dist/hevn_cli-0.1.0-py3-none-any.whl
hevn --help
```

Local wheel installs are useful for smoke testing, but they are not a good long-term `pipx` source because `pipx upgrade hevn-cli` reinstalls from the same local artifact.

## Publishing

PyPI publishing is handled by the `Publish to PyPI` GitHub Actions workflow. Run it manually from `main`.

The workflow:

* runs lint and tests,
* checks `hevn --help` on Ubuntu, macOS, and Windows,
* builds the package once from Ubuntu,
* publishes to PyPI with trusted publishing.

Configure the PyPI trusted publisher for:

| Field       | Value                                |
| ----------- | ------------------------------------ |
| Owner       | `hevn`                               |
| Repository  | `hevn-cli`                           |
| Workflow    | `.github/workflows/publish-pypi.yml` |
| Environment | `pypi`                               |

## Homebrew formula guidance

The Homebrew formula should install the PyPI package inside Homebrew's isolated Python virtualenv. Do not shell out to system `pip install hevn-cli` from the formula.

```ruby theme={null}
class HevnCli < Formula
  include Language::Python::Virtualenv

  desc "Command-line client for the HEVN backend API and MCP transfers"
  homepage "https://gethevn.com"
  url "https://files.pythonhosted.org/packages/source/h/hevn-cli/hevn_cli-0.1.0.tar.gz"
  sha256 "<sha256>"
  license "MIT"

  depends_on "python@3.12"

  def install
    virtualenv_install_with_resources
  end

  test do
    assert_match "HEVN backend CLI", shell_output("#{bin}/hevn --help")
  end
end
```
