Metadata-Version: 2.4
Name: urun-cli
Version: 0.8.1
Summary: CLI for the urun platform — login, billing & usage. More capabilities coming soon.
Project-URL: Homepage, https://urun.sh
Project-URL: Repository, https://github.com/urun-sh/urun-cli
Project-URL: Issues, https://github.com/urun-sh/urun-cli/issues
Author: urun
License-Expression: MIT
License-File: LICENSE
Keywords: cli,urun
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# urun CLI

Command-line access to your urun org: log in, inspect billing, usage, and
cost information, and jump to the billing console. More capabilities are on
the way — see [What's next](#whats-next).

[![PyPI](https://img.shields.io/pypi/v/urun-cli.svg)](https://pypi.org/project/urun-cli/)
[![Python](https://img.shields.io/pypi/pyversions/urun-cli.svg)](https://pypi.org/project/urun-cli/)

## Install

```bash
uv tool install urun-cli
# or
pip install urun-cli
```

The package installs the `urun` command:

```bash
urun --version
```

For one-off `uvx` usage:

```bash
uvx --from urun-cli urun --version
# or the package-matching command alias
uvx urun-cli --version
```

## Log in

Save an org-scoped API key locally with `urun login`:

```bash
urun login
```

If `URUN_API_KEY` is not already set, `urun login` opens the urun console API
keys page, prompts you to paste the generated `urun_sk_...` key, verifies it
with the urun API, and stores credentials for later commands.

If you already have a key, you can pass it directly:

```bash
urun login --api-key urun_sk_<secret>
```

For CI or one-off commands, you can use the environment variable instead:

```bash
export URUN_API_KEY=urun_sk_<secret>
```

## Billing & usage

Every command is org-scoped via your API key.

Your org identity (use `--id` in scripts: `ORG=$(urun org --id)`):

```bash
urun org
```

Usage summary and credit balance:

```bash
urun account usage
urun account credit
urun account quota
```

The credit ledger — every credit grant and charge to your org, newest first:

```bash
urun credit-ledger list
```

Org config, members, and API keys:

```bash
urun account org
urun member list
urun api-key list
```

Open the billing page in the urun console:

```bash
urun open billing
```

`urun feedback` raises and tracks issues with the urun team from your
terminal.

## Common options

| Option | Description |
| --- | --- |
| `--api-url` | Override the API URL; defaults to `URUN_API_URL`, saved login credentials, or `https://api.urun.sh/v1`. |
| `--api-key` | API key; defaults to `URUN_API_KEY` or saved login credentials. |
| `--json` | Machine-readable output, where supported. |

## Troubleshooting

| Error | Fix |
| --- | --- |
| `missing API key` | Run `urun login`, set `URUN_API_KEY`, or pass `--api-key`. |
| `invalid API key format` | Use `urun_<32 lowercase hex chars>`. |

## What's next

This release focuses on account access: login, billing, usage, and cost
information.
## Development

Contributing and test instructions are in [CONTRIBUTING.md](CONTRIBUTING.md).
The CLI gates unreleased surfaces behind release feature flags — see
[FLAGS.md](FLAGS.md) for the conventions and how to exercise them from a
source checkout.

This repo has a Nix/direnv/devcontainer baseline:

```bash
direnv allow
just sync
just check
```

Use VS Code Dev Containers to open the repository with the same toolchain in a
container. Copy `devcontainer.env.example` to `.devcontainer.env` if you need
to pass local git identity or other non-secret development settings into the
container.

## License

MIT.
