Metadata-Version: 2.4
Name: dari-cli
Version: 0.1.2
Summary: Dari CLI.
License-Expression: LicenseRef-Proprietary
Project-URL: Homepage, https://github.com/mupt-ai/dari-cli
Project-URL: Repository, https://github.com/mupt-ai/dari-cli
Project-URL: Issues, https://github.com/mupt-ai/dari-cli/issues
Keywords: agent,cli,dari,deploy
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Build Tools
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: pyyaml<7,>=6.0
Requires-Dist: supabase<3,>=2.24

# Dari CLI

`dari` is the CLI for validating a managed deployment bundle, packaging the
current checkout, and publishing agent versions to Agent Host.

Full platform docs live at `https://docs.dari.dev`.

## Install

After the package is published to PyPI:

```bash
uv tool install dari-cli
```

Or:

```bash
pipx install dari-cli
```

Install directly from GitHub before a PyPI release:

```bash
uv tool install git+https://github.com/mupt-ai/dari-cli.git
```

Or:

```bash
pipx install git+https://github.com/mupt-ai/dari-cli.git
```

## Commands

Validate a managed bundle:

```bash
dari manifest validate .
```

Log in through the browser:

```bash
dari auth login
```

Manage runtime credentials for the current org:

```bash
dari credentials add OPENAI_API_KEY
dari credentials list
```

Create or inspect execution backends for Pi deploys:

```bash
dari execution-backends create --name "Primary E2B" --provider e2b --api-key e2b_api_123
dari execution-backends list
```

Deploy the current checkout:

```bash
dari deploy .
```

For `harness: pi`, you must also provide the execution backend to pin for that
publish:

```bash
dari deploy . --execution-backend-id execb_123
```

Or set it through the environment:

```bash
DARI_EXECUTION_BACKEND_ID=execb_123 dari deploy .
```

This management flow uses the browser login session from `dari auth login` and
the currently selected org.

The CLI talks to `https://api.dari.dev`.

## Managed Bundle Shape

`dari` expects a repo-root bundle with:

- `dari.yml`
- `Dockerfile`
- any prompt files referenced by `instructions`
- discovered custom tools under `tools/<name>/tool.yml`

Minimal example:

```yaml
name: support-agent
harness: opencode

instructions:
  system: prompts/system.md

runtime:
  dockerfile: Dockerfile

tools:
  - name: repo_search
    path: tools/repo_search
    kind: main
  - name: sandbox.exec
    kind: ephemeral

env:
  APP_ENV: production
```

Example custom tool definition:

```yaml
name: repo_search
description: Search the checked-out repository for matching content.
input_schema: input.schema.json
runtime: typescript
handler: handler.ts:main
retries: 2
timeout_seconds: 20
```

## Pi Deploys

Pi deploys require an execution backend ID pinned at publish time.

Create an E2B-backed execution backend for the current org:

```bash
dari execution-backends create --name "Primary E2B" --provider e2b
```

The command prompts for a provider API key securely by default. Use
`--api-key` or `--api-key-stdin` when the backend config is just an API key.

For any provider, you can also pass config through `--config-json` or
`--config-json-stdin`:

```bash
dari execution-backends create \
  --name "Sandbox Backend" \
  --provider modal \
  --config-json '{"api_key":"modal_123"}'
```

List existing execution backends and copy the returned `execb_*` ID:

```bash
dari execution-backends list
```

Deploy the Pi repo with that backend pinned:

```bash
dari deploy . --execution-backend-id execb_123
```

## Local Development

Install dependencies and run tests:

```bash
uv sync --group dev
uv run pytest
```

Examples live under [examples](./examples).

## Release

1. Update `version` in `pyproject.toml`.
2. Update `uv.lock` so the editable package entry matches the new version.
3. Commit the version bump before tagging.
4. Run `uv build` and `uv run pytest`.
5. Configure PyPI trusted publishing for the `Publish CLI` GitHub Actions workflow.
6. Push a tag like `v0.1.1` from the commit that contains that exact version.
   The release workflow rejects tags that do not match `pyproject.toml`.
7. GitHub Actions publishes the tagged build to PyPI.

## Contributing

Read [CONTRIBUTING.md](./CONTRIBUTING.md) before opening a PR.
