linman 0.0.1__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.
- linman-0.0.1/.github/workflows/ci.yml +126 -0
- linman-0.0.1/.gitignore +21 -0
- linman-0.0.1/LICENSE +21 -0
- linman-0.0.1/PKG-INFO +163 -0
- linman-0.0.1/README.md +150 -0
- linman-0.0.1/apphub/__init__.py +0 -0
- linman-0.0.1/apphub/cli/__init__.py +0 -0
- linman-0.0.1/apphub/cli/banner.py +74 -0
- linman-0.0.1/apphub/cli/commands.py +276 -0
- linman-0.0.1/apphub/cli/formatters.py +136 -0
- linman-0.0.1/apphub/cli/serializers.py +14 -0
- linman-0.0.1/apphub/core/__init__.py +0 -0
- linman-0.0.1/apphub/core/exceptions.py +52 -0
- linman-0.0.1/apphub/core/hub.py +163 -0
- linman-0.0.1/apphub/core/logger.py +46 -0
- linman-0.0.1/apphub/core/models.py +67 -0
- linman-0.0.1/apphub/core/runtime.py +49 -0
- linman-0.0.1/apphub/core/utils.py +57 -0
- linman-0.0.1/apphub/main.py +53 -0
- linman-0.0.1/apphub/plugins/__init__.py +1 -0
- linman-0.0.1/apphub/plugins/appimage.py +442 -0
- linman-0.0.1/apphub/plugins/apt.py +440 -0
- linman-0.0.1/apphub/plugins/base.py +46 -0
- linman-0.0.1/apphub/plugins/flatpak.py +313 -0
- linman-0.0.1/apphub/plugins/snap.py +307 -0
- linman-0.0.1/pyproject.toml +41 -0
- linman-0.0.1/tests/conftest.py +37 -0
- linman-0.0.1/tests/test_cli.py +210 -0
- linman-0.0.1/tests/test_core.py +218 -0
- linman-0.0.1/tests/test_plugin_appimage.py +127 -0
- linman-0.0.1/tests/test_plugin_apt.py +109 -0
- linman-0.0.1/tests/test_plugin_flatpak.py +107 -0
- linman-0.0.1/tests/test_plugin_snap.py +144 -0
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, master, development ]
|
|
6
|
+
tags: [ "v*" ]
|
|
7
|
+
pull_request:
|
|
8
|
+
branches: [ main, master, development ]
|
|
9
|
+
|
|
10
|
+
concurrency:
|
|
11
|
+
group: ci-${{ github.workflow }}-${{ github.ref }}
|
|
12
|
+
cancel-in-progress: true
|
|
13
|
+
|
|
14
|
+
permissions:
|
|
15
|
+
contents: read
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
build:
|
|
19
|
+
name: Build
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
|
|
25
|
+
- name: Install uv
|
|
26
|
+
uses: astral-sh/setup-uv@v5
|
|
27
|
+
with:
|
|
28
|
+
enable-cache: true
|
|
29
|
+
|
|
30
|
+
- name: Set up Python
|
|
31
|
+
run: uv python install 3.12
|
|
32
|
+
|
|
33
|
+
- name: Install project (with build backend)
|
|
34
|
+
# Resolves from pyproject ranges; [tool.uv] exclude-newer applies
|
|
35
|
+
run: uv sync --all-groups
|
|
36
|
+
|
|
37
|
+
- name: Lint
|
|
38
|
+
run: uv run ruff check apphub tests
|
|
39
|
+
|
|
40
|
+
- name: Build sdist + wheel
|
|
41
|
+
run: uv build
|
|
42
|
+
|
|
43
|
+
- name: Upload dist artifacts
|
|
44
|
+
uses: actions/upload-artifact@v4
|
|
45
|
+
with:
|
|
46
|
+
name: python-package-distributions
|
|
47
|
+
path: dist/
|
|
48
|
+
if-no-files-found: error
|
|
49
|
+
retention-days: 14
|
|
50
|
+
|
|
51
|
+
test:
|
|
52
|
+
name: Test
|
|
53
|
+
runs-on: ubuntu-latest
|
|
54
|
+
needs: build
|
|
55
|
+
strategy:
|
|
56
|
+
fail-fast: false
|
|
57
|
+
matrix:
|
|
58
|
+
python-version: [ "3.11", "3.12", "3.13" ]
|
|
59
|
+
steps:
|
|
60
|
+
- name: Checkout
|
|
61
|
+
uses: actions/checkout@v4
|
|
62
|
+
|
|
63
|
+
- name: Install uv
|
|
64
|
+
uses: astral-sh/setup-uv@v5
|
|
65
|
+
with:
|
|
66
|
+
enable-cache: true
|
|
67
|
+
|
|
68
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
69
|
+
run: uv python install ${{ matrix.python-version }}
|
|
70
|
+
|
|
71
|
+
- name: Install dependencies
|
|
72
|
+
run: uv sync --all-groups
|
|
73
|
+
|
|
74
|
+
- name: Run tests with coverage
|
|
75
|
+
run: >
|
|
76
|
+
uv run pytest -q
|
|
77
|
+
--cov=apphub
|
|
78
|
+
--cov-report=term-missing
|
|
79
|
+
--cov-report=xml
|
|
80
|
+
--cov-fail-under=85
|
|
81
|
+
|
|
82
|
+
- name: Upload coverage (3.12 only)
|
|
83
|
+
if: matrix.python-version == '3.12'
|
|
84
|
+
uses: actions/upload-artifact@v4
|
|
85
|
+
with:
|
|
86
|
+
name: coverage-report
|
|
87
|
+
path: coverage.xml
|
|
88
|
+
if-no-files-found: ignore
|
|
89
|
+
retention-days: 14
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
release-package:
|
|
93
|
+
name: Release package
|
|
94
|
+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
|
|
95
|
+
needs: [ build, test ]
|
|
96
|
+
runs-on: ubuntu-latest
|
|
97
|
+
permissions:
|
|
98
|
+
contents: write
|
|
99
|
+
id-token: write
|
|
100
|
+
steps:
|
|
101
|
+
- name: Checkout
|
|
102
|
+
uses: actions/checkout@v4
|
|
103
|
+
|
|
104
|
+
- name: Download build artifacts
|
|
105
|
+
uses: actions/download-artifact@v4
|
|
106
|
+
with:
|
|
107
|
+
name: python-package-distributions
|
|
108
|
+
path: dist/
|
|
109
|
+
|
|
110
|
+
- name: List packages
|
|
111
|
+
run: ls -lh dist/
|
|
112
|
+
|
|
113
|
+
- name: Create GitHub Release
|
|
114
|
+
uses: softprops/action-gh-release@v2
|
|
115
|
+
with:
|
|
116
|
+
files: dist/*
|
|
117
|
+
generate_release_notes: true
|
|
118
|
+
fail_on_unmatched_files: true
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
- name: Publish to PyPI
|
|
122
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
123
|
+
continue-on-error: true
|
|
124
|
+
with:
|
|
125
|
+
packages-dir: dist/
|
|
126
|
+
skip-existing: true
|
linman-0.0.1/.gitignore
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Python-generated files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[oc]
|
|
4
|
+
.pytest_cache/
|
|
5
|
+
build/
|
|
6
|
+
dist/
|
|
7
|
+
wheels/
|
|
8
|
+
*.egg-info
|
|
9
|
+
.run/
|
|
10
|
+
# Virtual environments
|
|
11
|
+
.venv
|
|
12
|
+
/.idea/
|
|
13
|
+
|
|
14
|
+
# some files
|
|
15
|
+
uv.lock
|
|
16
|
+
.python-version
|
|
17
|
+
linux_app_hub.py
|
|
18
|
+
apphub.log
|
|
19
|
+
.coverage
|
|
20
|
+
coverage.xml
|
|
21
|
+
htmlcov/
|
linman-0.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Omprakash Choudhary
|
|
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.
|
linman-0.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: linman
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: Linman - Manage your Linux applications across all formats.
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Requires-Python: >=3.11
|
|
7
|
+
Requires-Dist: black>=26.5.1
|
|
8
|
+
Requires-Dist: pydantic>=2.0
|
|
9
|
+
Requires-Dist: pyyaml>=6.0.3
|
|
10
|
+
Requires-Dist: rich>=13.0.0
|
|
11
|
+
Requires-Dist: typer>=0.24.0
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
|
|
14
|
+
# linman
|
|
15
|
+
|
|
16
|
+
`linman` is a terminal-based application manager for Linux. It provides a unified CLI to work with multiple package formats from one place.
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
- **Multi-backend support** — manage apps across:
|
|
21
|
+
- `apt` (Debian packages)
|
|
22
|
+
- `snap`
|
|
23
|
+
- `flatpak` (Flathub)
|
|
24
|
+
- `appimage`
|
|
25
|
+
- **System app detection** — identify and categorize system utilities and libraries
|
|
26
|
+
- **Application manifests** — consistent view of versions, publishers, sizes, and categories
|
|
27
|
+
- **Categorization** — group software into `system`, `cli`, and `desktop`
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
Requires Python **3.11+**.
|
|
32
|
+
|
|
33
|
+
### pipx (recommended)
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pipx install linman
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### uv
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
uv tool install linman
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
After install, the CLI is available as:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
linman --help
|
|
49
|
+
linman --version
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Upgrade
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pipx upgrade linman
|
|
56
|
+
# or
|
|
57
|
+
uv tool upgrade linman
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Usage
|
|
61
|
+
|
|
62
|
+
### Common options
|
|
63
|
+
|
|
64
|
+
| Flag | Short | Description | Commands |
|
|
65
|
+
|------------|-------|-----------------------------------------------------------------|-----------------------------------------------------------|
|
|
66
|
+
| `--json` | | Output results as JSON | `list`, `search`, `inspect`, `info`, `storage`, `history` |
|
|
67
|
+
| `--format` | `-f` | Filter by package format (`snap`, `apt`, `flatpak`, `appimage`) | `list`, `search`, `install`, `storage`, `history` |
|
|
68
|
+
| `--sort` | `-s` | Sort by field (e.g. name, version, format, timestamp) | `list`, `history` |
|
|
69
|
+
| `--count` | `-n` | Print only the number of matching items | `list`, `search` |
|
|
70
|
+
|
|
71
|
+
### Commands
|
|
72
|
+
|
|
73
|
+
#### `linman list`
|
|
74
|
+
|
|
75
|
+
List installed applications (name, format, version, publisher).
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
linman list # List all applications
|
|
79
|
+
linman list <query> # Filter installed apps by name
|
|
80
|
+
linman list -e # Exclude system/default packages
|
|
81
|
+
linman list -f snap # Filter by format (repeatable)
|
|
82
|
+
linman list -s version # Sort by field (name, version, format)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
#### `linman search`
|
|
86
|
+
|
|
87
|
+
Search available applications across supported registries.
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
linman search <query>
|
|
91
|
+
linman search <query> -f flatpak
|
|
92
|
+
linman search <query> -n
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
#### `linman inspect`
|
|
96
|
+
|
|
97
|
+
Inspect a local package file (e.g. `.AppImage`, `.deb`) and print its manifest.
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
linman inspect <path_to_file>
|
|
101
|
+
linman inspect <path_to_file> --json
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
#### `linman install`
|
|
105
|
+
|
|
106
|
+
Install from a registry name or a local file. Format is auto-detected for local files.
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
linman install <name_or_path>
|
|
110
|
+
linman install <name_or_path> -y # Auto-confirm
|
|
111
|
+
linman install <name_or_path> -l # Launch after install
|
|
112
|
+
linman install <name> -f snap # Restrict search to a format
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
#### `linman uninstall`
|
|
116
|
+
|
|
117
|
+
Remove an installed application.
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
linman uninstall <application_name>
|
|
121
|
+
linman uninstall <application_name> -y # Auto-confirm
|
|
122
|
+
linman uninstall <application_name> -c # Clean uninstall (associated data)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
#### `linman info`
|
|
126
|
+
|
|
127
|
+
Show detailed metadata for an application.
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
linman info <application_name>
|
|
131
|
+
linman info <application_name> --json
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
#### `linman storage`
|
|
135
|
+
|
|
136
|
+
Disk usage by installed applications.
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
linman storage
|
|
140
|
+
linman storage -f snap
|
|
141
|
+
linman storage -t 10
|
|
142
|
+
linman storage --json
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
#### `linman history`
|
|
146
|
+
|
|
147
|
+
Installation / upgrade / uninstall history.
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
linman history
|
|
151
|
+
linman history -f flatpak
|
|
152
|
+
linman history -a installed # installed | upgraded | uninstalled
|
|
153
|
+
linman history -s timestamp -d
|
|
154
|
+
linman history -t 10
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Contributing
|
|
158
|
+
|
|
159
|
+
Contributions are welcome. Open an issue for larger changes, or submit a pull request.
|
|
160
|
+
|
|
161
|
+
## License
|
|
162
|
+
|
|
163
|
+
MIT
|
linman-0.0.1/README.md
ADDED
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# linman
|
|
2
|
+
|
|
3
|
+
`linman` is a terminal-based application manager for Linux. It provides a unified CLI to work with multiple package formats from one place.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Multi-backend support** — manage apps across:
|
|
8
|
+
- `apt` (Debian packages)
|
|
9
|
+
- `snap`
|
|
10
|
+
- `flatpak` (Flathub)
|
|
11
|
+
- `appimage`
|
|
12
|
+
- **System app detection** — identify and categorize system utilities and libraries
|
|
13
|
+
- **Application manifests** — consistent view of versions, publishers, sizes, and categories
|
|
14
|
+
- **Categorization** — group software into `system`, `cli`, and `desktop`
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
Requires Python **3.11+**.
|
|
19
|
+
|
|
20
|
+
### pipx (recommended)
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pipx install linman
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### uv
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
uv tool install linman
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
After install, the CLI is available as:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
linman --help
|
|
36
|
+
linman --version
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Upgrade
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pipx upgrade linman
|
|
43
|
+
# or
|
|
44
|
+
uv tool upgrade linman
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Usage
|
|
48
|
+
|
|
49
|
+
### Common options
|
|
50
|
+
|
|
51
|
+
| Flag | Short | Description | Commands |
|
|
52
|
+
|------------|-------|-----------------------------------------------------------------|-----------------------------------------------------------|
|
|
53
|
+
| `--json` | | Output results as JSON | `list`, `search`, `inspect`, `info`, `storage`, `history` |
|
|
54
|
+
| `--format` | `-f` | Filter by package format (`snap`, `apt`, `flatpak`, `appimage`) | `list`, `search`, `install`, `storage`, `history` |
|
|
55
|
+
| `--sort` | `-s` | Sort by field (e.g. name, version, format, timestamp) | `list`, `history` |
|
|
56
|
+
| `--count` | `-n` | Print only the number of matching items | `list`, `search` |
|
|
57
|
+
|
|
58
|
+
### Commands
|
|
59
|
+
|
|
60
|
+
#### `linman list`
|
|
61
|
+
|
|
62
|
+
List installed applications (name, format, version, publisher).
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
linman list # List all applications
|
|
66
|
+
linman list <query> # Filter installed apps by name
|
|
67
|
+
linman list -e # Exclude system/default packages
|
|
68
|
+
linman list -f snap # Filter by format (repeatable)
|
|
69
|
+
linman list -s version # Sort by field (name, version, format)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
#### `linman search`
|
|
73
|
+
|
|
74
|
+
Search available applications across supported registries.
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
linman search <query>
|
|
78
|
+
linman search <query> -f flatpak
|
|
79
|
+
linman search <query> -n
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
#### `linman inspect`
|
|
83
|
+
|
|
84
|
+
Inspect a local package file (e.g. `.AppImage`, `.deb`) and print its manifest.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
linman inspect <path_to_file>
|
|
88
|
+
linman inspect <path_to_file> --json
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### `linman install`
|
|
92
|
+
|
|
93
|
+
Install from a registry name or a local file. Format is auto-detected for local files.
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
linman install <name_or_path>
|
|
97
|
+
linman install <name_or_path> -y # Auto-confirm
|
|
98
|
+
linman install <name_or_path> -l # Launch after install
|
|
99
|
+
linman install <name> -f snap # Restrict search to a format
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
#### `linman uninstall`
|
|
103
|
+
|
|
104
|
+
Remove an installed application.
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
linman uninstall <application_name>
|
|
108
|
+
linman uninstall <application_name> -y # Auto-confirm
|
|
109
|
+
linman uninstall <application_name> -c # Clean uninstall (associated data)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
#### `linman info`
|
|
113
|
+
|
|
114
|
+
Show detailed metadata for an application.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
linman info <application_name>
|
|
118
|
+
linman info <application_name> --json
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
#### `linman storage`
|
|
122
|
+
|
|
123
|
+
Disk usage by installed applications.
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
linman storage
|
|
127
|
+
linman storage -f snap
|
|
128
|
+
linman storage -t 10
|
|
129
|
+
linman storage --json
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
#### `linman history`
|
|
133
|
+
|
|
134
|
+
Installation / upgrade / uninstall history.
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
linman history
|
|
138
|
+
linman history -f flatpak
|
|
139
|
+
linman history -a installed # installed | upgraded | uninstalled
|
|
140
|
+
linman history -s timestamp -d
|
|
141
|
+
linman history -t 10
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
## Contributing
|
|
145
|
+
|
|
146
|
+
Contributions are welcome. Open an issue for larger changes, or submit a pull request.
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
MIT
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
from rich.align import Align
|
|
2
|
+
from rich.console import Console, Group
|
|
3
|
+
from rich.panel import Panel
|
|
4
|
+
from rich.text import Text
|
|
5
|
+
|
|
6
|
+
# Block-style wordmark — reads clearly at typical terminal widths.
|
|
7
|
+
_LOGO_LINES = [
|
|
8
|
+
r" ██╗ ██╗███╗ ██╗███╗ ███╗ █████╗ ███╗ ██╗",
|
|
9
|
+
r" ██║ ██║████╗ ██║████╗ ████║██╔══██╗████╗ ██║",
|
|
10
|
+
r" ██║ ██║██╔██╗ ██║██╔████╔██║███████║██╔██╗ ██║",
|
|
11
|
+
r" ██║ ██║██║╚██╗██║██║╚██╔╝██║██╔══██║██║╚██╗██║",
|
|
12
|
+
r" ███████╗██║██║ ╚████║██║ ╚═╝ ██║██║ ██║██║ ╚████║",
|
|
13
|
+
r" ╚══════╝╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
# Gradient stops (top → bottom) — cyan → blue → magenta.
|
|
17
|
+
_GRADIENT = [
|
|
18
|
+
"bright_cyan",
|
|
19
|
+
"cyan",
|
|
20
|
+
"deep_sky_blue1",
|
|
21
|
+
"dodger_blue1",
|
|
22
|
+
"medium_purple",
|
|
23
|
+
"medium_orchid",
|
|
24
|
+
]
|
|
25
|
+
|
|
26
|
+
_TAGLINE = "Linux App Manager · apt · snap · flatpak · appimage"
|
|
27
|
+
_SUB = "one CLI · every format · zero friction"
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def render_logo() -> Text:
|
|
31
|
+
"""Return a colorized LINMAN wordmark."""
|
|
32
|
+
logo = Text()
|
|
33
|
+
for i, line in enumerate(_LOGO_LINES):
|
|
34
|
+
style = _GRADIENT[i % len(_GRADIENT)]
|
|
35
|
+
logo.append(line + "\n", style=f"bold {style}")
|
|
36
|
+
return logo
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def print_banner(
|
|
40
|
+
console: Console | None = None,
|
|
41
|
+
*,
|
|
42
|
+
version: str = "0.1.0",
|
|
43
|
+
show_panel: bool = True,
|
|
44
|
+
) -> None:
|
|
45
|
+
"""Print the linman logo banner to the terminal."""
|
|
46
|
+
console = console or Console()
|
|
47
|
+
|
|
48
|
+
logo = render_logo()
|
|
49
|
+
tagline = Text(_TAGLINE, style="bold white")
|
|
50
|
+
sub = Text(_SUB, style="dim italic")
|
|
51
|
+
ver = Text(f"v{version}", style="dim cyan")
|
|
52
|
+
|
|
53
|
+
body = Group(
|
|
54
|
+
Align.center(logo),
|
|
55
|
+
Align.center(tagline),
|
|
56
|
+
Align.center(sub),
|
|
57
|
+
Align.center(ver),
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
if show_panel:
|
|
61
|
+
console.print(
|
|
62
|
+
Panel(
|
|
63
|
+
body,
|
|
64
|
+
border_style="bright_cyan",
|
|
65
|
+
padding=(1, 2),
|
|
66
|
+
title="[bold bright_magenta]◆[/] [bold white]linman[/]",
|
|
67
|
+
title_align="left",
|
|
68
|
+
subtitle="[dim]unified package hub[/]",
|
|
69
|
+
subtitle_align="right",
|
|
70
|
+
)
|
|
71
|
+
)
|
|
72
|
+
else:
|
|
73
|
+
console.print(body)
|
|
74
|
+
console.print()
|