ezshell 0.2.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.
Files changed (61) hide show
  1. ezshell-0.2.0/LICENSE +21 -0
  2. ezshell-0.2.0/PKG-INFO +174 -0
  3. ezshell-0.2.0/README.md +154 -0
  4. ezshell-0.2.0/ezshell.egg-info/PKG-INFO +174 -0
  5. ezshell-0.2.0/ezshell.egg-info/SOURCES.txt +59 -0
  6. ezshell-0.2.0/ezshell.egg-info/dependency_links.txt +1 -0
  7. ezshell-0.2.0/ezshell.egg-info/entry_points.txt +3 -0
  8. ezshell-0.2.0/ezshell.egg-info/requires.txt +9 -0
  9. ezshell-0.2.0/ezshell.egg-info/top_level.txt +1 -0
  10. ezshell-0.2.0/pyproject.toml +41 -0
  11. ezshell-0.2.0/setup.cfg +4 -0
  12. ezshell-0.2.0/src/__init__.py +3 -0
  13. ezshell-0.2.0/src/app.py +286 -0
  14. ezshell-0.2.0/src/core/__init__.py +0 -0
  15. ezshell-0.2.0/src/core/assistant.py +525 -0
  16. ezshell-0.2.0/src/core/capture.py +213 -0
  17. ezshell-0.2.0/src/core/chat_bridge.py +107 -0
  18. ezshell-0.2.0/src/core/config.py +238 -0
  19. ezshell-0.2.0/src/core/context.py +229 -0
  20. ezshell-0.2.0/src/core/groq_client.py +376 -0
  21. ezshell-0.2.0/src/core/llm_client.py +111 -0
  22. ezshell-0.2.0/src/core/prompts.py +262 -0
  23. ezshell-0.2.0/src/core/provider.py +233 -0
  24. ezshell-0.2.0/src/core/proxy_client.py +166 -0
  25. ezshell-0.2.0/src/core/pty_shell.py +273 -0
  26. ezshell-0.2.0/src/core/redact.py +95 -0
  27. ezshell-0.2.0/src/core/risk.py +455 -0
  28. ezshell-0.2.0/src/core/safety.py +268 -0
  29. ezshell-0.2.0/src/core/sanitize.py +39 -0
  30. ezshell-0.2.0/src/core/schema.py +65 -0
  31. ezshell-0.2.0/src/core/shell_hook.py +388 -0
  32. ezshell-0.2.0/src/core/suggest.py +94 -0
  33. ezshell-0.2.0/src/core/updater.py +428 -0
  34. ezshell-0.2.0/src/i18n.py +422 -0
  35. ezshell-0.2.0/src/main.py +346 -0
  36. ezshell-0.2.0/src/ui/chat_tui.py +634 -0
  37. ezshell-0.2.0/src/ui/gui_window.py +1018 -0
  38. ezshell-0.2.0/src/ui/inline.py +330 -0
  39. ezshell-0.2.0/src/ui/logo.py +194 -0
  40. ezshell-0.2.0/src/ui/panel.py +163 -0
  41. ezshell-0.2.0/src/ui/prompt.py +184 -0
  42. ezshell-0.2.0/src/ui/render.py +269 -0
  43. ezshell-0.2.0/tests/test_assistant.py +124 -0
  44. ezshell-0.2.0/tests/test_capture_suggest.py +154 -0
  45. ezshell-0.2.0/tests/test_chat_bridge.py +94 -0
  46. ezshell-0.2.0/tests/test_chat_tui.py +120 -0
  47. ezshell-0.2.0/tests/test_config.py +38 -0
  48. ezshell-0.2.0/tests/test_context.py +50 -0
  49. ezshell-0.2.0/tests/test_e2e_shell.py +117 -0
  50. ezshell-0.2.0/tests/test_proxy_client.py +192 -0
  51. ezshell-0.2.0/tests/test_pty_shell.py +21 -0
  52. ezshell-0.2.0/tests/test_redact.py +36 -0
  53. ezshell-0.2.0/tests/test_redact_extra.py +72 -0
  54. ezshell-0.2.0/tests/test_release_files.py +51 -0
  55. ezshell-0.2.0/tests/test_risk.py +111 -0
  56. ezshell-0.2.0/tests/test_risk_powershell.py +76 -0
  57. ezshell-0.2.0/tests/test_safety.py +46 -0
  58. ezshell-0.2.0/tests/test_sanitize_schema.py +42 -0
  59. ezshell-0.2.0/tests/test_shell_hook.py +31 -0
  60. ezshell-0.2.0/tests/test_shell_hook_powershell.py +85 -0
  61. ezshell-0.2.0/tests/test_updater.py +308 -0
