nyah 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nyah-0.1.0/LICENSE +21 -0
- nyah-0.1.0/PKG-INFO +260 -0
- nyah-0.1.0/README.md +225 -0
- nyah-0.1.0/nyah/__init__.py +18 -0
- nyah-0.1.0/nyah/backend/__init__.py +76 -0
- nyah-0.1.0/nyah/backend/apk.py +116 -0
- nyah-0.1.0/nyah/backend/apt.py +134 -0
- nyah-0.1.0/nyah/backend/base.py +153 -0
- nyah-0.1.0/nyah/backend/chocolatey.py +167 -0
- nyah-0.1.0/nyah/backend/dnf.py +126 -0
- nyah-0.1.0/nyah/backend/flatpak.py +122 -0
- nyah-0.1.0/nyah/backend/git.py +326 -0
- nyah-0.1.0/nyah/backend/npm.py +135 -0
- nyah-0.1.0/nyah/backend/pacman.py +129 -0
- nyah-0.1.0/nyah/backend/pip.py +144 -0
- nyah-0.1.0/nyah/backend/pkg.py +124 -0
- nyah-0.1.0/nyah/backend/scoop.py +162 -0
- nyah-0.1.0/nyah/backend/winget.py +253 -0
- nyah-0.1.0/nyah/cli.py +685 -0
- nyah-0.1.0/nyah/config.py +62 -0
- nyah-0.1.0/nyah/detector.py +239 -0
- nyah-0.1.0/nyah/dispatcher.py +1241 -0
- nyah-0.1.0/nyah/logger.py +102 -0
- nyah-0.1.0/nyah/runner.py +37 -0
- nyah-0.1.0/nyah/test_nyah.py +661 -0
- nyah-0.1.0/nyah/utils/__init__.py +7 -0
- nyah-0.1.0/nyah/utils/shell.py +58 -0
- nyah-0.1.0/nyah.egg-info/PKG-INFO +260 -0
- nyah-0.1.0/nyah.egg-info/SOURCES.txt +32 -0
- nyah-0.1.0/nyah.egg-info/dependency_links.txt +1 -0
- nyah-0.1.0/nyah.egg-info/entry_points.txt +2 -0
- nyah-0.1.0/nyah.egg-info/top_level.txt +1 -0
- nyah-0.1.0/pyproject.toml +27 -0
- nyah-0.1.0/setup.cfg +4 -0
nyah-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nyah Team
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
nyah-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nyah
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A cross-platform package manager wrapper
|
|
5
|
+
Author-email: nyah team <info@nyah.dev>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Nyah Team
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Classifier: Programming Language :: Python :: 3
|
|
29
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
30
|
+
Classifier: Operating System :: OS Independent
|
|
31
|
+
Requires-Python: >=3.7
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
License-File: LICENSE
|
|
34
|
+
Dynamic: license-file
|
|
35
|
+
|
|
36
|
+
# Nyah 🐈
|
|
37
|
+
|
|
38
|
+
> A polished, cross-platform package manager wrapper.
|
|
39
|
+
> Nyah unifies `winget`, `chocolatey`, `scoop`, `apt`, `dnf`, `pacman`, `apk`, `flatpak`, `pkg`, `npm`, and `pip` behind a single consistent CLI.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Philosophy
|
|
44
|
+
|
|
45
|
+
- **Wrapper only.** Nyah never hosts packages or resolves dependencies itself.
|
|
46
|
+
- **Zero cloud.** No telemetry, no package registry, no server.
|
|
47
|
+
- **Lightweight.** Installs as a Python package; no binaries required.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pip install nyah # install
|
|
55
|
+
nyah doctor # check system health
|
|
56
|
+
nyah install git # install a package
|
|
57
|
+
nyah search neovim # find a package
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Installation
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pip install nyah
|
|
66
|
+
# or from source:
|
|
67
|
+
git clone https://github.com/yourname/nyah && cd nyah
|
|
68
|
+
pip install -e .
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Commands
|
|
74
|
+
|
|
75
|
+
### Package Management
|
|
76
|
+
|
|
77
|
+
| Command | Description |
|
|
78
|
+
|---|---|
|
|
79
|
+
| `nyah install <pkg> [<pkg2>...]` | Install one or more packages |
|
|
80
|
+
| `nyah install <pkg> with <backend>` | Force a specific backend |
|
|
81
|
+
| `nyah remove <pkg>` | Remove a package |
|
|
82
|
+
| `nyah reinstall <pkg>` | Remove then re-install |
|
|
83
|
+
| `nyah purge <pkg>` | Remove + delete leftover config/cache dirs |
|
|
84
|
+
| `nyah repair <pkg>` | Attempt to repair a broken install |
|
|
85
|
+
| `nyah upgrade [<pkg>...]` | Upgrade packages |
|
|
86
|
+
| `nyah update` | Refresh package database |
|
|
87
|
+
| `nyah list` | List installed packages |
|
|
88
|
+
| `nyah search <query>` | Search for packages |
|
|
89
|
+
|
|
90
|
+
### Information
|
|
91
|
+
|
|
92
|
+
| Command | Description |
|
|
93
|
+
|---|---|
|
|
94
|
+
| `nyah info <pkg>` | Detailed package info (version, homepage, license, location) |
|
|
95
|
+
| `nyah which <pkg>` | Locate executable, backend, and version |
|
|
96
|
+
| `nyah homepage <pkg>` | Open package homepage in browser |
|
|
97
|
+
|
|
98
|
+
### Developer Setups
|
|
99
|
+
|
|
100
|
+
Quickly bootstrap an entire developer environment:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
nyah setup python # git + python + vscode + pipx
|
|
104
|
+
nyah setup rust # git + rust + llvm + vscode
|
|
105
|
+
nyah setup cpp # git + cmake + llvm + vscode
|
|
106
|
+
nyah setup web # git + node + vscode
|
|
107
|
+
nyah setup node # git + node + yarn + vscode
|
|
108
|
+
nyah setup gamedev # git + cmake + python + vscode
|
|
109
|
+
nyah setup ai # git + python + vscode + pipx + cuda
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Workspace Manifests
|
|
113
|
+
|
|
114
|
+
Create a `nyah.toml` in your project directory:
|
|
115
|
+
|
|
116
|
+
```toml
|
|
117
|
+
[packages]
|
|
118
|
+
git = true
|
|
119
|
+
python = true
|
|
120
|
+
vscode = true
|
|
121
|
+
rust = true
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Then just run:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
nyah install # reads nyah.toml automatically
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
### Export / Import / Sync
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
nyah export # save package list to packages.json
|
|
134
|
+
nyah export -o mylist.json # custom filename
|
|
135
|
+
nyah import mylist.json # install missing packages
|
|
136
|
+
nyah sync mylist.json # sync: install missing, skip installed
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Backup & Restore
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
nyah backup # creates nyah_backup.json
|
|
143
|
+
nyah backup -o my_backup.json # custom filename
|
|
144
|
+
nyah restore nyah_backup.json # restore packages + config
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Backup includes: installed packages, preferred backend, all config, and command history.
|
|
148
|
+
|
|
149
|
+
### Backend Management
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
nyah backend # show current, installed, available backends
|
|
153
|
+
nyah use winget # switch preferred backend
|
|
154
|
+
nyah enable scoop # install a new backend (Windows)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### History
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
nyah history # all history
|
|
161
|
+
nyah history --filter install # only installs
|
|
162
|
+
nyah history --filter remove # only removals
|
|
163
|
+
nyah history --last 10 # last 10 entries
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Health & Doctor
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
nyah health # check installed dev tools (Git, Python, Node, Java, Rust, Go, CMake, VS...)
|
|
170
|
+
nyah doctor # full system diagnostic (OS, arch, PATH, admin status, backends)
|
|
171
|
+
nyah doctor --fix # auto-repair common issues
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Cache
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
nyah cache size # show cache disk usage
|
|
178
|
+
nyah cache clean # remove stale entries (keeps config + history)
|
|
179
|
+
nyah cache clear # delete entire cache
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Config
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
nyah config # list all config keys
|
|
186
|
+
nyah config get preferred_backend
|
|
187
|
+
nyah config set colors false
|
|
188
|
+
nyah config set preferred_backend chocolatey
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Misc
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
nyah version # Nyah and backend versions
|
|
195
|
+
nyah --help # full help
|
|
196
|
+
nyah --debug # verbose error output
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Supported Backends
|
|
202
|
+
|
|
203
|
+
| Backend | Platform | Auto-install |
|
|
204
|
+
|---|---|---|
|
|
205
|
+
| `winget` | Windows | ✔ |
|
|
206
|
+
| `chocolatey` | Windows | ✔ |
|
|
207
|
+
| `scoop` | Windows | ✔ |
|
|
208
|
+
| `apt` | Linux (Debian/Ubuntu) | – |
|
|
209
|
+
| `dnf` | Linux (Fedora/RHEL) | – |
|
|
210
|
+
| `pacman` | Linux (Arch) | – |
|
|
211
|
+
| `apk` | Linux (Alpine) | – |
|
|
212
|
+
| `flatpak` | Linux | ✔ (via apt/dnf) |
|
|
213
|
+
| `pkg` | FreeBSD | – |
|
|
214
|
+
| `npm` | Any (Node.js) | – |
|
|
215
|
+
| `pip` | Any (Python) | – |
|
|
216
|
+
| `git` | Any | – |
|
|
217
|
+
|
|
218
|
+
---
|
|
219
|
+
|
|
220
|
+
## Architecture
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
nyah/
|
|
224
|
+
├── cli.py ← Argument parsing + output formatting
|
|
225
|
+
├── dispatcher.py ← All business logic
|
|
226
|
+
├── config.py ← ~/.nyah/config.json
|
|
227
|
+
├── detector.py ← Discovers installed package managers
|
|
228
|
+
├── logger.py ← Colored console output
|
|
229
|
+
├── backend/
|
|
230
|
+
│ ├── base.py ← Abstract backend interface
|
|
231
|
+
│ ├── winget.py
|
|
232
|
+
│ ├── chocolatey.py
|
|
233
|
+
│ ├── scoop.py
|
|
234
|
+
│ ├── apt.py
|
|
235
|
+
│ ├── dnf.py
|
|
236
|
+
│ ├── pacman.py
|
|
237
|
+
│ ├── apk.py
|
|
238
|
+
│ ├── flatpak.py
|
|
239
|
+
│ ├── pkg.py
|
|
240
|
+
│ ├── npm.py
|
|
241
|
+
│ ├── pip.py
|
|
242
|
+
│ └── git.py
|
|
243
|
+
└── test_nyah.py ← Full test suite (50+ tests)
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
---
|
|
247
|
+
|
|
248
|
+
## Contributing
|
|
249
|
+
|
|
250
|
+
1. Fork the repo
|
|
251
|
+
2. Add your feature in the right backend or dispatcher method
|
|
252
|
+
3. Write a test in `test_nyah.py`
|
|
253
|
+
4. Run `pytest nyah/test_nyah.py -q` — all must pass
|
|
254
|
+
5. Open a PR
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## License
|
|
259
|
+
|
|
260
|
+
MIT
|
nyah-0.1.0/README.md
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# Nyah 🐈
|
|
2
|
+
|
|
3
|
+
> A polished, cross-platform package manager wrapper.
|
|
4
|
+
> Nyah unifies `winget`, `chocolatey`, `scoop`, `apt`, `dnf`, `pacman`, `apk`, `flatpak`, `pkg`, `npm`, and `pip` behind a single consistent CLI.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Philosophy
|
|
9
|
+
|
|
10
|
+
- **Wrapper only.** Nyah never hosts packages or resolves dependencies itself.
|
|
11
|
+
- **Zero cloud.** No telemetry, no package registry, no server.
|
|
12
|
+
- **Lightweight.** Installs as a Python package; no binaries required.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Quick Start
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pip install nyah # install
|
|
20
|
+
nyah doctor # check system health
|
|
21
|
+
nyah install git # install a package
|
|
22
|
+
nyah search neovim # find a package
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pip install nyah
|
|
31
|
+
# or from source:
|
|
32
|
+
git clone https://github.com/yourname/nyah && cd nyah
|
|
33
|
+
pip install -e .
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Commands
|
|
39
|
+
|
|
40
|
+
### Package Management
|
|
41
|
+
|
|
42
|
+
| Command | Description |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `nyah install <pkg> [<pkg2>...]` | Install one or more packages |
|
|
45
|
+
| `nyah install <pkg> with <backend>` | Force a specific backend |
|
|
46
|
+
| `nyah remove <pkg>` | Remove a package |
|
|
47
|
+
| `nyah reinstall <pkg>` | Remove then re-install |
|
|
48
|
+
| `nyah purge <pkg>` | Remove + delete leftover config/cache dirs |
|
|
49
|
+
| `nyah repair <pkg>` | Attempt to repair a broken install |
|
|
50
|
+
| `nyah upgrade [<pkg>...]` | Upgrade packages |
|
|
51
|
+
| `nyah update` | Refresh package database |
|
|
52
|
+
| `nyah list` | List installed packages |
|
|
53
|
+
| `nyah search <query>` | Search for packages |
|
|
54
|
+
|
|
55
|
+
### Information
|
|
56
|
+
|
|
57
|
+
| Command | Description |
|
|
58
|
+
|---|---|
|
|
59
|
+
| `nyah info <pkg>` | Detailed package info (version, homepage, license, location) |
|
|
60
|
+
| `nyah which <pkg>` | Locate executable, backend, and version |
|
|
61
|
+
| `nyah homepage <pkg>` | Open package homepage in browser |
|
|
62
|
+
|
|
63
|
+
### Developer Setups
|
|
64
|
+
|
|
65
|
+
Quickly bootstrap an entire developer environment:
|
|
66
|
+
|
|
67
|
+
```bash
|
|
68
|
+
nyah setup python # git + python + vscode + pipx
|
|
69
|
+
nyah setup rust # git + rust + llvm + vscode
|
|
70
|
+
nyah setup cpp # git + cmake + llvm + vscode
|
|
71
|
+
nyah setup web # git + node + vscode
|
|
72
|
+
nyah setup node # git + node + yarn + vscode
|
|
73
|
+
nyah setup gamedev # git + cmake + python + vscode
|
|
74
|
+
nyah setup ai # git + python + vscode + pipx + cuda
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Workspace Manifests
|
|
78
|
+
|
|
79
|
+
Create a `nyah.toml` in your project directory:
|
|
80
|
+
|
|
81
|
+
```toml
|
|
82
|
+
[packages]
|
|
83
|
+
git = true
|
|
84
|
+
python = true
|
|
85
|
+
vscode = true
|
|
86
|
+
rust = true
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Then just run:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
nyah install # reads nyah.toml automatically
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Export / Import / Sync
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
nyah export # save package list to packages.json
|
|
99
|
+
nyah export -o mylist.json # custom filename
|
|
100
|
+
nyah import mylist.json # install missing packages
|
|
101
|
+
nyah sync mylist.json # sync: install missing, skip installed
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Backup & Restore
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
nyah backup # creates nyah_backup.json
|
|
108
|
+
nyah backup -o my_backup.json # custom filename
|
|
109
|
+
nyah restore nyah_backup.json # restore packages + config
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Backup includes: installed packages, preferred backend, all config, and command history.
|
|
113
|
+
|
|
114
|
+
### Backend Management
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
nyah backend # show current, installed, available backends
|
|
118
|
+
nyah use winget # switch preferred backend
|
|
119
|
+
nyah enable scoop # install a new backend (Windows)
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### History
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
nyah history # all history
|
|
126
|
+
nyah history --filter install # only installs
|
|
127
|
+
nyah history --filter remove # only removals
|
|
128
|
+
nyah history --last 10 # last 10 entries
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Health & Doctor
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
nyah health # check installed dev tools (Git, Python, Node, Java, Rust, Go, CMake, VS...)
|
|
135
|
+
nyah doctor # full system diagnostic (OS, arch, PATH, admin status, backends)
|
|
136
|
+
nyah doctor --fix # auto-repair common issues
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Cache
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
nyah cache size # show cache disk usage
|
|
143
|
+
nyah cache clean # remove stale entries (keeps config + history)
|
|
144
|
+
nyah cache clear # delete entire cache
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Config
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
nyah config # list all config keys
|
|
151
|
+
nyah config get preferred_backend
|
|
152
|
+
nyah config set colors false
|
|
153
|
+
nyah config set preferred_backend chocolatey
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Misc
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
nyah version # Nyah and backend versions
|
|
160
|
+
nyah --help # full help
|
|
161
|
+
nyah --debug # verbose error output
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Supported Backends
|
|
167
|
+
|
|
168
|
+
| Backend | Platform | Auto-install |
|
|
169
|
+
|---|---|---|
|
|
170
|
+
| `winget` | Windows | ✔ |
|
|
171
|
+
| `chocolatey` | Windows | ✔ |
|
|
172
|
+
| `scoop` | Windows | ✔ |
|
|
173
|
+
| `apt` | Linux (Debian/Ubuntu) | – |
|
|
174
|
+
| `dnf` | Linux (Fedora/RHEL) | – |
|
|
175
|
+
| `pacman` | Linux (Arch) | – |
|
|
176
|
+
| `apk` | Linux (Alpine) | – |
|
|
177
|
+
| `flatpak` | Linux | ✔ (via apt/dnf) |
|
|
178
|
+
| `pkg` | FreeBSD | – |
|
|
179
|
+
| `npm` | Any (Node.js) | – |
|
|
180
|
+
| `pip` | Any (Python) | – |
|
|
181
|
+
| `git` | Any | – |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Architecture
|
|
186
|
+
|
|
187
|
+
```
|
|
188
|
+
nyah/
|
|
189
|
+
├── cli.py ← Argument parsing + output formatting
|
|
190
|
+
├── dispatcher.py ← All business logic
|
|
191
|
+
├── config.py ← ~/.nyah/config.json
|
|
192
|
+
├── detector.py ← Discovers installed package managers
|
|
193
|
+
├── logger.py ← Colored console output
|
|
194
|
+
├── backend/
|
|
195
|
+
│ ├── base.py ← Abstract backend interface
|
|
196
|
+
│ ├── winget.py
|
|
197
|
+
│ ├── chocolatey.py
|
|
198
|
+
│ ├── scoop.py
|
|
199
|
+
│ ├── apt.py
|
|
200
|
+
│ ├── dnf.py
|
|
201
|
+
│ ├── pacman.py
|
|
202
|
+
│ ├── apk.py
|
|
203
|
+
│ ├── flatpak.py
|
|
204
|
+
│ ├── pkg.py
|
|
205
|
+
│ ├── npm.py
|
|
206
|
+
│ ├── pip.py
|
|
207
|
+
│ └── git.py
|
|
208
|
+
└── test_nyah.py ← Full test suite (50+ tests)
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Contributing
|
|
214
|
+
|
|
215
|
+
1. Fork the repo
|
|
216
|
+
2. Add your feature in the right backend or dispatcher method
|
|
217
|
+
3. Write a test in `test_nyah.py`
|
|
218
|
+
4. Run `pytest nyah/test_nyah.py -q` — all must pass
|
|
219
|
+
5. Open a PR
|
|
220
|
+
|
|
221
|
+
---
|
|
222
|
+
|
|
223
|
+
## License
|
|
224
|
+
|
|
225
|
+
MIT
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""
|
|
2
|
+
nyah - A cross-platform package manager wrapper
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
__version__ = "0.1.0"
|
|
6
|
+
__author__ = "nyah team"
|
|
7
|
+
|
|
8
|
+
from .detector import OSDetector, PackageManagerDetector
|
|
9
|
+
from .backend.base import PackageManagerBackend
|
|
10
|
+
from .backend import get_available_backends, get_best_backend
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"OSDetector",
|
|
14
|
+
"PackageManagerDetector",
|
|
15
|
+
"PackageManagerBackend",
|
|
16
|
+
"get_available_backends",
|
|
17
|
+
"get_best_backend",
|
|
18
|
+
]
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Package manager backends for nyah
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from .base import PackageManagerBackend
|
|
6
|
+
from .winget import WingetBackend
|
|
7
|
+
from .chocolatey import ChocolateyBackend
|
|
8
|
+
from .apt import AptBackend
|
|
9
|
+
from .dnf import DnfBackend
|
|
10
|
+
from .pacman import PacmanBackend
|
|
11
|
+
from .apk import ApkBackend
|
|
12
|
+
from .flatpak import FlatpakBackend
|
|
13
|
+
from .pkg import PkgBackend
|
|
14
|
+
from .git import GitBackend
|
|
15
|
+
from .scoop import ScoopBackend
|
|
16
|
+
from .npm import NpmBackend
|
|
17
|
+
from .pip import PipBackend
|
|
18
|
+
|
|
19
|
+
# Registry of all available backends
|
|
20
|
+
BACKENDS = {}
|
|
21
|
+
|
|
22
|
+
def register_backend(name, backend_class):
|
|
23
|
+
"""Register a backend class"""
|
|
24
|
+
BACKENDS[name] = backend_class
|
|
25
|
+
|
|
26
|
+
def get_available_backends():
|
|
27
|
+
"""Get list of all registered backends"""
|
|
28
|
+
return BACKENDS.copy()
|
|
29
|
+
|
|
30
|
+
def get_backend(name):
|
|
31
|
+
"""Get a specific backend by name"""
|
|
32
|
+
return BACKENDS.get(name)
|
|
33
|
+
|
|
34
|
+
# Auto-register all backends
|
|
35
|
+
register_backend("winget", WingetBackend)
|
|
36
|
+
register_backend("chocolatey", ChocolateyBackend)
|
|
37
|
+
register_backend("apt", AptBackend)
|
|
38
|
+
register_backend("dnf", DnfBackend)
|
|
39
|
+
register_backend("pacman", PacmanBackend)
|
|
40
|
+
register_backend("apk", ApkBackend)
|
|
41
|
+
register_backend("flatpak", FlatpakBackend)
|
|
42
|
+
register_backend("pkg", PkgBackend)
|
|
43
|
+
register_backend("git", GitBackend)
|
|
44
|
+
register_backend("scoop", ScoopBackend)
|
|
45
|
+
register_backend("npm", NpmBackend)
|
|
46
|
+
register_backend("pip", PipBackend)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def get_best_backend(os_name=None, package_manager=None):
|
|
51
|
+
"""
|
|
52
|
+
Get the best backend for the current OS and package manager.
|
|
53
|
+
Returns the backend instance or None if no suitable backend found.
|
|
54
|
+
"""
|
|
55
|
+
from ..detector import PackageManagerDetector
|
|
56
|
+
|
|
57
|
+
if package_manager:
|
|
58
|
+
backend_class = BACKENDS.get(package_manager.lower())
|
|
59
|
+
if backend_class:
|
|
60
|
+
return backend_class()
|
|
61
|
+
return None
|
|
62
|
+
|
|
63
|
+
# Auto-detect best available backend
|
|
64
|
+
detector = PackageManagerDetector()
|
|
65
|
+
available = detector.get_available_package_managers()
|
|
66
|
+
|
|
67
|
+
if not available:
|
|
68
|
+
return None
|
|
69
|
+
|
|
70
|
+
# Return first available backend
|
|
71
|
+
for pm in available:
|
|
72
|
+
backend_class = BACKENDS.get(pm.lower())
|
|
73
|
+
if backend_class:
|
|
74
|
+
return backend_class()
|
|
75
|
+
|
|
76
|
+
return None
|