g360-cli 1.2.2 → 1.4.0
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.
- package/README.md +182 -3
- package/dist/g360.exe +0 -0
- package/package.json +8 -8
- package/src/assets/config/g360-skills.json +52 -0
- package/src/assets/config/project-types.json +16 -0
- package/src/assets/config/skills.json +12 -0
- package/src/assets/snippets/snippets.json +77 -0
- package/src/assets/templates/python-cli/build-portable.bat +33 -0
- package/src/assets/templates/python-cli/src/main.py +107 -3
- package/src/assets/templates/python-customtkinter/README.md +47 -0
- package/src/assets/templates/python-customtkinter/build-portable.bat +28 -0
- package/src/assets/templates/python-customtkinter/requirements.txt +1 -0
- package/src/assets/templates/python-customtkinter/run.bat +29 -0
- package/src/assets/templates/python-customtkinter/src/core/skill.json +22 -0
- package/src/assets/templates/python-customtkinter/src/main.py +123 -0
- package/src/assets/templates/python-flet/README.md +130 -0
- package/src/assets/templates/python-flet/build-portable.bat +42 -0
- package/src/assets/templates/python-flet/create_shortcut.vbs +35 -0
- package/src/assets/templates/python-flet/requirements.txt +3 -0
- package/src/assets/templates/python-flet/run.bat +81 -0
- package/src/assets/templates/python-flet/src/core/skill.json +21 -0
- package/src/assets/templates/python-flet/src/main.py +101 -0
- package/src/assets/templates/python-flet/src/test_app.py +103 -0
- package/src/assets/templates/python-flet-migrate/src/main.py +68 -0
- package/src/assets/templates/python-flet-migrate/src/migrate_tkinter.py +56 -0
- package/src/cli.js +12 -2
- package/src/commands/clean.js +51 -4
- package/src/commands/init.js +92 -8
- package/src/commands/signature.js +12 -8
- package/src/lib/auditor.js +39 -2
package/README.md
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
# g360-cli
|
|
2
2
|
|
|
3
|
-
> CLI tool for bootstrapping G360
|
|
3
|
+
> CLI tool for bootstrapping G360 projects with standardized structure, assets, and identity
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/g360-cli)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
7
7
|
|
|
8
8
|
## Tabla de Contenidos
|
|
9
9
|
|
|
10
|
+
- [Descripción](#descripción)
|
|
10
11
|
- [Características](#características)
|
|
12
|
+
- [Tecnologías](#tecnologías)
|
|
11
13
|
- [Instalación](#instalación)
|
|
12
14
|
- [Inicio Rápido](#inicio-rápido)
|
|
13
15
|
- [Comandos](#comandos)
|
|
@@ -16,8 +18,34 @@
|
|
|
16
18
|
- [Skills](#skills)
|
|
17
19
|
- [Configuración](#configuración)
|
|
18
20
|
- [API](#api)
|
|
21
|
+
- [Estructura](#estructura)
|
|
22
|
+
- [Scripts](#scripts)
|
|
23
|
+
- [Testing](#testing)
|
|
19
24
|
- [Contribución](#contribución)
|
|
20
25
|
- [Licencia](#licencia)
|
|
26
|
+
- [Ecosistema G360](#ecosistema-g360)
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Descripción
|
|
31
|
+
|
|
32
|
+
CLI tool para el ecosistema G360 que permite inicializar proyectos con estructura estándar, gestionar assets embebidos, y asegurar compliance mediante auditoría automática. Forma parte del núcleo del ecosistema y está disponible como paquete global de npm.
|
|
33
|
+
|
|
34
|
+
**Tipo**: CLI Tool / Scaffolding / Generator
|
|
35
|
+
**Plataforma**: Node.js >= 18.0.0
|
|
36
|
+
**Distribución**: npm global (`npm install -g g360-cli`)
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Tecnologías
|
|
41
|
+
|
|
42
|
+
- **Runtime**: Node.js >= 18.0.0
|
|
43
|
+
- **Lenguaje**: JavaScript (ESModules)
|
|
44
|
+
- **CLI Framework**: Commander 14.x
|
|
45
|
+
- **UI**: Chalk 5.x (colores), Ora 9.x (spinners), Inquirer 13.x (prompts)
|
|
46
|
+
- **Filesystem**: fs-extra 11.x
|
|
47
|
+
- **Build**: pkg 5.8.1 (portable .exe)
|
|
48
|
+
- **Distribución**: npm global
|
|
21
49
|
|
|
22
50
|
---
|
|
23
51
|
|
|
@@ -27,7 +55,8 @@
|
|
|
27
55
|
- **Gestión de assets** - Trae componentes, skills y plantillas embebidas
|
|
28
56
|
- **Auditoría** - Verifica compliance de proyectos G360
|
|
29
57
|
- **Limpieza** - Elimina assets embebidos antes de deployment
|
|
30
|
-
- **Multi-plantilla** - Web
|
|
58
|
+
- **Multi-plantilla** - Web (Lit, Solid, Svelte, React), Python (CLI, Flet, CustomTkinter), VBA Excel
|
|
59
|
+
- **Modo portable** - Proyectos Python con ejecución directa (sin PyInstaller)
|
|
31
60
|
- **Modo offline** - Funciona sin conexión usando assets cacheados
|
|
32
61
|
- **Preview** - Dry-run para previsualizar cambios
|
|
33
62
|
|
|
@@ -183,6 +212,33 @@ g360 convert . --skill corporativo-movil --force
|
|
|
183
212
|
|
|
184
213
|
---
|
|
185
214
|
|
|
215
|
+
### `g360 signature`
|
|
216
|
+
|
|
217
|
+
Instala el componente de firma oficial G360 en proyectos web.
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
g360 signature install [opciones]
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
**Opciones:**
|
|
224
|
+
|
|
225
|
+
| Opción | Descripción | Valor por defecto |
|
|
226
|
+
|--------|-------------|-------------------|
|
|
227
|
+
| `-p, --path <ruta>` | Ruta al index.html | `.` |
|
|
228
|
+
| `--force` | Reinstalar si ya existe | `false` |
|
|
229
|
+
|
|
230
|
+
**Ejemplos:**
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# Instalar en el directorio actual
|
|
234
|
+
g360 signature install
|
|
235
|
+
|
|
236
|
+
# Forzar reinstalación
|
|
237
|
+
g360 signature install --force
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
186
242
|
### `g360 bring`
|
|
187
243
|
|
|
188
244
|
Trae assets G360 al proyecto actual.
|
|
@@ -457,7 +513,7 @@ mi-proyecto/
|
|
|
457
513
|
|
|
458
514
|
### python-cli
|
|
459
515
|
|
|
460
|
-
Plantilla CLI de Python.
|
|
516
|
+
Plantilla CLI de Python con estructura argparse completa.
|
|
461
517
|
|
|
462
518
|
```
|
|
463
519
|
mi-cli/
|
|
@@ -466,9 +522,55 @@ mi-cli/
|
|
|
466
522
|
│ └── core/
|
|
467
523
|
│ └── skill.json
|
|
468
524
|
├── requirements.txt
|
|
525
|
+
├── run.bat
|
|
526
|
+
├── build-portable.bat
|
|
527
|
+
└── skill.json
|
|
528
|
+
```
|
|
529
|
+
|
|
530
|
+
### python-flet
|
|
531
|
+
|
|
532
|
+
Plantilla GUI de escritorio con **Flet** (flask-like para Flutter).
|
|
533
|
+
|
|
534
|
+
```
|
|
535
|
+
mi-app/
|
|
536
|
+
├── src/
|
|
537
|
+
│ ├── main.py
|
|
538
|
+
│ └── core/
|
|
539
|
+
│ └── skill.json
|
|
540
|
+
├── requirements.txt
|
|
541
|
+
├── run.bat
|
|
542
|
+
├── build-portable.bat
|
|
543
|
+
└── skill.json
|
|
544
|
+
```
|
|
545
|
+
|
|
546
|
+
### python-flet-migrate
|
|
547
|
+
|
|
548
|
+
Plantilla para migrar aplicaciones Tkinter/CTkinter a Flet.
|
|
549
|
+
|
|
550
|
+
```
|
|
551
|
+
mi-app/
|
|
552
|
+
├── src/
|
|
553
|
+
│ ├── main.py
|
|
554
|
+
│ └── migrate_tkinter.py
|
|
555
|
+
├── requirements.txt
|
|
469
556
|
└── skill.json
|
|
470
557
|
```
|
|
471
558
|
|
|
559
|
+
### python-customtkinter
|
|
560
|
+
|
|
561
|
+
Plantilla GUI de escritorio con **CustomTkinter** (tema oscuro moderno).
|
|
562
|
+
|
|
563
|
+
```
|
|
564
|
+
mi-app/
|
|
565
|
+
├── src/
|
|
566
|
+
│ ├── main.py
|
|
567
|
+
│ └── core/
|
|
568
|
+
│ └── skill.json
|
|
569
|
+
├── requirements.txt
|
|
570
|
+
├── run.bat
|
|
571
|
+
└── build-portable.bat
|
|
572
|
+
```
|
|
573
|
+
|
|
472
574
|
### vba-excel
|
|
473
575
|
|
|
474
576
|
Plantilla VBA para Excel.
|
|
@@ -564,6 +666,14 @@ Proyectos minimalistas - scripts, CLI, Python.
|
|
|
564
666
|
|
|
565
667
|
Configuración personalizada - colores ajustables.
|
|
566
668
|
|
|
669
|
+
### flet-desktop
|
|
670
|
+
|
|
671
|
+
Aplicaciones de escritorio Flet - estilo moderno G360 (PC).
|
|
672
|
+
|
|
673
|
+
### flet-desktop-corporativo
|
|
674
|
+
|
|
675
|
+
Aplicaciones Flet para clientes - estilo corporativo conservador.
|
|
676
|
+
|
|
567
677
|
### Ejemplos de uso
|
|
568
678
|
|
|
569
679
|
```bash
|
|
@@ -627,6 +737,48 @@ await g360.clean({ path: '.', force: true });
|
|
|
627
737
|
|
|
628
738
|
---
|
|
629
739
|
|
|
740
|
+
## Estructura
|
|
741
|
+
|
|
742
|
+
```
|
|
743
|
+
g360-cli/
|
|
744
|
+
├── src/
|
|
745
|
+
│ ├── cli.js # Entrada principal CLI
|
|
746
|
+
│ ├── commands/ # Comandos (init, bring, audit, etc.)
|
|
747
|
+
│ ├── lib/ # Utilidades (assets, auditor, config)
|
|
748
|
+
│ └── assets/ # Assets embebidos
|
|
749
|
+
│ ├── templates/ # Plantillas de proyecto
|
|
750
|
+
│ ├── components/ # Componentes G360
|
|
751
|
+
│ ├── skills/ # Skills de identidad
|
|
752
|
+
│ ├── engine/ # G360 Engine
|
|
753
|
+
│ └── config/ # Configuraciones
|
|
754
|
+
├── package.json
|
|
755
|
+
├── README.md
|
|
756
|
+
└── LICENSE
|
|
757
|
+
```
|
|
758
|
+
|
|
759
|
+
---
|
|
760
|
+
|
|
761
|
+
## Scripts
|
|
762
|
+
|
|
763
|
+
| Comando | Descripción |
|
|
764
|
+
|---------|-------------|
|
|
765
|
+
| `npm run build` | Build portable con pkg (g360.exe) |
|
|
766
|
+
| `npm run build:portable` | Especificar target node18-win-x64 |
|
|
767
|
+
| `npm test` | Ejecutar tests (actualmente placeholder) |
|
|
768
|
+
| `npm run prepublishOnly` | Validación antes de publicar en npm |
|
|
769
|
+
|
|
770
|
+
---
|
|
771
|
+
|
|
772
|
+
## Testing
|
|
773
|
+
|
|
774
|
+
```bash
|
|
775
|
+
npm test
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
Actualmente configurado con un placeholder. Próximamente se integrará con Vitest para testing de comandos y utilidades.
|
|
779
|
+
|
|
780
|
+
---
|
|
781
|
+
|
|
630
782
|
## Contribución
|
|
631
783
|
|
|
632
784
|
1. Fork el repositorio
|
|
@@ -643,9 +795,36 @@ MIT License - ver [LICENSE](LICENSE) para más detalles.
|
|
|
643
795
|
|
|
644
796
|
---
|
|
645
797
|
|
|
798
|
+
## Ecosistema G360
|
|
799
|
+
|
|
800
|
+
Este proyecto forma parte de la familia de microherramientas **G360** para apoyo CRM y gestión de datos en escritorio, enfocadas en áreas como ventas, finanzas y logística.
|
|
801
|
+
|
|
802
|
+
### Identidad Visual G360
|
|
803
|
+
|
|
804
|
+
- **Isotipo**: 3 puntos verticales paralelos (gris-verde-gris) + chevron `>`
|
|
805
|
+
- **Colores**: #00d084 (verde), #94a3b8 (gris)
|
|
806
|
+
- **Marca**: G360 - Microherramientas para apoyo CRM y datos en escritorio
|
|
807
|
+
- **Implementación**: Usar `g360-signature` para branding consistente
|
|
808
|
+
|
|
809
|
+
### Herramientas Relacionadas
|
|
810
|
+
|
|
811
|
+
- **[g360-signature](https://github.com/carloscus/g360-signature)**: Web component de branding G360
|
|
812
|
+
- **[g360-order-xlsx](https://github.com/carloscus/g360-order-xlsx)**: Procesador de cotizaciones Excel
|
|
813
|
+
- **[g360-day-calculator](https://github.com/carloscus/g360-day-calculator)**: Calculadora de días laborables
|
|
814
|
+
- **[g360-master-data](https://github.com/carloscus/g360-master-data)**: Gestión de datos maestros
|
|
815
|
+
|
|
816
|
+
---
|
|
817
|
+
|
|
646
818
|
## Enlaces
|
|
647
819
|
|
|
648
820
|
- [npm](https://www.npmjs.com/package/g360-cli)
|
|
649
821
|
- [GitHub](https://github.com/carloscus/g360-cli)
|
|
650
822
|
- [Documentación](#)
|
|
651
823
|
- [Reportar Issue](https://github.com/carloscus/g360-cli/issues)
|
|
824
|
+
|
|
825
|
+
---
|
|
826
|
+
**Marca**: G360
|
|
827
|
+
**Isotipo**: 3 puntos verticales paralelos (gris-verde-gris) + chevron `>`
|
|
828
|
+
**Autor**: Carlos Cusi
|
|
829
|
+
**Desarrollo**: Con asistencia de herramientas de código IA (Vibe Code)
|
|
830
|
+
**Powered by**: [g360-signature](https://github.com/carloscus/g360-signature)
|
package/dist/g360.exe
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "g360-cli",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "CLI tool for bootstrapping G360
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "CLI tool for bootstrapping G360 projects with standardized structure, assets, and identity",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/cli.js",
|
|
7
7
|
"bin": {
|
|
8
|
-
"g360": "
|
|
8
|
+
"g360": "src/cli.js"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
11
|
"prepublishOnly": "node -e \"console.log('Use: npm install -g g360-cli')\"",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"author": "Carlos Cusi",
|
|
29
29
|
"license": "MIT",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"chalk": "^5.
|
|
32
|
-
"commander": "^
|
|
33
|
-
"fs-extra": "^11.
|
|
34
|
-
"inquirer": "^
|
|
35
|
-
"ora": "^
|
|
31
|
+
"chalk": "^5.6.2",
|
|
32
|
+
"commander": "^14.0.3",
|
|
33
|
+
"fs-extra": "^11.3.4",
|
|
34
|
+
"inquirer": "^13.4.2",
|
|
35
|
+
"ora": "^9.4.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"pkg": "^5.8.1"
|
|
@@ -167,6 +167,58 @@
|
|
|
167
167
|
"mode": "custom",
|
|
168
168
|
"text": "custom"
|
|
169
169
|
}
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"name": "flet-desktop",
|
|
173
|
+
"description": "Aplicaciones de escritorio Flet - estilo G360",
|
|
174
|
+
"device": "pc",
|
|
175
|
+
"colors": {
|
|
176
|
+
"bg": "#0b1220",
|
|
177
|
+
"surface": "#1a2332",
|
|
178
|
+
"accent": "#00d084",
|
|
179
|
+
"text": "#f0f4f8",
|
|
180
|
+
"muted": "#94a3b8",
|
|
181
|
+
"success": "#22c55e",
|
|
182
|
+
"warning": "#f59e0b",
|
|
183
|
+
"error": "#ef4444"
|
|
184
|
+
},
|
|
185
|
+
"effects": {
|
|
186
|
+
"glassmorphism": true,
|
|
187
|
+
"blur": "12px",
|
|
188
|
+
"rounded": "12px"
|
|
189
|
+
},
|
|
190
|
+
"signature": {
|
|
191
|
+
"mode": "own",
|
|
192
|
+
"text": "G360 Desktop"
|
|
193
|
+
},
|
|
194
|
+
"framework": "flet",
|
|
195
|
+
"portable": true
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"name": "flet-desktop-corporativo",
|
|
199
|
+
"description": "Aplicaciones Flet para clientes - estilo corporativo",
|
|
200
|
+
"device": "pc",
|
|
201
|
+
"colors": {
|
|
202
|
+
"bg": "#ffffff",
|
|
203
|
+
"surface": "#f8fafc",
|
|
204
|
+
"accent": "#00796B",
|
|
205
|
+
"text": "#1e293b",
|
|
206
|
+
"muted": "#64748b",
|
|
207
|
+
"success": "#10b981",
|
|
208
|
+
"warning": "#f59e0b",
|
|
209
|
+
"error": "#dc2626"
|
|
210
|
+
},
|
|
211
|
+
"effects": {
|
|
212
|
+
"glassmorphism": false,
|
|
213
|
+
"blur": "0px",
|
|
214
|
+
"rounded": "8px"
|
|
215
|
+
},
|
|
216
|
+
"signature": {
|
|
217
|
+
"mode": "powered",
|
|
218
|
+
"text": "powered by G360"
|
|
219
|
+
},
|
|
220
|
+
"framework": "flet",
|
|
221
|
+
"portable": true
|
|
170
222
|
}
|
|
171
223
|
]
|
|
172
224
|
}
|
|
@@ -21,6 +21,22 @@
|
|
|
21
21
|
"framework": "python",
|
|
22
22
|
"features": ["cli", "argparse", "rich"]
|
|
23
23
|
},
|
|
24
|
+
{
|
|
25
|
+
"id": "python-flet",
|
|
26
|
+
"name": "Python Flet Desktop",
|
|
27
|
+
"description": "Python desktop app with Flet framework",
|
|
28
|
+
"framework": "flet",
|
|
29
|
+
"features": ["desktop", "gui", "cross-platform", "portable"],
|
|
30
|
+
"portable": true
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"id": "python-flet-migrate",
|
|
34
|
+
"name": "Python Flet Migration",
|
|
35
|
+
"description": "Migrate tkinter/ctkinter app to Flet",
|
|
36
|
+
"framework": "flet",
|
|
37
|
+
"features": ["migration", "desktop", "gui", "portable"],
|
|
38
|
+
"portable": true
|
|
39
|
+
},
|
|
24
40
|
{
|
|
25
41
|
"id": "vba-excel",
|
|
26
42
|
"name": "VBA Excel",
|
|
@@ -25,6 +25,18 @@
|
|
|
25
25
|
"description": "Backend development agent",
|
|
26
26
|
"files": []
|
|
27
27
|
},
|
|
28
|
+
{
|
|
29
|
+
"name": "python-desktop",
|
|
30
|
+
"description": "Python Flet desktop development agent",
|
|
31
|
+
"files": [],
|
|
32
|
+
"capabilities": ["flet", "gui", "desktop", "portable", "migrate-tkinter", "migrate-ctkinter"]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "python-calculations",
|
|
36
|
+
"description": "Python calculations and data processing agent",
|
|
37
|
+
"files": [],
|
|
38
|
+
"capabilities": ["python", "math", "data-processing", "statistics", "flet-ui"]
|
|
39
|
+
},
|
|
28
40
|
{
|
|
29
41
|
"name": "calculations",
|
|
30
42
|
"description": "Calculations and data processing",
|
|
@@ -1,5 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"snippets": [
|
|
3
|
+
{
|
|
4
|
+
"name": "cli-argparse-basic",
|
|
5
|
+
"description": "Basic argparse CLI structure",
|
|
6
|
+
"language": "python",
|
|
7
|
+
"code": "import argparse\n\nparser = argparse.ArgumentParser(description='My CLI App')\nparser.add_argument('input', help='Input file')\nparser.add_argument('-v', '--verbose', action='store_true')\nparser.add_argument('-o', '--output', default='output.txt')\nargs = parser.parse_args()"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"name": "cli-subcommands",
|
|
11
|
+
"description": "CLI with subcommands (git-style)",
|
|
12
|
+
"language": "python",
|
|
13
|
+
"code": "import argparse\n\nparser = argparse.ArgumentParser()\nsubparsers = parser.add_subparsers()\n\ninit_parser = subparsers.add_parser('init')\ninit_parser.add_argument('name')\n\nrun_parser = subparsers.add_parser('run')\nrun_parser.add_argument('--watch', action='store_true')"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "cli-logging",
|
|
17
|
+
"description": "Logging setup for CLI",
|
|
18
|
+
"language": "python",
|
|
19
|
+
"code": "import logging\nimport sys\n\ndef setup_logging(verbose=False):\n level = logging.DEBUG if verbose else logging.INFO\n logging.basicConfig(\n level=level,\n format='%(asctime)s - %(levelname)s - %(message)s',\n handlers=[logging.StreamHandler(sys.stdout)]\n )\n return logging.getLogger(__name__)"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "cli-config-json",
|
|
23
|
+
"description": "Load JSON config file",
|
|
24
|
+
"language": "python",
|
|
25
|
+
"code": "import json\nfrom pathlib import Path\n\ndef load_config(config_path='config.json'):\n path = Path(config_path)\n if not path.exists():\n raise FileNotFoundError(f'Config not found: {config_path}')\n with open(path) as f:\n return json.load(f)"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"name": "cli-progress-bar",
|
|
29
|
+
"description": "Progress bar with tqdm",
|
|
30
|
+
"language": "python",
|
|
31
|
+
"code": "from tqdm import tqdm\n\nfor item in tqdm(items, desc='Processing', unit='item'):\n # process item\n pass"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "cli-env-config",
|
|
35
|
+
"description": "Environment-based configuration",
|
|
36
|
+
"language": "python",
|
|
37
|
+
"code": "import os\nfrom pathlib import Path\n\ndef get_config():\n env = os.getenv('APP_ENV', 'development')\n config_dir = Path(__file__).parent / 'config'\n config_file = config_dir / f'{env}.json'\n return json.loads(config_file.read_text())"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"name": "cli-exit-codes",
|
|
41
|
+
"description": "Exit codes constants",
|
|
42
|
+
"language": "python",
|
|
43
|
+
"code": "EXIT_OK = 0\nEXIT_ERROR = 1\nEXIT_USAGE = 2\nEXIT_DATA = 3\n\n# Usage: sys.exit(EXIT_ERROR)"
|
|
44
|
+
},
|
|
3
45
|
{
|
|
4
46
|
"name": "g360-header",
|
|
5
47
|
"description": "Standard G360 header",
|
|
@@ -19,6 +61,41 @@
|
|
|
19
61
|
"name": "g360-badge",
|
|
20
62
|
"description": "G360 status badge",
|
|
21
63
|
"code": "<span class='g360-badge g360-badge-success'>Active</span>"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "flet-page",
|
|
67
|
+
"description": "Flet page setup with G360 theme",
|
|
68
|
+
"code": "import flet as ft\n\ndef main(page: ft.Page):\n page.title = 'G360 App'\n page.theme_mode = ft.ThemeMode.DARK\n page.bgcolor = '#0b1220'\n page.padding = 20\n page.add(ft.Text('G360 Desktop App', size=24, color='#00d084'))"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "flet-card",
|
|
72
|
+
"description": "G360 styled Flet Card",
|
|
73
|
+
"code": "ft.Container(\n content=ft.Column([...]),\n bgcolor='#1a2332',\n border_radius=12,\n padding=15,\n shadow=ft.BoxShadow(\n spread_radius=1,\n blur_radius=20,\n color='#00d08420'\n )\n)"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "flet-button",
|
|
77
|
+
"description": "G360 styled Flet Button",
|
|
78
|
+
"code": "ft.ElevatedButton(\n content=ft.Text('G360 Button', color='#0b1220'),\n style=ft.ButtonStyle(\n bgcolor='#00d084',\n color='#0b1220',\n shape=ft.RoundedRectangleBorder(radius=8),\n padding=15\n )\n)"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
"name": "flet-nav-rail",
|
|
82
|
+
"description": "Flet navigation rail for desktop",
|
|
83
|
+
"code": "ft.NavigationRail(\n selected_index=0,\n label_type=ft.NavigationRailLabelType.ALL,\n min_width=100,\n min_extended_width=200,\n destinations=[\n ft.NavigationRailDestination(icon=ft.icons.HOME_OUTLINED, selected_icon=ft.icons.HOME, label='Home'),\n ft.NavigationRailDestination(icon=ft.icons.SETTINGS_OUTLINED, selected_icon=ft.icons.SETTINGS, label='Settings'),\n ]\n)"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "flet-datatable",
|
|
87
|
+
"description": "Flet DataTable with G360 styling",
|
|
88
|
+
"code": "ft.DataTable(\n heading_row_color='#00d084',\n data_row_color='#1a2332',\n columns=[\n ft.DataColumn(ft.Text('SKU', color='#f0f4f8')),\n ft.DataColumn(ft.Text('Descripción', color='#f0f4f8')),\n ft.DataColumn(ft.Text('Cantidad', color='#f0f4f8')),\n ],\n rows=[]\n)"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
"name": "flet-dialog",
|
|
92
|
+
"description": "Flet modal dialog",
|
|
93
|
+
"code": "def show_dialog(page, title, content):\n dialog = ft.AlertDialog(\n title=ft.Text(title, color='#00d084'),\n content=ft.Container(content=content, padding=20),\n actions=[\n ft.TextButton('Cancelar', on_click=lambda _: page.close_dialog()),\n ft.ElevatedButton('Aceptar', bgcolor='#00d084', color='#0b1220'),\n ]\n )\n page.dialog = dialog\n dialog.open = True\n page.update()"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"name": "flet-chart-bar",
|
|
97
|
+
"description": "Flet bar chart for data visualization",
|
|
98
|
+
"code": "ft.BarChart(\n bar_groups=[\n ft.BarChartGroup(\n x=0,\n bar_rods=[\n ft.BarChartRod(\n from_y=0,\n to_y=50,\n width=40,\n color='#00d084',\n ),\n ],\n ),\n ],\n left_axis=ft.ChartAxis(labels_size=40),\n bottom_axis=ft.ChartAxis(labels=[...]),\n)"
|
|
22
99
|
}
|
|
23
100
|
]
|
|
24
101
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
chcp 65001 >nul
|
|
3
|
+
title G360 - Portable CLI Launcher
|
|
4
|
+
|
|
5
|
+
echo.
|
|
6
|
+
echo ==============================================
|
|
7
|
+
echo G360 CLI - Portable Version
|
|
8
|
+
echo (Requires Python installed)
|
|
9
|
+
echo ==============================================
|
|
10
|
+
echo.
|
|
11
|
+
|
|
12
|
+
python --version >nul 2>&1
|
|
13
|
+
if errorlevel 1 (
|
|
14
|
+
echo ERROR: Python no encontrado
|
|
15
|
+
echo Instala Python desde: https://python.org
|
|
16
|
+
echo O usa setup.bat para configurar ambiente
|
|
17
|
+
pause
|
|
18
|
+
exit /b 1
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
echo Buscando archivo principal...
|
|
22
|
+
if not exist "src\main.py" (
|
|
23
|
+
echo ERROR: src\main.py no encontrado
|
|
24
|
+
pause
|
|
25
|
+
exit /b 1
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
echo Ejecutando G360 CLI...
|
|
29
|
+
echo.
|
|
30
|
+
python src\main.py %*
|
|
31
|
+
|
|
32
|
+
echo.
|
|
33
|
+
pause
|
|
@@ -1,13 +1,117 @@
|
|
|
1
1
|
#!/usr/bin/env python3
|
|
2
2
|
"""
|
|
3
3
|
G360 Python CLI Application
|
|
4
|
+
Main entry point with argparse-based CLI structure
|
|
4
5
|
"""
|
|
5
6
|
|
|
7
|
+
import argparse
|
|
8
|
+
import sys
|
|
9
|
+
import os
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
VERSION = "1.0.0"
|
|
13
|
+
APP_NAME = "G360 CLI"
|
|
14
|
+
AUTHOR = "Carlos Cusi"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def setup_logging(verbose=False):
|
|
18
|
+
"""Configure logging based on verbose flag"""
|
|
19
|
+
import logging
|
|
20
|
+
level = logging.DEBUG if verbose else logging.INFO
|
|
21
|
+
format_str = "%(asctime)s - %(levelname)s - %(message)s"
|
|
22
|
+
logging.basicConfig(level=level, format=format_str, datefmt="%H:%M:%S")
|
|
23
|
+
return logging.getLogger(__name__)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def cmd_hello(args):
|
|
27
|
+
"""Hello world command example"""
|
|
28
|
+
print(f"\n{APP_NAME} v{VERSION}")
|
|
29
|
+
print(f"Author: {AUTHOR}")
|
|
30
|
+
print(f"Working directory: {os.getcwd()}")
|
|
31
|
+
if args.name:
|
|
32
|
+
print(f"\nHello, {args.name}!")
|
|
33
|
+
print()
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def cmd_process(args):
|
|
37
|
+
"""Process data command"""
|
|
38
|
+
logger = setup_logging(args.verbose)
|
|
39
|
+
logger.info(f"Processing: {args.input}")
|
|
40
|
+
|
|
41
|
+
if not os.path.exists(args.input):
|
|
42
|
+
logger.error(f"Input file not found: {args.input}")
|
|
43
|
+
return 1
|
|
44
|
+
|
|
45
|
+
output_dir = args.output or os.path.dirname(args.input) or "."
|
|
46
|
+
logger.info(f"Output directory: {output_dir}")
|
|
47
|
+
|
|
48
|
+
print(f"✓ Processed {args.input}")
|
|
49
|
+
return 0
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def cmd_config(args):
|
|
53
|
+
"""Show or edit configuration"""
|
|
54
|
+
config_path = Path("g360") / "config.json"
|
|
55
|
+
|
|
56
|
+
if args.show:
|
|
57
|
+
if config_path.exists():
|
|
58
|
+
import json
|
|
59
|
+
with open(config_path) as f:
|
|
60
|
+
print(json.dumps(json.load(f), indent=2))
|
|
61
|
+
else:
|
|
62
|
+
print("No config file found. Run: g360 init")
|
|
63
|
+
return
|
|
64
|
+
|
|
65
|
+
if args.set:
|
|
66
|
+
key, value = args.set.split("=")
|
|
67
|
+
print(f"Setting {key} = {value}")
|
|
68
|
+
|
|
6
69
|
|
|
7
70
|
def main():
|
|
8
|
-
|
|
9
|
-
|
|
71
|
+
parser = argparse.ArgumentParser(
|
|
72
|
+
prog="g360",
|
|
73
|
+
description=f"{APP_NAME} - CLI tool for G360 ecosystem",
|
|
74
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
75
|
+
epilog="""
|
|
76
|
+
Examples:
|
|
77
|
+
g360 hello
|
|
78
|
+
g360 hello --name "World"
|
|
79
|
+
g360 process data.csv -o output/
|
|
80
|
+
g360 config --show
|
|
81
|
+
"""
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
parser.add_argument("-v", "--version", action="version", version=f"%(prog)s {VERSION}")
|
|
85
|
+
parser.add_argument("--verbose", "-V", action="store_true", help="Enable verbose output")
|
|
86
|
+
|
|
87
|
+
subparsers = parser.add_subparsers(dest="command", help="Available commands")
|
|
88
|
+
|
|
89
|
+
hello_parser = subparsers.add_parser("hello", help="Say hello")
|
|
90
|
+
hello_parser.add_argument("--name", "-n", help="Name to greet")
|
|
91
|
+
|
|
92
|
+
process_parser = subparsers.add_parser("process", help="Process input data")
|
|
93
|
+
process_parser.add_argument("input", help="Input file or directory")
|
|
94
|
+
process_parser.add_argument("-o", "--output", help="Output directory")
|
|
95
|
+
|
|
96
|
+
config_parser = subparsers.add_parser("config", help="Manage configuration")
|
|
97
|
+
config_parser.add_argument("--show", action="store_true", help="Show current config")
|
|
98
|
+
config_parser.add_argument("--set", metavar="KEY=VALUE", help="Set config value")
|
|
99
|
+
|
|
100
|
+
args = parser.parse_args()
|
|
101
|
+
|
|
102
|
+
if not args.command:
|
|
103
|
+
parser.print_help()
|
|
104
|
+
return 0
|
|
105
|
+
|
|
106
|
+
if args.command == "hello":
|
|
107
|
+
return cmd_hello(args)
|
|
108
|
+
elif args.command == "process":
|
|
109
|
+
return cmd_process(args)
|
|
110
|
+
elif args.command == "config":
|
|
111
|
+
return cmd_config(args)
|
|
112
|
+
|
|
113
|
+
return 0
|
|
10
114
|
|
|
11
115
|
|
|
12
116
|
if __name__ == "__main__":
|
|
13
|
-
main()
|
|
117
|
+
sys.exit(main())
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# G360 CustomTkinter Template
|
|
2
|
+
|
|
3
|
+
Modern GUI desktop application with CustomTkinter and G360 theming.
|
|
4
|
+
|
|
5
|
+
## Requisitos
|
|
6
|
+
|
|
7
|
+
- Python 3.8+
|
|
8
|
+
- customtkinter
|
|
9
|
+
|
|
10
|
+
## Instalacion
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
pip install -r requirements.txt
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Ejecutar
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
run.bat
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Portable
|
|
23
|
+
|
|
24
|
+
Ejecuta `build-portable.bat` - requiere Python instalado en el sistema.
|
|
25
|
+
|
|
26
|
+
## Estructura
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
python-customtkinter/
|
|
30
|
+
├── src/
|
|
31
|
+
│ ├── main.py # App principal
|
|
32
|
+
│ └── core/
|
|
33
|
+
│ └── skill.json # Configuracion G360
|
|
34
|
+
├── requirements.txt
|
|
35
|
+
├── run.bat # Ejecutar desarrollo
|
|
36
|
+
└── build-portable.bat # Version portable
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Caracteristicas
|
|
40
|
+
|
|
41
|
+
- Tema oscuro G360 (#0b1220, #1a2332, #00d084)
|
|
42
|
+
- UI moderna con CustomTkinter
|
|
43
|
+
- Listo para expansion
|
|
44
|
+
|
|
45
|
+
## License
|
|
46
|
+
|
|
47
|
+
MIT - G360 Ecosystem
|