ezshell-0.2.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 waddle 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.
ezshell-0.2.0/PKG-INFO ADDED
@@ -0,0 +1,174 @@
1
+ Metadata-Version: 2.4
2
+ Name: ezshell
3
+ Version: 0.2.0
4
+ Summary: Terminal assistant: explains failed commands and suggests a fix you review before running
5
+ Author: Salomon
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: groq>=0.11.0
11
+ Requires-Dist: prompt_toolkit>=3.0.40
12
+ Requires-Dist: rich>=13.7.0
13
+ Requires-Dist: pyte>=0.8.2
14
+ Requires-Dist: python-dotenv>=1.0.0
15
+ Requires-Dist: textual>=8.0.0
16
+ Requires-Dist: customtkinter>=6.0.0
17
+ Requires-Dist: pillow>=10.0.0
18
+ Requires-Dist: pydantic>=2.5
19
+ Dynamic: license-file
20
+
21
+ <div align="center">
22
+
23
+ # ezShell
24
+
25
+ **Ton terminal t'explique ses erreurs.**
26
+ Une commande échoue ? `Alt+E` explique la cause et place une correction dans ton prompt. Tu relis, tu valides : rien n'est exécuté sans toi.
27
+
28
+ ![Python](https://img.shields.io/badge/python-3.10%2B-blue)
29
+ ![Licence](https://img.shields.io/badge/licence-MIT-green)
30
+ ![Version](https://img.shields.io/badge/version-0.2.0-orange)
31
+
32
+ [Site](https://ezshell.vercel.app) · [Fonctionnalités](#fonctionnalités) · [Installation](#installation) · [Utilisation](#utilisation) · [Licence](#licence)
33
+
34
+ <img src="docs/preview.webp" alt="Aperçu d'ezShell : après « npm run dev » qui échoue avec « vite: command not found », le panneau ezShell explique que vite n'est pas installé et propose la commande npm install -D vite" width="860">
35
+
36
+ </div>
37
+
38
+ ---
39
+
40
+ ## Fonctionnalités
41
+
42
+ - **Diagnostic de la dernière erreur** : la cause probable, en français ou en anglais selon ta locale.
43
+ - **Correction insérée dans le prompt** : la commande arrive dans ta ligne de saisie ; c'est toi qui appuies sur Entrée.
44
+ - **Langage naturel** : tape ta demande (« lister les ports ouverts ») puis `Alt+E` pour obtenir la commande.
45
+ - **Niveau de risque** : faible, moyen ou élevé. Les règles locales d'ezShell relèvent le niveau si le modèle le sous-estime, et une commande à risque élevé exige une confirmation explicite (`y`).
46
+ - **Sans clé API** : ezShell passe par son service hébergé ; ton appareil reçoit un jeton anonyme avec un quota quotidien gratuit.
47
+ - **Secrets masqués** : mots de passe, clés API, jetons, identifiants dans les URL et clés privées sont masqués avant l'envoi, puis une seconde fois sur le serveur.
48
+ - **bash, zsh et fish** sur Linux et macOS, **PowerShell** sur Windows (bêta). Une fenêtre de bureau et une interface plein terminal sont aussi disponibles.
49
+
50
+ ---
51
+
52
+ ## Installation
53
+
54
+ Prérequis : Python 3.10 ou plus récent.
55
+
56
+ ```bash
57
+ pipx install ezshell
58
+ ```
59
+
60
+ Puis branche ezShell sur ton shell, en ajoutant la ligne correspondante à la fin de ton fichier de configuration :
61
+
62
+ | Shell | Fichier | Ligne |
63
+ |---|---|---|
64
+ | zsh | `~/.zshrc` | `eval "$(ezsh init zsh)"` |
65
+ | bash | `~/.bashrc` | `eval "$(ezsh init bash)"` |
66
+ | fish | `~/.config/fish/config.fish` | `ezsh init fish \| source` |
67
+ | PowerShell (Windows) | `$PROFILE` | `Invoke-Expression (& ezsh init powershell \| Out-String)` |
68
+
69
+ Pour bash, zsh et PowerShell, `ezsh init --install` ajoute la ligne à ta place. Ouvre ensuite un nouveau terminal.
70
+
71
+ **Windows (bêta) :** installe Python 3.10+ et [pipx](https://pipx.pypa.io/stable/), puis la même commande `pipx install` dans PowerShell (5.1 ou 7, avec PSReadLine). Si PowerShell refuse de charger ton profil, autorise les scripts locaux pour ton compte : `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`. Sous WSL, suis simplement les instructions Linux.
72
+
73
+ **Mettre à jour :** lance `ezsh --update`. ezShell affiche les nouveautés, te demande confirmation (réponse par défaut : non), puis met à jour. Ajoute `--yes` pour passer la confirmation dans un script. Quand une nouvelle version existe, une ligne discrète te le rappelle au plus une fois par jour ; `EZSH_NO_UPDATE_CHECK=1` la désactive. Sous Windows, la commande à lancer dans un nouveau terminal t'est affichée (un programme ne peut pas se remplacer pendant qu'il tourne). Si tu as installé ezShell depuis l'URL git avant la version 0.2.0, réinstalle une dernière fois : `pipx install --force ezshell`.
74
+
75
+ <details>
76
+ <summary>Autres méthodes d'installation</summary>
77
+
78
+ **Dernière version de développement** (pas encore publiée sur PyPI) : `pipx install git+https://github.com/Waddle-io/ezShell.git`
79
+
80
+ **Installateur en une ligne** (installe dans `~/.local/share/ezshell`, commandes dans `~/.local/bin`) :
81
+
82
+ ```bash
83
+ curl -fsSL https://raw.githubusercontent.com/Waddle-io/ezShell/main/install.sh | bash
84
+ ```
85
+
86
+ **Depuis les sources :**
87
+
88
+ ```bash
89
+ git clone https://github.com/Waddle-io/ezShell.git
90
+ cd ezShell
91
+ python3 -m venv .venv
92
+ source .venv/bin/activate
93
+ pip install -e .
94
+ ```
95
+
96
+ La fenêtre de bureau nécessite Tk (`sudo apt install python3-tk` sur Debian/Ubuntu).
97
+ </details>
98
+
99
+ Désinstaller : retire la ligne `ezsh init` de ton fichier de configuration, puis `pipx uninstall ezshell`.
100
+
101
+ ---
102
+
103
+ ## Utilisation
104
+
105
+ ### Dans ton terminal (`Alt+E`)
106
+
107
+ Lance une commande qui échoue (par exemple `git psuh`), puis appuie sur `Alt+E`.
108
+
109
+ | Touche | Action |
110
+ |---|---|
111
+ | `Entrée` | Insérer la commande dans le prompt (risque faible ou moyen) |
112
+ | `y` | Insérer une commande à risque élevé ou sur plusieurs lignes |
113
+ | `e` | Modifier la commande avant de l'insérer |
114
+ | `c` | Copier dans le presse-papiers |
115
+ | `/` | Poser une autre question |
116
+ | `q` / `Échap` | Fermer sans rien insérer |
117
+
118
+ Pour un diagnostic plus précis, lance la commande via `ezsh run` : la fin de sa sortie d'erreur est gardée (et masquée) pour l'analyse.
119
+
120
+ ```bash
121
+ ezsh run -- npm run build
122
+ ```
123
+
124
+ `ezsh suggest --ask "trouver les fichiers de plus de 1 Go"` ouvre le même panneau sans raccourci.
125
+
126
+ ### Autres modes
127
+
128
+ ```bash
129
+ ezsh # fenêtre de bureau (interface terminal si aucun affichage)
130
+ ezsh --tui # interface plein terminal, pratique en SSH
131
+ ezsh --explain "docker: Error response from daemon: port is already allocated"
132
+ ezsh --check-key # vérifie que le service ezShell répond
133
+ ezsh --version
134
+ ```
135
+
136
+ `ezsh --help` liste toutes les options.
137
+
138
+ ### Configuration
139
+
140
+ Aucune configuration n'est nécessaire. Variables utiles :
141
+
142
+ | Variable | Rôle |
143
+ |---|---|
144
+ | `EZSHELL_LANG` | Force la langue (`fr` ou `en`) ; sinon déduite de `$LANG` |
145
+ | `EZSH_API_URL` | URL du service (défaut : `https://ezshell.vercel.app`) |
146
+ | `EZSH_DIRECT=1` | Appelle Groq directement avec ta propre clé (`GROQ_API_KEY` ou `ezsh --set-key`) |
147
+ | `EZSH_MODEL` | Modèle en mode direct (défaut : `openai/gpt-oss-120b`) |
148
+ | `EZSH_STATE_DIR` | Dossier d'état par terminal (défaut : `$XDG_RUNTIME_DIR/ezsh`, `%LOCALAPPDATA%\ezsh` sous Windows) |
149
+ | `EZSH_MOCK_LLM=1` | Simule le modèle, sans réseau (développement) |
150
+
151
+ ---
152
+
153
+ ## Confidentialité
154
+
155
+ Rien n'est envoyé tant que tu n'appuies pas sur `Alt+E`. Sont alors envoyés : ton OS et ton shell, le dossier courant (avec `~` à la place de ton nom), la dernière commande, son code de sortie et, si tu passes par `ezsh run`, la fin de sa sortie d'erreur (4 Ko max). Le service ne conserve pas le contenu des requêtes : seulement un jeton d'appareil haché et des compteurs de quota.
156
+
157
+ ---
158
+
159
+ ## Développement
160
+
161
+ ```bash
162
+ pip install -e . -r requirements-dev.txt
163
+ pytest
164
+ ruff check src tests
165
+ EZSH_MOCK_LLM=1 ezsh suggest --ask "lister les gros fichiers"
166
+ ```
167
+
168
+ Le service hébergé (Next.js + Postgres) est dans [`web/`](web/README.md). Voir aussi [`CONTRIBUTING.md`](CONTRIBUTING.md) et [`DEVELOPMENT.md`](DEVELOPMENT.md).
169
+
170
+ ---
171
+
172
+ ## Licence
173
+
174
+ Distribué sous licence [MIT](LICENSE). © 2026 Salomon.
@@ -0,0 +1,154 @@
1
+ <div align="center">
2
+
3
+ # ezShell
4
+
5
+ **Ton terminal t'explique ses erreurs.**
6
+ Une commande échoue ? `Alt+E` explique la cause et place une correction dans ton prompt. Tu relis, tu valides : rien n'est exécuté sans toi.
7
+
8
+ ![Python](https://img.shields.io/badge/python-3.10%2B-blue)
9
+ ![Licence](https://img.shields.io/badge/licence-MIT-green)
10
+ ![Version](https://img.shields.io/badge/version-0.2.0-orange)
11
+
12
+ [Site](https://ezshell.vercel.app) · [Fonctionnalités](#fonctionnalités) · [Installation](#installation) · [Utilisation](#utilisation) · [Licence](#licence)
13
+
14
+ <img src="docs/preview.webp" alt="Aperçu d'ezShell : après « npm run dev » qui échoue avec « vite: command not found », le panneau ezShell explique que vite n'est pas installé et propose la commande npm install -D vite" width="860">
15
+
16
+ </div>
17
+
18
+ ---
19
+
20
+ ## Fonctionnalités
21
+
22
+ - **Diagnostic de la dernière erreur** : la cause probable, en français ou en anglais selon ta locale.
23
+ - **Correction insérée dans le prompt** : la commande arrive dans ta ligne de saisie ; c'est toi qui appuies sur Entrée.
24
+ - **Langage naturel** : tape ta demande (« lister les ports ouverts ») puis `Alt+E` pour obtenir la commande.
25
+ - **Niveau de risque** : faible, moyen ou élevé. Les règles locales d'ezShell relèvent le niveau si le modèle le sous-estime, et une commande à risque élevé exige une confirmation explicite (`y`).
26
+ - **Sans clé API** : ezShell passe par son service hébergé ; ton appareil reçoit un jeton anonyme avec un quota quotidien gratuit.
27
+ - **Secrets masqués** : mots de passe, clés API, jetons, identifiants dans les URL et clés privées sont masqués avant l'envoi, puis une seconde fois sur le serveur.
28
+ - **bash, zsh et fish** sur Linux et macOS, **PowerShell** sur Windows (bêta). Une fenêtre de bureau et une interface plein terminal sont aussi disponibles.
29
+
30
+ ---
31
+
32
+ ## Installation
33
+
34
+ Prérequis : Python 3.10 ou plus récent.
35
+
36
+ ```bash
37
+ pipx install ezshell
38
+ ```
39
+
40
+ Puis branche ezShell sur ton shell, en ajoutant la ligne correspondante à la fin de ton fichier de configuration :
41
+
42
+ | Shell | Fichier | Ligne |
43
+ |---|---|---|
44
+ | zsh | `~/.zshrc` | `eval "$(ezsh init zsh)"` |
45
+ | bash | `~/.bashrc` | `eval "$(ezsh init bash)"` |
46
+ | fish | `~/.config/fish/config.fish` | `ezsh init fish \| source` |
47
+ | PowerShell (Windows) | `$PROFILE` | `Invoke-Expression (& ezsh init powershell \| Out-String)` |
48
+
49
+ Pour bash, zsh et PowerShell, `ezsh init --install` ajoute la ligne à ta place. Ouvre ensuite un nouveau terminal.
50
+
51
+ **Windows (bêta) :** installe Python 3.10+ et [pipx](https://pipx.pypa.io/stable/), puis la même commande `pipx install` dans PowerShell (5.1 ou 7, avec PSReadLine). Si PowerShell refuse de charger ton profil, autorise les scripts locaux pour ton compte : `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`. Sous WSL, suis simplement les instructions Linux.
52
+
53
+ **Mettre à jour :** lance `ezsh --update`. ezShell affiche les nouveautés, te demande confirmation (réponse par défaut : non), puis met à jour. Ajoute `--yes` pour passer la confirmation dans un script. Quand une nouvelle version existe, une ligne discrète te le rappelle au plus une fois par jour ; `EZSH_NO_UPDATE_CHECK=1` la désactive. Sous Windows, la commande à lancer dans un nouveau terminal t'est affichée (un programme ne peut pas se remplacer pendant qu'il tourne). Si tu as installé ezShell depuis l'URL git avant la version 0.2.0, réinstalle une dernière fois : `pipx install --force ezshell`.
54
+
55
+ <details>
56
+ <summary>Autres méthodes d'installation</summary>
57
+
58
+ **Dernière version de développement** (pas encore publiée sur PyPI) : `pipx install git+https://github.com/Waddle-io/ezShell.git`
59
+
60
+ **Installateur en une ligne** (installe dans `~/.local/share/ezshell`, commandes dans `~/.local/bin`) :
61
+
62
+ ```bash
63
+ curl -fsSL https://raw.githubusercontent.com/Waddle-io/ezShell/main/install.sh | bash
64
+ ```
65
+
66
+ **Depuis les sources :**
67
+
68
+ ```bash
69
+ git clone https://github.com/Waddle-io/ezShell.git
70
+ cd ezShell
71
+ python3 -m venv .venv
72
+ source .venv/bin/activate
73
+ pip install -e .
74
+ ```
75
+
76
+ La fenêtre de bureau nécessite Tk (`sudo apt install python3-tk` sur Debian/Ubuntu).
77
+ </details>
78
+
79
+ Désinstaller : retire la ligne `ezsh init` de ton fichier de configuration, puis `pipx uninstall ezshell`.
80
+
81
+ ---
82
+
83
+ ## Utilisation
84
+
85
+ ### Dans ton terminal (`Alt+E`)
86
+
87
+ Lance une commande qui échoue (par exemple `git psuh`), puis appuie sur `Alt+E`.
88
+
89
+ | Touche | Action |
90
+ |---|---|
91
+ | `Entrée` | Insérer la commande dans le prompt (risque faible ou moyen) |
92
+ | `y` | Insérer une commande à risque élevé ou sur plusieurs lignes |
93
+ | `e` | Modifier la commande avant de l'insérer |
94
+ | `c` | Copier dans le presse-papiers |
95
+ | `/` | Poser une autre question |
96
+ | `q` / `Échap` | Fermer sans rien insérer |
97
+
98
+ Pour un diagnostic plus précis, lance la commande via `ezsh run` : la fin de sa sortie d'erreur est gardée (et masquée) pour l'analyse.
99
+
100
+ ```bash
101
+ ezsh run -- npm run build
102
+ ```
103
+
104
+ `ezsh suggest --ask "trouver les fichiers de plus de 1 Go"` ouvre le même panneau sans raccourci.
105
+
106
+ ### Autres modes
107
+
108
+ ```bash
109
+ ezsh # fenêtre de bureau (interface terminal si aucun affichage)
110
+ ezsh --tui # interface plein terminal, pratique en SSH
111
+ ezsh --explain "docker: Error response from daemon: port is already allocated"
112
+ ezsh --check-key # vérifie que le service ezShell répond
113
+ ezsh --version
114
+ ```
115
+
116
+ `ezsh --help` liste toutes les options.
117
+
118
+ ### Configuration
119
+
120
+ Aucune configuration n'est nécessaire. Variables utiles :
121
+
122
+ | Variable | Rôle |
123
+ |---|---|
124
+ | `EZSHELL_LANG` | Force la langue (`fr` ou `en`) ; sinon déduite de `$LANG` |
125
+ | `EZSH_API_URL` | URL du service (défaut : `https://ezshell.vercel.app`) |
126
+ | `EZSH_DIRECT=1` | Appelle Groq directement avec ta propre clé (`GROQ_API_KEY` ou `ezsh --set-key`) |
127
+ | `EZSH_MODEL` | Modèle en mode direct (défaut : `openai/gpt-oss-120b`) |
128
+ | `EZSH_STATE_DIR` | Dossier d'état par terminal (défaut : `$XDG_RUNTIME_DIR/ezsh`, `%LOCALAPPDATA%\ezsh` sous Windows) |
129
+ | `EZSH_MOCK_LLM=1` | Simule le modèle, sans réseau (développement) |
130
+
131
+ ---
132
+
133
+ ## Confidentialité
134
+
135
+ Rien n'est envoyé tant que tu n'appuies pas sur `Alt+E`. Sont alors envoyés : ton OS et ton shell, le dossier courant (avec `~` à la place de ton nom), la dernière commande, son code de sortie et, si tu passes par `ezsh run`, la fin de sa sortie d'erreur (4 Ko max). Le service ne conserve pas le contenu des requêtes : seulement un jeton d'appareil haché et des compteurs de quota.
136
+
137
+ ---
138
+
139
+ ## Développement
140
+
141
+ ```bash
142
+ pip install -e . -r requirements-dev.txt
143
+ pytest
144
+ ruff check src tests
145
+ EZSH_MOCK_LLM=1 ezsh suggest --ask "lister les gros fichiers"
146
+ ```
147
+
148
+ Le service hébergé (Next.js + Postgres) est dans [`web/`](web/README.md). Voir aussi [`CONTRIBUTING.md`](CONTRIBUTING.md) et [`DEVELOPMENT.md`](DEVELOPMENT.md).
149
+
150
+ ---
151
+
152
+ ## Licence
153
+
154
+ Distribué sous licence [MIT](LICENSE). © 2026 Salomon.
@@ -0,0 +1,174 @@
1
+ Metadata-Version: 2.4
2
+ Name: ezshell
3
+ Version: 0.2.0
4
+ Summary: Terminal assistant: explains failed commands and suggests a fix you review before running
5
+ Author: Salomon
6
+ License-Expression: MIT
7
+ Requires-Python: >=3.10
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Requires-Dist: groq>=0.11.0
11
+ Requires-Dist: prompt_toolkit>=3.0.40
12
+ Requires-Dist: rich>=13.7.0
13
+ Requires-Dist: pyte>=0.8.2
14
+ Requires-Dist: python-dotenv>=1.0.0
15
+ Requires-Dist: textual>=8.0.0
16
+ Requires-Dist: customtkinter>=6.0.0
17
+ Requires-Dist: pillow>=10.0.0
18
+ Requires-Dist: pydantic>=2.5
19
+ Dynamic: license-file
20
+
21
+ <div align="center">
22
+
23
+ # ezShell
24
+
25
+ **Ton terminal t'explique ses erreurs.**
26
+ Une commande échoue ? `Alt+E` explique la cause et place une correction dans ton prompt. Tu relis, tu valides : rien n'est exécuté sans toi.
27
+
28
+ ![Python](https://img.shields.io/badge/python-3.10%2B-blue)
29
+ ![Licence](https://img.shields.io/badge/licence-MIT-green)
30
+ ![Version](https://img.shields.io/badge/version-0.2.0-orange)
31
+
32
+ [Site](https://ezshell.vercel.app) · [Fonctionnalités](#fonctionnalités) · [Installation](#installation) · [Utilisation](#utilisation) · [Licence](#licence)
33
+
34
+ <img src="docs/preview.webp" alt="Aperçu d'ezShell : après « npm run dev » qui échoue avec « vite: command not found », le panneau ezShell explique que vite n'est pas installé et propose la commande npm install -D vite" width="860">
35
+
36
+ </div>
37
+
38
+ ---
39
+
40
+ ## Fonctionnalités
41
+
42
+ - **Diagnostic de la dernière erreur** : la cause probable, en français ou en anglais selon ta locale.
43
+ - **Correction insérée dans le prompt** : la commande arrive dans ta ligne de saisie ; c'est toi qui appuies sur Entrée.
44
+ - **Langage naturel** : tape ta demande (« lister les ports ouverts ») puis `Alt+E` pour obtenir la commande.
45
+ - **Niveau de risque** : faible, moyen ou élevé. Les règles locales d'ezShell relèvent le niveau si le modèle le sous-estime, et une commande à risque élevé exige une confirmation explicite (`y`).
46
+ - **Sans clé API** : ezShell passe par son service hébergé ; ton appareil reçoit un jeton anonyme avec un quota quotidien gratuit.
47
+ - **Secrets masqués** : mots de passe, clés API, jetons, identifiants dans les URL et clés privées sont masqués avant l'envoi, puis une seconde fois sur le serveur.
48
+ - **bash, zsh et fish** sur Linux et macOS, **PowerShell** sur Windows (bêta). Une fenêtre de bureau et une interface plein terminal sont aussi disponibles.
49
+
50
+ ---
51
+
52
+ ## Installation
53
+
54
+ Prérequis : Python 3.10 ou plus récent.
55
+
56
+ ```bash
57
+ pipx install ezshell
58
+ ```
59
+
60
+ Puis branche ezShell sur ton shell, en ajoutant la ligne correspondante à la fin de ton fichier de configuration :
61
+
62
+ | Shell | Fichier | Ligne |
63
+ |---|---|---|
64
+ | zsh | `~/.zshrc` | `eval "$(ezsh init zsh)"` |
65
+ | bash | `~/.bashrc` | `eval "$(ezsh init bash)"` |
66
+ | fish | `~/.config/fish/config.fish` | `ezsh init fish \| source` |
67
+ | PowerShell (Windows) | `$PROFILE` | `Invoke-Expression (& ezsh init powershell \| Out-String)` |
68
+
69
+ Pour bash, zsh et PowerShell, `ezsh init --install` ajoute la ligne à ta place. Ouvre ensuite un nouveau terminal.
70
+
71
+ **Windows (bêta) :** installe Python 3.10+ et [pipx](https://pipx.pypa.io/stable/), puis la même commande `pipx install` dans PowerShell (5.1 ou 7, avec PSReadLine). Si PowerShell refuse de charger ton profil, autorise les scripts locaux pour ton compte : `Set-ExecutionPolicy -Scope CurrentUser RemoteSigned`. Sous WSL, suis simplement les instructions Linux.
72
+
73
+ **Mettre à jour :** lance `ezsh --update`. ezShell affiche les nouveautés, te demande confirmation (réponse par défaut : non), puis met à jour. Ajoute `--yes` pour passer la confirmation dans un script. Quand une nouvelle version existe, une ligne discrète te le rappelle au plus une fois par jour ; `EZSH_NO_UPDATE_CHECK=1` la désactive. Sous Windows, la commande à lancer dans un nouveau terminal t'est affichée (un programme ne peut pas se remplacer pendant qu'il tourne). Si tu as installé ezShell depuis l'URL git avant la version 0.2.0, réinstalle une dernière fois : `pipx install --force ezshell`.
74
+
75
+ <details>
76
+ <summary>Autres méthodes d'installation</summary>
77
+
78
+ **Dernière version de développement** (pas encore publiée sur PyPI) : `pipx install git+https://github.com/Waddle-io/ezShell.git`
79
+
80
+ **Installateur en une ligne** (installe dans `~/.local/share/ezshell`, commandes dans `~/.local/bin`) :
81
+
82
+ ```bash
83
+ curl -fsSL https://raw.githubusercontent.com/Waddle-io/ezShell/main/install.sh | bash
84
+ ```
85
+
86
+ **Depuis les sources :**
87
+
88
+ ```bash
89
+ git clone https://github.com/Waddle-io/ezShell.git
90
+ cd ezShell
91
+ python3 -m venv .venv
92
+ source .venv/bin/activate
93
+ pip install -e .
94
+ ```
95
+
96
+ La fenêtre de bureau nécessite Tk (`sudo apt install python3-tk` sur Debian/Ubuntu).
97
+ </details>
98
+
99
+ Désinstaller : retire la ligne `ezsh init` de ton fichier de configuration, puis `pipx uninstall ezshell`.
100
+
101
+ ---
102
+
103
+ ## Utilisation
104
+
105
+ ### Dans ton terminal (`Alt+E`)
106
+
107
+ Lance une commande qui échoue (par exemple `git psuh`), puis appuie sur `Alt+E`.
108
+
109
+ | Touche | Action |
110
+ |---|---|
111
+ | `Entrée` | Insérer la commande dans le prompt (risque faible ou moyen) |
112
+ | `y` | Insérer une commande à risque élevé ou sur plusieurs lignes |
113
+ | `e` | Modifier la commande avant de l'insérer |
114
+ | `c` | Copier dans le presse-papiers |
115
+ | `/` | Poser une autre question |
116
+ | `q` / `Échap` | Fermer sans rien insérer |
117
+
118
+ Pour un diagnostic plus précis, lance la commande via `ezsh run` : la fin de sa sortie d'erreur est gardée (et masquée) pour l'analyse.
119
+
120
+ ```bash
121
+ ezsh run -- npm run build
122
+ ```
123
+
124
+ `ezsh suggest --ask "trouver les fichiers de plus de 1 Go"` ouvre le même panneau sans raccourci.
125
+
126
+ ### Autres modes
127
+
128
+ ```bash
129
+ ezsh # fenêtre de bureau (interface terminal si aucun affichage)
130
+ ezsh --tui # interface plein terminal, pratique en SSH
131
+ ezsh --explain "docker: Error response from daemon: port is already allocated"
132
+ ezsh --check-key # vérifie que le service ezShell répond
133
+ ezsh --version
134
+ ```
135
+
136
+ `ezsh --help` liste toutes les options.
137
+
138
+ ### Configuration
139
+
140
+ Aucune configuration n'est nécessaire. Variables utiles :
141
+
142
+ | Variable | Rôle |
143
+ |---|---|
144
+ | `EZSHELL_LANG` | Force la langue (`fr` ou `en`) ; sinon déduite de `$LANG` |
145
+ | `EZSH_API_URL` | URL du service (défaut : `https://ezshell.vercel.app`) |
146
+ | `EZSH_DIRECT=1` | Appelle Groq directement avec ta propre clé (`GROQ_API_KEY` ou `ezsh --set-key`) |
147
+ | `EZSH_MODEL` | Modèle en mode direct (défaut : `openai/gpt-oss-120b`) |
148
+ | `EZSH_STATE_DIR` | Dossier d'état par terminal (défaut : `$XDG_RUNTIME_DIR/ezsh`, `%LOCALAPPDATA%\ezsh` sous Windows) |
149
+ | `EZSH_MOCK_LLM=1` | Simule le modèle, sans réseau (développement) |
150
+
151
+ ---
152
+
153
+ ## Confidentialité
154
+
155
+ Rien n'est envoyé tant que tu n'appuies pas sur `Alt+E`. Sont alors envoyés : ton OS et ton shell, le dossier courant (avec `~` à la place de ton nom), la dernière commande, son code de sortie et, si tu passes par `ezsh run`, la fin de sa sortie d'erreur (4 Ko max). Le service ne conserve pas le contenu des requêtes : seulement un jeton d'appareil haché et des compteurs de quota.
156
+
157
+ ---
158
+
159
+ ## Développement
160
+
161
+ ```bash
162
+ pip install -e . -r requirements-dev.txt
163
+ pytest
164
+ ruff check src tests
165
+ EZSH_MOCK_LLM=1 ezsh suggest --ask "lister les gros fichiers"
166
+ ```
167
+
168
+ Le service hébergé (Next.js + Postgres) est dans [`web/`](web/README.md). Voir aussi [`CONTRIBUTING.md`](CONTRIBUTING.md) et [`DEVELOPMENT.md`](DEVELOPMENT.md).
169
+
170
+ ---
171
+
172
+ ## Licence
173
+
174
+ Distribué sous licence [MIT](LICENSE). © 2026 Salomon.
@@ -0,0 +1,59 @@
1
+ LICENSE
2
+ README.md
3
+ pyproject.toml
4
+ ezshell.egg-info/PKG-INFO
5
+ ezshell.egg-info/SOURCES.txt
6
+ ezshell.egg-info/dependency_links.txt
7
+ ezshell.egg-info/entry_points.txt
8
+ ezshell.egg-info/requires.txt
9
+ ezshell.egg-info/top_level.txt
10
+ src/__init__.py
11
+ src/app.py
12
+ src/i18n.py
13
+ src/main.py
14
+ src/core/__init__.py
15
+ src/core/assistant.py
16
+ src/core/capture.py
17
+ src/core/chat_bridge.py
18
+ src/core/config.py
19
+ src/core/context.py
20
+ src/core/groq_client.py
21
+ src/core/llm_client.py
22
+ src/core/prompts.py
23
+ src/core/provider.py
24
+ src/core/proxy_client.py
25
+ src/core/pty_shell.py
26
+ src/core/redact.py
27
+ src/core/risk.py
28
+ src/core/safety.py
29
+ src/core/sanitize.py
30
+ src/core/schema.py
31
+ src/core/shell_hook.py
32
+ src/core/suggest.py
33
+ src/core/updater.py
34
+ src/ui/chat_tui.py
35
+ src/ui/gui_window.py
36
+ src/ui/inline.py
37
+ src/ui/logo.py
38
+ src/ui/panel.py
39
+ src/ui/prompt.py
40
+ src/ui/render.py
41
+ tests/test_assistant.py
42
+ tests/test_capture_suggest.py
43
+ tests/test_chat_bridge.py
44
+ tests/test_chat_tui.py
45
+ tests/test_config.py
46
+ tests/test_context.py
47
+ tests/test_e2e_shell.py
48
+ tests/test_proxy_client.py
49
+ tests/test_pty_shell.py
50
+ tests/test_redact.py
51
+ tests/test_redact_extra.py
52
+ tests/test_release_files.py
53
+ tests/test_risk.py
54
+ tests/test_risk_powershell.py
55
+ tests/test_safety.py
56
+ tests/test_sanitize_schema.py
57
+ tests/test_shell_hook.py
58
+ tests/test_shell_hook_powershell.py
59
+ tests/test_updater.py
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ ezsh = src.main:main
3
+ ezshell = src.main:main
@@ -0,0 +1,9 @@
1
+ groq>=0.11.0
2
+ prompt_toolkit>=3.0.40
3
+ rich>=13.7.0
4
+ pyte>=0.8.2
5
+ python-dotenv>=1.0.0
6
+ textual>=8.0.0
7
+ customtkinter>=6.0.0
8
+ pillow>=10.0.0
9
+ pydantic>=2.5
@@ -0,0 +1 @@
1
+ src
@@ -0,0 +1,41 @@
1
+ [build-system]
2
+ requires = ["setuptools>=77", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "ezshell"
7
+ dynamic = ["version"]
8
+ description = "Terminal assistant: explains failed commands and suggests a fix you review before running"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{ name = "Salomon" }]
14
+
15
+ dependencies = [
16
+ "groq>=0.11.0",
17
+ "prompt_toolkit>=3.0.40",
18
+ "rich>=13.7.0",
19
+ "pyte>=0.8.2",
20
+ "python-dotenv>=1.0.0",
21
+ "textual>=8.0.0",
22
+ "customtkinter>=6.0.0",
23
+ "pillow>=10.0.0",
24
+ "pydantic>=2.5",
25
+ ]
26
+
27
+ [project.scripts]
28
+ ezsh = "src.main:main"
29
+ ezshell = "src.main:main"
30
+
31
+ [tool.setuptools.dynamic]
32
+ version = { attr = "src.__version__" }
33
+
34
+ [tool.setuptools.packages.find]
35
+ where = ["."]
36
+ include = ["src*"]
37
+
38
+ [tool.pytest.ini_options]
39
+ testpaths = ["tests"]
40
+ python_files = ["test_*.py"]
41
+
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,3 @@
1
+ """ezShell. `__version__` est l'UNIQUE source du numéro de version (pyproject.toml le lit d'ici)."""
2
+
3
+ __version__ = "0.2.0"