Metadata-Version: 2.4
Name: akebi
Version: 0.1.2
Summary: Manage Bun installations from Python
Project-URL: Repository, https://github.com/celsiusnarhwal/akebi
Project-URL: Issues, https://github.com/celsiusnarhwal/akebi/issues
Project-URL: Changelog, https://github.com/celsiusnarhwal/akebi/blob/main/CHANGELOG.md
Author-email: celsius narhwal <hello@celsiusnarhwal.dev>
License-File: LICENSE.md
Requires-Python: >=3.14
Requires-Dist: httpx2>=2.4.0
Requires-Dist: kokomikke>=0.1.4
Requires-Dist: loguru>=0.7.3
Requires-Dist: platformdirs>=4.10.0
Requires-Dist: pydantic-extra-types>=2.11.1
Requires-Dist: pydantic-settings>=2.14.1
Requires-Dist: pydantic>=2.13.4
Requires-Dist: rich>=15.0.0
Requires-Dist: semver>=3.0.4
Requires-Dist: sqlitedict>=2.1.0
Description-Content-Type: text/markdown

# Akebi

Akebi allows Python programs to manage [Bun](https://bun.com) installations. It is intended for programs that need
to install or run Node.js packages but do not wish to depend on the end user having an appropriate runtime or package
manager installed.

## Installation

```shell
pip install akebi
```

## Usage

First, create an `akebi.Bun` object:

```python
from akebi import Bun

bun = Bun()
bun = Bun(version="1.3.14")  # use a specific version of Bun
bun = Bun(version="latest")  # use the latest version of Bun
```

You can then invoke Bun by calling the `Bun` object you just created. A `Bun` object takes a `subprocess.run`-esque list or string
containing command-line arguments.

```python
from akebi import Bun

bun = Bun()

bun(["run", "./my-script.ts"])
bun(["add", "next"])
bun(["create", "docusaurus"])
```

Akebi will automatically install Bun as necessary, but you can also install it manually with `Bun.setup`:

```python
bun.setup()

# or, to forcibly overwrite existing installations of the same version:

bun.setup(force=True)  
```

Under the hood, Akebi uses `subprocess.run` to invoke Bun. Keyword arguments passed to `Bun` objects will be passed 
through to `subprocess.run`, e.g.:

```python
bun("update tailwindcss", shell=True, capture_output=True, text=True)
```

### Isolated installations

If you want to ensure the Bun installations used by your program aren't touched by anything else that uses
Akebi, you can set `Bun.app_name`:

```python
bun = Bun(app_name="com.example.myapp")
```

Bun installations created by your program will be located under an `app_name` subdirectory. You should choose
an app name that's consistent within your program and not likely be taken by other programs that use
Akebi.