atlasia-ghost 0.2.0 → 0.3.2
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 +101 -38
- package/ghost.js +1361 -49
- package/package.json +3 -4
package/README.md
CHANGED
|
@@ -1,69 +1,132 @@
|
|
|
1
|
-
# 👻 Ghost CLI
|
|
1
|
+
# 👻 Ghost CLI [](https://github.com/atlasia/ghost)
|
|
2
2
|
|
|
3
|
-
Assistant Git Intelligent
|
|
4
|
-
|
|
5
|
-
Ghost analyse vos changements Git (`staged`), vérifie l'absence de secrets (clés API, tokens) et propose un message de commit professionnel suivant la convention **Conventional Commits**.
|
|
3
|
+
> Assistant Git Intelligent, Local & Sécurisé.
|
|
6
4
|
|
|
7
5
|
## 🚀 Installation
|
|
8
6
|
|
|
9
|
-
Vous pouvez installer Ghost globalement via npm :
|
|
10
|
-
|
|
11
7
|
```bash
|
|
12
8
|
npm install -g atlasia-ghost
|
|
13
9
|
```
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npx atlasia-ghost
|
|
19
|
-
```
|
|
11
|
+
## 🧩 Version Management (Before Commits/Tags)
|
|
20
12
|
|
|
21
|
-
|
|
13
|
+
Ghost can manage semantic versions (SemVer) and enforce version bump rules through Git hooks.
|
|
22
14
|
|
|
23
|
-
|
|
24
|
-
Vous pouvez en obtenir une ici : [https://console.groq.com](https://console.groq.com)
|
|
15
|
+
### Quick start
|
|
25
16
|
|
|
26
|
-
|
|
17
|
+
1) Create a shared version config in your repo:
|
|
18
|
+
```bash
|
|
19
|
+
ghost version init
|
|
20
|
+
```
|
|
27
21
|
|
|
28
|
-
|
|
22
|
+
2) Install hooks in the current Git repository:
|
|
23
|
+
```bash
|
|
24
|
+
ghost version install-hooks
|
|
25
|
+
```
|
|
29
26
|
|
|
30
|
-
|
|
27
|
+
3) Bump version (manual) and create an annotated tag:
|
|
28
|
+
```bash
|
|
29
|
+
ghost version bump --bump minor --tag
|
|
30
|
+
```
|
|
31
31
|
|
|
32
|
+
4) Automatic bump based on Conventional Commits since last tag:
|
|
32
33
|
```bash
|
|
33
|
-
|
|
34
|
-
ghost
|
|
34
|
+
ghost version bump --from-commits --tag
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
###
|
|
37
|
+
### What the hooks do
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
| `--model <name>` | Utiliser un modèle spécifique (ex: `llama-3.1-8b-instant`) |
|
|
42
|
-
| `--provider <name>` | Choisir le fournisseur (`groq` [défaut], `openai`) |
|
|
43
|
-
| `--no-security` | Désactiver l'audit de sécurité (scan de secrets) |
|
|
44
|
-
| `--dry-run` | Générer le message sans effectuer le commit |
|
|
45
|
-
| `--help`, `-h` | Afficher l'aide |
|
|
39
|
+
- `pre-commit`: blocks commits when merge conflicts are present.
|
|
40
|
+
- `commit-msg`: reads the commit message, determines required bump (major/minor/patch) from Conventional Commits, and blocks the commit if the version file in the Git index is not bumped enough.
|
|
46
41
|
|
|
47
|
-
|
|
42
|
+
### CI / builder-friendly output
|
|
48
43
|
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
- Non-interactive mode:
|
|
45
|
+
```bash
|
|
46
|
+
ghost version bump --from-commits --tag --ci
|
|
47
|
+
```
|
|
48
|
+
- JSON output (for CI logs parsing):
|
|
49
|
+
```bash
|
|
50
|
+
ghost version bump --from-commits --tag --output json
|
|
51
|
+
```
|
|
51
52
|
|
|
52
|
-
###
|
|
53
|
-
Vous pouvez personnaliser le comportement de Ghost par projet en créant un fichier `.ghostrc` à la racine :
|
|
53
|
+
### Shared configuration (.ghost-versionrc)
|
|
54
54
|
|
|
55
|
+
Commit `.ghost-versionrc` to your repository so both coders and builders use the same rules.
|
|
56
|
+
|
|
57
|
+
Minimal example:
|
|
55
58
|
```json
|
|
56
59
|
{
|
|
57
|
-
"
|
|
58
|
-
"
|
|
60
|
+
"versionFiles": [{ "type": "package-json", "path": "package.json" }],
|
|
61
|
+
"tagPrefix": "v",
|
|
62
|
+
"requireVersionBump": true,
|
|
63
|
+
"autoTagAfterBump": true,
|
|
64
|
+
"notifications": { "webhookUrl": null }
|
|
59
65
|
}
|
|
60
66
|
```
|
|
61
67
|
|
|
62
|
-
##
|
|
68
|
+
## 🧯 Merge Conflict Detection & Assistance
|
|
69
|
+
|
|
70
|
+
Ghost can detect and help you resolve merge conflicts.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
ghost merge status
|
|
74
|
+
ghost merge resolve
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Non-interactive resolution (all conflicted files):
|
|
78
|
+
```bash
|
|
79
|
+
ghost merge resolve --strategy ours --ci
|
|
80
|
+
ghost merge resolve --strategy theirs --ci
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## 🤝 Collaborative Workflow (Coders + Builders)
|
|
63
84
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
85
|
+
- Shared rules: commit `.ghostrc` and `.ghost-versionrc` to the repo.
|
|
86
|
+
- Branch protection (recommended): protect `main`/`master`, require PR reviews, and run CI checks that execute `npm test`.
|
|
87
|
+
- Automated notifications: configure `notifications.webhookUrl` in `.ghost-versionrc` to POST structured events after version bump/tag operations.
|
|
88
|
+
|
|
89
|
+
## 🛡️ Gestion des Secrets
|
|
90
|
+
|
|
91
|
+
Ghost intègre un scanner de sécurité avancé pour empêcher les commits de secrets (clés API, tokens, etc.).
|
|
92
|
+
|
|
93
|
+
### Lancer un audit manuel
|
|
94
|
+
Vous pouvez auditer l'ensemble de votre projet à tout moment :
|
|
95
|
+
```bash
|
|
96
|
+
ghost audit --verbose
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### Ignorer des faux positifs (.ghostignore)
|
|
100
|
+
Si Ghost détecte un faux positif (ex: une longue chaîne de configuration non sensible), vous pouvez l'ajouter dans un fichier `.ghostignore` à la racine de votre projet.
|
|
101
|
+
|
|
102
|
+
Exemple de `.ghostignore` :
|
|
103
|
+
```text
|
|
104
|
+
# Ignorer une clé publique de test
|
|
105
|
+
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQE
|
|
106
|
+
|
|
107
|
+
# Ignorer un fichier entier
|
|
108
|
+
config/test_keys.js
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## 📊 Console de Monitoring & MCP (Nouveau v0.3.2)
|
|
112
|
+
|
|
113
|
+
Ghost intègre désormais une console de débogage et de monitoring temps réel, inspirée de Gemini.
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
ghost console
|
|
117
|
+
# ou
|
|
118
|
+
ghost --console
|
|
119
|
+
```
|
|
120
|
+
Cela lance un serveur local sur `http://localhost:3000` affichant :
|
|
121
|
+
- 📈 Métriques en temps réel (Latence API, nombre de requêtes, erreurs)
|
|
122
|
+
- 📝 Logs structurés et alertes de sécurité
|
|
123
|
+
- 🔌 **Endpoint MCP** : Compatible avec le *Model Context Protocol* sur `/mcp` pour l'intégration avec les IDEs et agents IA.
|
|
124
|
+
|
|
125
|
+
### Important : `desktop/` et `npm run desktop:dev`
|
|
126
|
+
- `ghost console` / `ghost --console` fonctionne **après installation globale** (`npm install -g atlasia-ghost`) : c'est une console **web locale** (serveur HTTP) incluse dans le package NPM.
|
|
127
|
+
- `npm run desktop:dev` est **uniquement** une commande de **développement** de l'application Electron/React située dans `desktop/`.
|
|
128
|
+
- Elle nécessite un **clone du repository** (`git clone`), puis `npm install` dans `desktop/`.
|
|
129
|
+
- Cette application **n'est pas** installée via `npm install -g atlasia-ghost` (le package NPM ne publie que le CLI `ghost.js`).
|
|
67
130
|
|
|
68
131
|
## 📄 Licence
|
|
69
132
|
|