termforge 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.
- termforge-0.1.0/.github/workflows/ci.yml +26 -0
- termforge-0.1.0/.github/workflows/release.yml +41 -0
- termforge-0.1.0/.gitignore +12 -0
- termforge-0.1.0/LICENSE +21 -0
- termforge-0.1.0/PKG-INFO +162 -0
- termforge-0.1.0/README.md +131 -0
- termforge-0.1.0/docs/doctor.png +0 -0
- termforge-0.1.0/docs/herramientas.md +55 -0
- termforge-0.1.0/pyproject.toml +59 -0
- termforge-0.1.0/src/termforge/__init__.py +3 -0
- termforge-0.1.0/src/termforge/__main__.py +4 -0
- termforge-0.1.0/src/termforge/backup.py +179 -0
- termforge-0.1.0/src/termforge/cli.py +416 -0
- termforge-0.1.0/src/termforge/config.py +148 -0
- termforge-0.1.0/src/termforge/doctor.py +197 -0
- termforge-0.1.0/src/termforge/env.py +97 -0
- termforge-0.1.0/src/termforge/init.py +132 -0
- termforge-0.1.0/src/termforge/jsonc.py +89 -0
- termforge-0.1.0/src/termforge/profiles.py +128 -0
- termforge-0.1.0/src/termforge/theme.py +110 -0
- termforge-0.1.0/termforge.example.yaml +16 -0
- termforge-0.1.0/termforge.spec +38 -0
- termforge-0.1.0/tests/conftest.py +59 -0
- termforge-0.1.0/tests/test_backup.py +124 -0
- termforge-0.1.0/tests/test_cli.py +269 -0
- termforge-0.1.0/tests/test_config.py +145 -0
- termforge-0.1.0/tests/test_doctor.py +90 -0
- termforge-0.1.0/tests/test_init.py +96 -0
- termforge-0.1.0/tests/test_jsonc.py +39 -0
- termforge-0.1.0/tests/test_profiles.py +121 -0
- termforge-0.1.0/tests/test_theme.py +129 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ${{ matrix.os }}
|
|
11
|
+
strategy:
|
|
12
|
+
fail-fast: false
|
|
13
|
+
matrix:
|
|
14
|
+
os: [windows-latest, ubuntu-latest]
|
|
15
|
+
python-version: ["3.10", "3.12", "3.13"]
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@v4
|
|
18
|
+
- uses: actions/setup-python@v5
|
|
19
|
+
with:
|
|
20
|
+
python-version: ${{ matrix.python-version }}
|
|
21
|
+
- name: Instalar
|
|
22
|
+
run: python -m pip install -e ".[dev]"
|
|
23
|
+
- name: Lint
|
|
24
|
+
run: ruff check .
|
|
25
|
+
- name: Tests
|
|
26
|
+
run: pytest -q
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish-pypi:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
environment: pypi
|
|
11
|
+
permissions:
|
|
12
|
+
id-token: write # necesario para Trusted Publishing (sin tokens/secrets)
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/setup-python@v5
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.12"
|
|
18
|
+
- name: Construir sdist y wheel
|
|
19
|
+
run: |
|
|
20
|
+
python -m pip install build
|
|
21
|
+
python -m build
|
|
22
|
+
- name: Publicar en PyPI
|
|
23
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
24
|
+
|
|
25
|
+
build-windows-exe:
|
|
26
|
+
runs-on: windows-latest
|
|
27
|
+
permissions:
|
|
28
|
+
contents: write # para adjuntar el .exe al release
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v4
|
|
31
|
+
- uses: actions/setup-python@v5
|
|
32
|
+
with:
|
|
33
|
+
python-version: "3.12"
|
|
34
|
+
- name: Instalar termforge y PyInstaller
|
|
35
|
+
run: python -m pip install -e . pyinstaller
|
|
36
|
+
- name: Construir termforge.exe
|
|
37
|
+
run: pyinstaller termforge.spec
|
|
38
|
+
- name: Adjuntar al release de GitHub
|
|
39
|
+
env:
|
|
40
|
+
GH_TOKEN: ${{ github.token }}
|
|
41
|
+
run: gh release upload "${{ github.event.release.tag_name }}" dist/termforge.exe --clobber
|
termforge-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Rony
|
|
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.
|
termforge-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: termforge
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: CLI para diagnosticar, respaldar y configurar tu terminal de Windows (Windows Terminal, PowerShell 7, Oh My Posh).
|
|
5
|
+
Project-URL: Homepage, https://github.com/Rony10-az/Termforge
|
|
6
|
+
Project-URL: Repository, https://github.com/Rony10-az/Termforge
|
|
7
|
+
Project-URL: Issues, https://github.com/Rony10-az/Termforge/issues
|
|
8
|
+
Author-email: Rony <ronnjhost@gmail.com>
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: cli,dotfiles,oh-my-posh,powershell,terminal,windows
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
22
|
+
Classifier: Topic :: System :: Systems Administration
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Requires-Dist: pyyaml>=6
|
|
25
|
+
Requires-Dist: rich>=13
|
|
26
|
+
Requires-Dist: typer>=0.12
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
29
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
<div align="center">
|
|
33
|
+
|
|
34
|
+
# ⚒️ termforge
|
|
35
|
+
|
|
36
|
+
**Diagnostica, respalda y configura tu terminal de Windows**
|
|
37
|
+
*(Windows Terminal + PowerShell 7 + Oh My Posh), sin romper lo que ya tienes.*
|
|
38
|
+
|
|
39
|
+
[](https://github.com/Rony10-az/Termforge/actions/workflows/ci.yml)
|
|
40
|
+
[](https://pypi.org/project/termforge/)
|
|
41
|
+
[](LICENSE)
|
|
42
|
+
[](pyproject.toml)
|
|
43
|
+
[](#)
|
|
44
|
+
|
|
45
|
+

|
|
46
|
+
|
|
47
|
+
</div>
|
|
48
|
+
|
|
49
|
+
## Instala tu terminal en un comando
|
|
50
|
+
|
|
51
|
+
```powershell
|
|
52
|
+
pip install termforge
|
|
53
|
+
termforge init # instala PowerShell 7 + Oh My Posh con winget y configura tu perfil
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
¿No tienes Python a mano? Descarga `termforge.exe` desde la
|
|
57
|
+
[última versión publicada](https://github.com/Rony10-az/Termforge/releases/latest) y úsalo
|
|
58
|
+
directo, sin instalar nada más.
|
|
59
|
+
|
|
60
|
+
Para desarrollar sobre el código (requiere Python 3.10+):
|
|
61
|
+
|
|
62
|
+
```powershell
|
|
63
|
+
git clone https://github.com/Rony10-az/Termforge.git
|
|
64
|
+
cd Termforge
|
|
65
|
+
python -m venv .venv
|
|
66
|
+
.venv\Scripts\Activate.ps1
|
|
67
|
+
pip install -e ".[dev]"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Eso es todo: `termforge init` detecta qué falta, lo instala con `winget` y deja tu perfil de
|
|
71
|
+
PowerShell inicializando Oh My Posh, sin que tengas que buscar instaladores ni editar nada a
|
|
72
|
+
mano. Si ya tenías algo instalado, `termforge` lo respeta y solo completa lo que falta.
|
|
73
|
+
|
|
74
|
+
¿Quieres repetir exactamente esta configuración en otra PC? Describe el resultado en un YAML
|
|
75
|
+
y aplícalo con un comando:
|
|
76
|
+
|
|
77
|
+
```yaml
|
|
78
|
+
# termforge.yaml
|
|
79
|
+
init: true
|
|
80
|
+
theme: jandedobbeleer
|
|
81
|
+
profiles: [git-bash, wsl]
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```powershell
|
|
85
|
+
termforge apply
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Por qué
|
|
89
|
+
|
|
90
|
+
Dejar una terminal bien configurada toma horas: instalar programas, elegir una Nerd Font,
|
|
91
|
+
editar `settings.json`, tocar el perfil de PowerShell. `termforge` convierte ese proceso en
|
|
92
|
+
comandos repetibles y **reversibles**.
|
|
93
|
+
|
|
94
|
+
¿Quieres saber qué más instalar? [`docs/herramientas.md`](docs/herramientas.md) es una guía con
|
|
95
|
+
las herramientas populares para una buena terminal (zoxide, fzf, eza, lazygit, etc.) y soluciones
|
|
96
|
+
a problemas comunes.
|
|
97
|
+
|
|
98
|
+
## Comandos (v0.1)
|
|
99
|
+
|
|
100
|
+
| Comando | Qué hace |
|
|
101
|
+
|---|---|
|
|
102
|
+
| `termforge doctor` | Revisa qué falta o está mal (PowerShell 7, Windows Terminal, Oh My Posh, Nerd Font, Git, WSL, perfil) y muestra cómo arreglarlo. `--json` para scripts. |
|
|
103
|
+
| `termforge init [--dry-run] [-y]` | Instala con `winget` lo que falte (PowerShell 7, Oh My Posh) y agrega la inicialización de Oh My Posh al perfil de PowerShell. Respalda el perfil antes de modificarlo. |
|
|
104
|
+
| `termforge theme [número\|nombre] [--list]` | Lista los temas de Oh My Posh ya instalados y aplica el que elijas (por número, sin buscar el nombre exacto). Respalda el perfil antes de modificarlo. |
|
|
105
|
+
| `termforge profiles [--dry-run] [-y]` | Agrega Git Bash y los distros de WSL detectados como perfiles fijos en el menú de Windows Terminal (WSL normalmente solo aparece ahí de forma dinámica, sin quedar guardado). Respalda `settings.json` antes de modificarlo. |
|
|
106
|
+
| `termforge apply [-f archivo.yaml] [--dry-run] [-y]` | Deja tu terminal como la describe un YAML (`init`, `theme`, `profiles` en una sola corrida). Ver [`termforge.example.yaml`](termforge.example.yaml). |
|
|
107
|
+
| `termforge backup [-l etiqueta]` | Guarda una copia de `settings.json` y del perfil de PowerShell. |
|
|
108
|
+
| `termforge backups` | Lista los respaldos. |
|
|
109
|
+
| `termforge restore [id] [--dry-run] [-y]` | Restaura un respaldo (el más reciente por defecto). Antes guarda el estado actual como `pre-restore`. |
|
|
110
|
+
|
|
111
|
+
`doctor` termina con código `1` si hay fallos, así que sirve también en scripts y CI.
|
|
112
|
+
|
|
113
|
+
## Seguridad
|
|
114
|
+
|
|
115
|
+
- **Backup antes de modificar**: `restore` nunca sobrescribe sin guardar antes el estado actual.
|
|
116
|
+
- **`--dry-run`**: muestra qué haría sin tocar nada.
|
|
117
|
+
- Lee el `settings.json` de Windows Terminal aunque tenga comentarios y comas finales (JSONC).
|
|
118
|
+
- Los respaldos viven en `%LOCALAPPDATA%\termforge\backups` (se cambia con `TERMFORGE_HOME`).
|
|
119
|
+
- `profiles` sí **reescribe** `settings.json` (para agregar perfiles), así que pierde cualquier
|
|
120
|
+
comentario manual que tengas ahí; por eso respalda el archivo antes de tocarlo.
|
|
121
|
+
|
|
122
|
+
## Desarrollo
|
|
123
|
+
|
|
124
|
+
```powershell
|
|
125
|
+
pytest -q # tests
|
|
126
|
+
ruff check . # lint
|
|
127
|
+
|
|
128
|
+
pip install pyinstaller
|
|
129
|
+
pyinstaller termforge.spec # genera dist/termforge.exe
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Estructura:
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
src/termforge/
|
|
136
|
+
├── cli.py # comandos (Typer + Rich)
|
|
137
|
+
├── doctor.py # diagnóstico
|
|
138
|
+
├── init.py # instalación (winget) y configuración de Oh My Posh
|
|
139
|
+
├── theme.py # listar y aplicar temas de Oh My Posh
|
|
140
|
+
├── profiles.py # agregar Git Bash/WSL al menú de Windows Terminal
|
|
141
|
+
├── config.py # configuración declarativa (termforge apply)
|
|
142
|
+
├── backup.py # respaldo y restauración
|
|
143
|
+
├── env.py # rutas y entorno (simulable en tests)
|
|
144
|
+
└── jsonc.py # lector de JSON con comentarios
|
|
145
|
+
tests/ # corren en Windows y Linux (GitHub Actions)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Todo lo que depende del sistema pasa por `Env`, por eso los tests simulan una PC con Windows
|
|
149
|
+
sin tocar tu configuración real.
|
|
150
|
+
|
|
151
|
+
## Roadmap
|
|
152
|
+
|
|
153
|
+
- [x] `doctor`, `backup`, `restore`
|
|
154
|
+
- [x] `init`: instalar dependencias con winget y configurar Oh My Posh
|
|
155
|
+
- [x] `theme`: elegir y aplicar un tema de Oh My Posh de una lista
|
|
156
|
+
- [x] `profiles`: agregar Git Bash y WSL al menú de Windows Terminal
|
|
157
|
+
- [x] Configuración declarativa (`termforge apply -f termforge.yaml`)
|
|
158
|
+
- [x] Publicar en PyPI y empaquetar `.exe` (ver [`.github/workflows/release.yml`](.github/workflows/release.yml))
|
|
159
|
+
|
|
160
|
+
## Licencia
|
|
161
|
+
|
|
162
|
+
Distribuido bajo la licencia MIT. Ver [LICENSE](LICENSE) para el texto completo.
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<div align="center">
|
|
2
|
+
|
|
3
|
+
# ⚒️ termforge
|
|
4
|
+
|
|
5
|
+
**Diagnostica, respalda y configura tu terminal de Windows**
|
|
6
|
+
*(Windows Terminal + PowerShell 7 + Oh My Posh), sin romper lo que ya tienes.*
|
|
7
|
+
|
|
8
|
+
[](https://github.com/Rony10-az/Termforge/actions/workflows/ci.yml)
|
|
9
|
+
[](https://pypi.org/project/termforge/)
|
|
10
|
+
[](LICENSE)
|
|
11
|
+
[](pyproject.toml)
|
|
12
|
+
[](#)
|
|
13
|
+
|
|
14
|
+

|
|
15
|
+
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
## Instala tu terminal en un comando
|
|
19
|
+
|
|
20
|
+
```powershell
|
|
21
|
+
pip install termforge
|
|
22
|
+
termforge init # instala PowerShell 7 + Oh My Posh con winget y configura tu perfil
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
¿No tienes Python a mano? Descarga `termforge.exe` desde la
|
|
26
|
+
[última versión publicada](https://github.com/Rony10-az/Termforge/releases/latest) y úsalo
|
|
27
|
+
directo, sin instalar nada más.
|
|
28
|
+
|
|
29
|
+
Para desarrollar sobre el código (requiere Python 3.10+):
|
|
30
|
+
|
|
31
|
+
```powershell
|
|
32
|
+
git clone https://github.com/Rony10-az/Termforge.git
|
|
33
|
+
cd Termforge
|
|
34
|
+
python -m venv .venv
|
|
35
|
+
.venv\Scripts\Activate.ps1
|
|
36
|
+
pip install -e ".[dev]"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Eso es todo: `termforge init` detecta qué falta, lo instala con `winget` y deja tu perfil de
|
|
40
|
+
PowerShell inicializando Oh My Posh, sin que tengas que buscar instaladores ni editar nada a
|
|
41
|
+
mano. Si ya tenías algo instalado, `termforge` lo respeta y solo completa lo que falta.
|
|
42
|
+
|
|
43
|
+
¿Quieres repetir exactamente esta configuración en otra PC? Describe el resultado en un YAML
|
|
44
|
+
y aplícalo con un comando:
|
|
45
|
+
|
|
46
|
+
```yaml
|
|
47
|
+
# termforge.yaml
|
|
48
|
+
init: true
|
|
49
|
+
theme: jandedobbeleer
|
|
50
|
+
profiles: [git-bash, wsl]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
```powershell
|
|
54
|
+
termforge apply
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Por qué
|
|
58
|
+
|
|
59
|
+
Dejar una terminal bien configurada toma horas: instalar programas, elegir una Nerd Font,
|
|
60
|
+
editar `settings.json`, tocar el perfil de PowerShell. `termforge` convierte ese proceso en
|
|
61
|
+
comandos repetibles y **reversibles**.
|
|
62
|
+
|
|
63
|
+
¿Quieres saber qué más instalar? [`docs/herramientas.md`](docs/herramientas.md) es una guía con
|
|
64
|
+
las herramientas populares para una buena terminal (zoxide, fzf, eza, lazygit, etc.) y soluciones
|
|
65
|
+
a problemas comunes.
|
|
66
|
+
|
|
67
|
+
## Comandos (v0.1)
|
|
68
|
+
|
|
69
|
+
| Comando | Qué hace |
|
|
70
|
+
|---|---|
|
|
71
|
+
| `termforge doctor` | Revisa qué falta o está mal (PowerShell 7, Windows Terminal, Oh My Posh, Nerd Font, Git, WSL, perfil) y muestra cómo arreglarlo. `--json` para scripts. |
|
|
72
|
+
| `termforge init [--dry-run] [-y]` | Instala con `winget` lo que falte (PowerShell 7, Oh My Posh) y agrega la inicialización de Oh My Posh al perfil de PowerShell. Respalda el perfil antes de modificarlo. |
|
|
73
|
+
| `termforge theme [número\|nombre] [--list]` | Lista los temas de Oh My Posh ya instalados y aplica el que elijas (por número, sin buscar el nombre exacto). Respalda el perfil antes de modificarlo. |
|
|
74
|
+
| `termforge profiles [--dry-run] [-y]` | Agrega Git Bash y los distros de WSL detectados como perfiles fijos en el menú de Windows Terminal (WSL normalmente solo aparece ahí de forma dinámica, sin quedar guardado). Respalda `settings.json` antes de modificarlo. |
|
|
75
|
+
| `termforge apply [-f archivo.yaml] [--dry-run] [-y]` | Deja tu terminal como la describe un YAML (`init`, `theme`, `profiles` en una sola corrida). Ver [`termforge.example.yaml`](termforge.example.yaml). |
|
|
76
|
+
| `termforge backup [-l etiqueta]` | Guarda una copia de `settings.json` y del perfil de PowerShell. |
|
|
77
|
+
| `termforge backups` | Lista los respaldos. |
|
|
78
|
+
| `termforge restore [id] [--dry-run] [-y]` | Restaura un respaldo (el más reciente por defecto). Antes guarda el estado actual como `pre-restore`. |
|
|
79
|
+
|
|
80
|
+
`doctor` termina con código `1` si hay fallos, así que sirve también en scripts y CI.
|
|
81
|
+
|
|
82
|
+
## Seguridad
|
|
83
|
+
|
|
84
|
+
- **Backup antes de modificar**: `restore` nunca sobrescribe sin guardar antes el estado actual.
|
|
85
|
+
- **`--dry-run`**: muestra qué haría sin tocar nada.
|
|
86
|
+
- Lee el `settings.json` de Windows Terminal aunque tenga comentarios y comas finales (JSONC).
|
|
87
|
+
- Los respaldos viven en `%LOCALAPPDATA%\termforge\backups` (se cambia con `TERMFORGE_HOME`).
|
|
88
|
+
- `profiles` sí **reescribe** `settings.json` (para agregar perfiles), así que pierde cualquier
|
|
89
|
+
comentario manual que tengas ahí; por eso respalda el archivo antes de tocarlo.
|
|
90
|
+
|
|
91
|
+
## Desarrollo
|
|
92
|
+
|
|
93
|
+
```powershell
|
|
94
|
+
pytest -q # tests
|
|
95
|
+
ruff check . # lint
|
|
96
|
+
|
|
97
|
+
pip install pyinstaller
|
|
98
|
+
pyinstaller termforge.spec # genera dist/termforge.exe
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Estructura:
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
src/termforge/
|
|
105
|
+
├── cli.py # comandos (Typer + Rich)
|
|
106
|
+
├── doctor.py # diagnóstico
|
|
107
|
+
├── init.py # instalación (winget) y configuración de Oh My Posh
|
|
108
|
+
├── theme.py # listar y aplicar temas de Oh My Posh
|
|
109
|
+
├── profiles.py # agregar Git Bash/WSL al menú de Windows Terminal
|
|
110
|
+
├── config.py # configuración declarativa (termforge apply)
|
|
111
|
+
├── backup.py # respaldo y restauración
|
|
112
|
+
├── env.py # rutas y entorno (simulable en tests)
|
|
113
|
+
└── jsonc.py # lector de JSON con comentarios
|
|
114
|
+
tests/ # corren en Windows y Linux (GitHub Actions)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Todo lo que depende del sistema pasa por `Env`, por eso los tests simulan una PC con Windows
|
|
118
|
+
sin tocar tu configuración real.
|
|
119
|
+
|
|
120
|
+
## Roadmap
|
|
121
|
+
|
|
122
|
+
- [x] `doctor`, `backup`, `restore`
|
|
123
|
+
- [x] `init`: instalar dependencias con winget y configurar Oh My Posh
|
|
124
|
+
- [x] `theme`: elegir y aplicar un tema de Oh My Posh de una lista
|
|
125
|
+
- [x] `profiles`: agregar Git Bash y WSL al menú de Windows Terminal
|
|
126
|
+
- [x] Configuración declarativa (`termforge apply -f termforge.yaml`)
|
|
127
|
+
- [x] Publicar en PyPI y empaquetar `.exe` (ver [`.github/workflows/release.yml`](.github/workflows/release.yml))
|
|
128
|
+
|
|
129
|
+
## Licencia
|
|
130
|
+
|
|
131
|
+
Distribuido bajo la licencia MIT. Ver [LICENSE](LICENSE) para el texto completo.
|
|
Binary file
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Guía de herramientas para una buena terminal en Windows
|
|
2
|
+
|
|
3
|
+
`termforge` se enfoca en Windows Terminal + PowerShell 7 + Oh My Posh, pero una
|
|
4
|
+
terminal cómoda suele apoyarse en más piezas. Esta guía las junta en un solo
|
|
5
|
+
lugar: qué hace cada una, por qué vale la pena, y el comando para instalarla
|
|
6
|
+
con `winget` (todas corren bien en PowerShell 7).
|
|
7
|
+
|
|
8
|
+
> ¿Falta una herramienta que usas todos los días? Abre un PR agregándola a la
|
|
9
|
+
> tabla que le corresponda.
|
|
10
|
+
|
|
11
|
+
## Shell
|
|
12
|
+
|
|
13
|
+
| Herramienta | Para qué sirve | Instalación |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| [PowerShell 7](https://github.com/PowerShell/PowerShell) | El shell que usa `termforge`; multiplataforma, más rápido y compatible que Windows PowerShell 5.1. | `winget install --id Microsoft.PowerShell` |
|
|
16
|
+
| [WSL](https://learn.microsoft.com/windows/wsl/) | Un Linux real dentro de Windows, para cuando una tarea es más simple con herramientas de Linux (`grep`, `make`, contenedores). | `wsl --install` |
|
|
17
|
+
| [Git Bash](https://git-scm.com/) | Un shell tipo bash, útil si vienes de Linux/Mac o necesitas scripts `.sh`. Se instala junto con Git. | `winget install --id Git.Git` |
|
|
18
|
+
|
|
19
|
+
## Prompt e iconos
|
|
20
|
+
|
|
21
|
+
| Herramienta | Para qué sirve | Instalación |
|
|
22
|
+
|---|---|---|
|
|
23
|
+
| [Oh My Posh](https://ohmyposh.dev/) | Prompt personalizable con temas (Git, duración de comandos, contexto de la nube, etc). `termforge init`/`termforge theme` lo configuran por ti. | `winget install JanDeDobbeleer.OhMyPosh -s winget` |
|
|
24
|
+
| Nerd Font (p. ej. [CascadiaCode NF](https://www.nerdfonts.com/)) | Fuente con los iconos que usan los temas de Oh My Posh y `eza`/`lsd`. Sin ella ves cuadros o símbolos raros. | `oh-my-posh font install CascadiaCode` |
|
|
25
|
+
| [Terminal-Icons](https://github.com/devblackops/Terminal-Icons) | Agrega iconos a la salida de `Get-ChildItem` (`ls`) en PowerShell. | `Install-Module -Name Terminal-Icons -Repository PSGallery` |
|
|
26
|
+
|
|
27
|
+
## Navegación y búsqueda
|
|
28
|
+
|
|
29
|
+
| Herramienta | Para qué sirve | Instalación |
|
|
30
|
+
|---|---|---|
|
|
31
|
+
| [zoxide](https://github.com/ajeetdsouza/zoxide) | Un `cd` con memoria: `z proyecto` te lleva a la carpeta que más usas con ese nombre. | `winget install ajeetdsouza.zoxide` |
|
|
32
|
+
| [fzf](https://github.com/junegunn/fzf) | Buscador difuso interactivo: filtra historial, archivos o cualquier lista mientras escribes. | `winget install fzf` |
|
|
33
|
+
| [ripgrep](https://github.com/BurntSushi/ripgrep) (`rg`) | Buscar texto en archivos, mucho más rápido que `grep`/`Select-String` en proyectos grandes. | `winget install BurntSushi.ripgrep.MSVC` |
|
|
34
|
+
| [fd](https://github.com/sharkdp/fd) | Buscar archivos por nombre, con una sintaxis más simple que `Get-ChildItem -Recurse`. | `winget install sharkdp.fd` |
|
|
35
|
+
|
|
36
|
+
## Listar y ver archivos
|
|
37
|
+
|
|
38
|
+
| Herramienta | Para qué sirve | Instalación |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| [eza](https://github.com/eza-community/eza) | Reemplazo de `ls` con colores, iconos (necesita una Nerd Font) y vista de árbol. | `winget install eza-community.eza` |
|
|
41
|
+
| [bat](https://github.com/sharkdp/bat) | Reemplazo de `cat`/`Get-Content` con resaltado de sintaxis y números de línea. | `winget install sharkdp.bat` |
|
|
42
|
+
|
|
43
|
+
## Git
|
|
44
|
+
|
|
45
|
+
| Herramienta | Para qué sirve | Instalación |
|
|
46
|
+
|---|---|---|
|
|
47
|
+
| [lazygit](https://github.com/jesseduffield/lazygit) | Interfaz de texto para Git (stage, commit, branches, rebase interactivo) sin salir de la terminal. | `winget install JesseDuffield.lazygit` |
|
|
48
|
+
| [posh-git](https://github.com/dahlbyk/posh-git) | Autocompletado de comandos de Git y estado del repo en el prompt de PowerShell (si no usas Oh My Posh para esto). | `Install-Module posh-git -Scope CurrentUser` |
|
|
49
|
+
|
|
50
|
+
## Solución de problemas comunes
|
|
51
|
+
|
|
52
|
+
- **No veo iconos, veo cuadros o signos de interrogación**: te falta instalar una Nerd Font y configurarla como fuente de Windows Terminal. `termforge doctor` lo detecta.
|
|
53
|
+
- **`oh-my-posh`/`zoxide`/etc. "no se reconoce como un comando"** justo después de instalarlo con winget: abre una terminal nueva. Winget actualiza el `PATH`, pero las terminales ya abiertas no se enteran.
|
|
54
|
+
- **"no se puede cargar el archivo ... porque la ejecución de scripts está deshabilitada"**: tu política de ejecución bloquea el perfil de PowerShell. Corre `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser` (como usuario, no hace falta administrador).
|
|
55
|
+
- **Instalé un tema de Oh My Posh pero no cambió nada**: revisa que el perfil de PowerShell realmente lo cargue (`termforge doctor` lo valida) y reinicia la terminal.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "termforge"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "CLI para diagnosticar, respaldar y configurar tu terminal de Windows (Windows Terminal, PowerShell 7, Oh My Posh)."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "Rony", email = "ronnjhost@gmail.com" }]
|
|
13
|
+
keywords = ["windows", "terminal", "powershell", "oh-my-posh", "dotfiles", "cli"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Operating System :: Microsoft :: Windows",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Topic :: System :: Systems Administration",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"typer>=0.12",
|
|
29
|
+
"rich>=13",
|
|
30
|
+
"pyyaml>=6",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
Homepage = "https://github.com/Rony10-az/Termforge"
|
|
35
|
+
Repository = "https://github.com/Rony10-az/Termforge"
|
|
36
|
+
Issues = "https://github.com/Rony10-az/Termforge/issues"
|
|
37
|
+
|
|
38
|
+
[project.optional-dependencies]
|
|
39
|
+
dev = [
|
|
40
|
+
"pytest>=8",
|
|
41
|
+
"ruff>=0.6",
|
|
42
|
+
]
|
|
43
|
+
|
|
44
|
+
[project.scripts]
|
|
45
|
+
termforge = "termforge.cli:app"
|
|
46
|
+
|
|
47
|
+
[tool.hatch.build.targets.wheel]
|
|
48
|
+
packages = ["src/termforge"]
|
|
49
|
+
|
|
50
|
+
[tool.pytest.ini_options]
|
|
51
|
+
testpaths = ["tests"]
|
|
52
|
+
pythonpath = ["src"]
|
|
53
|
+
|
|
54
|
+
[tool.ruff]
|
|
55
|
+
line-length = 100
|
|
56
|
+
target-version = "py310"
|
|
57
|
+
|
|
58
|
+
[tool.ruff.lint]
|
|
59
|
+
select = ["E", "F", "I", "UP", "B"]
|