Metadata-Version: 2.4
Name: muni
Version: 0.2.17
Summary: Muni CLI — manage tools, jobs, spaces, and more
Author-email: BioArena <support@muni.bio>
License-Expression: MIT
Project-URL: Homepage, https://muni.bio
Project-URL: Repository, https://github.com/bioArena/muni-cli
Project-URL: Issues, https://github.com/bioArena/muni-cli/issues
Keywords: bioarena,muni,cli,bioinformatics,protein-design
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: pydantic<3,>=2
Requires-Dist: realtime<3,>=2.28.0
Provides-Extra: completion
Requires-Dist: argcomplete>=3; extra == "completion"

# Muni CLI

The command-line interface for [Muni](https://muni.bio). Run scientific tools on
managed GPUs, inspect and download job outputs, and build canvases of tables,
charts, structures, molecules, and code from a terminal, a script, or an AI
agent.

## Install

```bash
pipx install muni
```

Or `pip install muni` into an existing environment. Requires Python 3.11+.
`muni --version` shows what you have; `muni update --check` compares it with
the latest release.

## Sign in

```bash
muni login            # opens your browser; click Authorize
muni login --device   # no browser: prints a code to enter at app.muni.bio/device
muni whoami
```

For CI and agents, create a personal access token once and export it instead:

```bash
muni token create --name ci --ttl 90d
export MUNI_TOKEN=...   # the token printed above
```

More in `muni help auth`: scoped and space-pinned tokens, revocation, and
profiles.

## Run a tool

```bash
muni tools -q rowan                              # find a tool
muni tool rowan_solubility --inputs              # its parameters
muni run rowan_solubility smiles=CCO --dry-run   # validate and estimate cost; submits nothing
muni run rowan_solubility smiles=CCO --follow    # submit and stream status until done
```

Parameters are `KEY=VALUE` pairs parsed as JSON when possible
(`temperatures='[298.15, 310]'`); `@file` reads a value from a file and
`--params-file params.json` loads them all. `muni run ipsae --batch jobs.jsonl`
submits one job per line.

## Read results

```bash
muni job list --tool rowan_solubility -n 5
muni job status JOB_ID
muni wait JOB_ID                           # block until the job finishes
muni job summary JOB_ID                    # columns, row count, file count
muni job query JOB_ID --columns rank,sequence --limit 10
muni job files JOB_ID
muni job download JOB_ID results/summary.csv --output summary.csv
muni job download-all JOB_ID --glob "*.pdb" --output-dir ./structures/
```

More in `muni help jobs`.

## Work on a canvas

A space holds pages, and a page holds nodes: tables, charts, structures,
compounds, text, images, PDFs, JSON, code, tool jobs, and pipelines.

```bash
muni space list
muni page create "Results" --space SPACE_ID --json
muni run rowan_solubility smiles=CCO --page PAGE_ID --follow   # a job node plus result nodes
muni job materialize JOB_ID --page PAGE_ID                      # put an earlier job's results on a page
muni node create table "Screen" --file ./results.csv --page PAGE_ID
muni node list --page PAGE_ID
muni node type NODE_ID                     # its kind and the commands for it
muni node table query NODE_ID "select * from rows limit 5"
```

`muni run` without `--page` or `--space` runs detached: results stay in job
storage until you materialize them. More in `muni help targeting` and
`muni help nodes`.

## Guides

The CLI ships its own documentation. `muni help` lists the topics:

| Topic | Covers |
|---|---|
| `muni help agents` | the contract for scripts and AI agents: output, exit codes, IDs, spending |
| `muni help auth` | browser, device, and token sign-in; profiles |
| `muni help targeting` | spaces, pages, the directory binding, where results land |
| `muni help jobs` | tools, parameters, costs, waiting, outputs |
| `muni help nodes` | creating, editing, running, and connecting canvas nodes |
| `muni help pipelines` | authoring, releasing, and running pipelines | <!-- feature:pipelines -->
| `muni help campaigns` | lab campaigns with Adaptyv |
| `muni help autopipe` | reading AutoPipe runs and results |
| `muni help exit-codes` | exit codes and error codes |
| `muni help environment` | environment variables |
| `muni help reference` | every command and flag (`--json` for a machine-readable tree) |

`muni COMMAND --help` explains any single command.

## For AI agents

Every command accepts `--json` and returns `{"schema": 1, "data": ...}` or an
`error` object with a stable `code`, and exit codes are documented. Point your
agent at:

```bash
muni help agents
```

## Python SDK

The package also installs a Python client:

```python
from muni import MuniClient

client = MuniClient()
job = client.jobs.submit("rowan_solubility", {"smiles": "CCO"})
result = client.jobs.wait(job.job_id, timeout=600)
```

See [docs/sdk.md](docs/sdk.md) for the client, its namespaces, and errors.

## Contributing

See [AGENTS.md](AGENTS.md) for the repository layout, conventions, tests, and
releases, and [CHANGELOG.md](CHANGELOG.md) for what changed.

## License

MIT
