Metadata-Version: 2.4
Name: nyah
Version: 0.1.0
Summary: A cross-platform package manager wrapper
Author-email: nyah team <info@nyah.dev>
License: MIT License
        
        Copyright (c) 2026 Nyah Team
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Nyah 🐈

> A polished, cross-platform package manager wrapper.  
> Nyah unifies `winget`, `chocolatey`, `scoop`, `apt`, `dnf`, `pacman`, `apk`, `flatpak`, `pkg`, `npm`, and `pip` behind a single consistent CLI.

---

## Philosophy

- **Wrapper only.** Nyah never hosts packages or resolves dependencies itself.  
- **Zero cloud.** No telemetry, no package registry, no server.  
- **Lightweight.** Installs as a Python package; no binaries required.

---

## Quick Start

```bash
pip install nyah          # install
nyah doctor               # check system health
nyah install git          # install a package
nyah search neovim        # find a package
```

---

## Installation

```bash
pip install nyah
# or from source:
git clone https://github.com/yourname/nyah && cd nyah
pip install -e .
```

---

## Commands

### Package Management

| Command | Description |
|---|---|
| `nyah install <pkg> [<pkg2>...]` | Install one or more packages |
| `nyah install <pkg> with <backend>` | Force a specific backend |
| `nyah remove <pkg>` | Remove a package |
| `nyah reinstall <pkg>` | Remove then re-install |
| `nyah purge <pkg>` | Remove + delete leftover config/cache dirs |
| `nyah repair <pkg>` | Attempt to repair a broken install |
| `nyah upgrade [<pkg>...]` | Upgrade packages |
| `nyah update` | Refresh package database |
| `nyah list` | List installed packages |
| `nyah search <query>` | Search for packages |

### Information

| Command | Description |
|---|---|
| `nyah info <pkg>` | Detailed package info (version, homepage, license, location) |
| `nyah which <pkg>` | Locate executable, backend, and version |
| `nyah homepage <pkg>` | Open package homepage in browser |

### Developer Setups

Quickly bootstrap an entire developer environment:

```bash
nyah setup python     # git + python + vscode + pipx
nyah setup rust       # git + rust + llvm + vscode
nyah setup cpp        # git + cmake + llvm + vscode
nyah setup web        # git + node + vscode
nyah setup node       # git + node + yarn + vscode
nyah setup gamedev    # git + cmake + python + vscode
nyah setup ai         # git + python + vscode + pipx + cuda
```

### Workspace Manifests

Create a `nyah.toml` in your project directory:

```toml
[packages]
git    = true
python = true
vscode = true
rust   = true
```

Then just run:

```bash
nyah install    # reads nyah.toml automatically
```

### Export / Import / Sync

```bash
nyah export                    # save package list to packages.json
nyah export -o mylist.json     # custom filename
nyah import mylist.json        # install missing packages
nyah sync mylist.json          # sync: install missing, skip installed
```

### Backup & Restore

```bash
nyah backup                      # creates nyah_backup.json
nyah backup -o my_backup.json    # custom filename
nyah restore nyah_backup.json    # restore packages + config
```

Backup includes: installed packages, preferred backend, all config, and command history.

### Backend Management

```bash
nyah backend              # show current, installed, available backends
nyah use winget           # switch preferred backend
nyah enable scoop         # install a new backend (Windows)
```

### History

```bash
nyah history                        # all history
nyah history --filter install       # only installs
nyah history --filter remove        # only removals
nyah history --last 10              # last 10 entries
```

### Health & Doctor

```bash
nyah health      # check installed dev tools (Git, Python, Node, Java, Rust, Go, CMake, VS...)
nyah doctor      # full system diagnostic (OS, arch, PATH, admin status, backends)
nyah doctor --fix  # auto-repair common issues
```

### Cache

```bash
nyah cache size    # show cache disk usage
nyah cache clean   # remove stale entries (keeps config + history)
nyah cache clear   # delete entire cache
```

### Config

```bash
nyah config                    # list all config keys
nyah config get preferred_backend
nyah config set colors false
nyah config set preferred_backend chocolatey
```

### Misc

```bash
nyah version       # Nyah and backend versions
nyah --help        # full help
nyah --debug       # verbose error output
```

---

## Supported Backends

| Backend | Platform | Auto-install |
|---|---|---|
| `winget` | Windows | ✔ |
| `chocolatey` | Windows | ✔ |
| `scoop` | Windows | ✔ |
| `apt` | Linux (Debian/Ubuntu) | – |
| `dnf` | Linux (Fedora/RHEL) | – |
| `pacman` | Linux (Arch) | – |
| `apk` | Linux (Alpine) | – |
| `flatpak` | Linux | ✔ (via apt/dnf) |
| `pkg` | FreeBSD | – |
| `npm` | Any (Node.js) | – |
| `pip` | Any (Python) | – |
| `git` | Any | – |

---

## Architecture

```
nyah/
├── cli.py          ← Argument parsing + output formatting
├── dispatcher.py   ← All business logic
├── config.py       ← ~/.nyah/config.json
├── detector.py     ← Discovers installed package managers
├── logger.py       ← Colored console output
├── backend/
│   ├── base.py     ← Abstract backend interface
│   ├── winget.py
│   ├── chocolatey.py
│   ├── scoop.py
│   ├── apt.py
│   ├── dnf.py
│   ├── pacman.py
│   ├── apk.py
│   ├── flatpak.py
│   ├── pkg.py
│   ├── npm.py
│   ├── pip.py
│   └── git.py
└── test_nyah.py    ← Full test suite (50+ tests)
```

---

## Contributing

1. Fork the repo
2. Add your feature in the right backend or dispatcher method
3. Write a test in `test_nyah.py`
4. Run `pytest nyah/test_nyah.py -q` — all must pass
5. Open a PR

---

## License

MIT
