@envsafes-org/cli 0.0.11 → 0.1.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 +117 -251
- package/dist/commands/create.d.ts +1 -0
- package/dist/commands/create.js +84 -0
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +166 -0
- package/dist/commands/link.d.ts +1 -0
- package/dist/commands/link.js +102 -0
- package/dist/commands/list.d.ts +1 -0
- package/dist/commands/list.js +60 -0
- package/dist/commands/pull.d.ts +11 -3
- package/dist/commands/pull.js +20 -4
- package/dist/commands/push.d.ts +11 -3
- package/dist/commands/push.js +20 -4
- package/dist/commands/run.d.ts +11 -3
- package/dist/commands/run.js +50 -17
- package/dist/commands/select.d.ts +1 -0
- package/dist/commands/select.js +63 -0
- package/dist/index.js +52 -16
- package/dist/utils/config.d.ts +44 -0
- package/dist/utils/config.js +90 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,343 +1,209 @@
|
|
|
1
|
-
#
|
|
1
|
+
# EnvSafe CLI
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
CLI officiel pour **EnvSafe** - Gestionnaire sécurisé de variables d'environnement pour équipes.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
|
-
|
|
8
|
-
EnvSafe CLI allows you to manage your environment variables securely with end-to-end encryption. Ideal for teams wanting to centralize their secrets without compromising security.
|
|
9
|
-
|
|
10
|
-
## 🛑 Prerequisites
|
|
11
|
-
|
|
12
|
-
Before using the CLI, you must create an account and a project on **[https://www.envsafe.dev](https://www.envsafe.dev)**.
|
|
13
|
-
|
|
14
|
-
## 📦 Installation
|
|
5
|
+
## Installation
|
|
15
6
|
|
|
16
7
|
```bash
|
|
17
|
-
#
|
|
8
|
+
# Installation globale (recommandée)
|
|
18
9
|
npm install -g @envsafes-org/cli
|
|
19
10
|
|
|
20
|
-
#
|
|
11
|
+
# Ou avec yarn
|
|
21
12
|
yarn global add @envsafes-org/cli
|
|
22
13
|
|
|
23
|
-
#
|
|
14
|
+
# Ou avec pnpm
|
|
24
15
|
pnpm add -g @envsafes-org/cli
|
|
25
16
|
|
|
26
|
-
#
|
|
27
|
-
npx @envsafes-org/cli
|
|
17
|
+
# Sans installation (npx)
|
|
18
|
+
npx @envsafes-org/cli --help
|
|
28
19
|
```
|
|
29
20
|
|
|
30
|
-
##
|
|
21
|
+
## Configuration rapide
|
|
22
|
+
|
|
23
|
+
### 1. Connexion
|
|
31
24
|
|
|
32
25
|
```bash
|
|
33
|
-
#
|
|
26
|
+
# Se connecter (ouvre le navigateur pour générer un token)
|
|
34
27
|
envsafe login
|
|
35
28
|
|
|
36
|
-
#
|
|
37
|
-
envsafe
|
|
38
|
-
|
|
39
|
-
# 3. Pull your variables
|
|
40
|
-
envsafe pull my-project
|
|
41
|
-
|
|
42
|
-
# 4. Or run directly with injection
|
|
43
|
-
envsafe run my-project -- npm start
|
|
29
|
+
# Ou avec un token directement
|
|
30
|
+
envsafe login --token <votre-token>
|
|
44
31
|
```
|
|
45
32
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
### `envsafe login`
|
|
49
|
-
|
|
50
|
-
Authenticate with a Personal Access Token (PAT).
|
|
33
|
+
### 2. Lier un workspace
|
|
51
34
|
|
|
52
35
|
```bash
|
|
53
|
-
#
|
|
54
|
-
envsafe
|
|
36
|
+
# Mode interactif - sélectionner un workspace
|
|
37
|
+
envsafe link
|
|
55
38
|
|
|
56
|
-
#
|
|
57
|
-
envsafe
|
|
39
|
+
# Ou spécifier directement le workspace
|
|
40
|
+
envsafe link mon-workspace
|
|
58
41
|
```
|
|
59
42
|
|
|
60
|
-
|
|
43
|
+
Cette commande crée un fichier `.envsafe` dans le répertoire courant.
|
|
61
44
|
|
|
62
|
-
|
|
45
|
+
### 3. Sélectionner un projet
|
|
63
46
|
|
|
64
|
-
|
|
47
|
+
```bash
|
|
48
|
+
# Mode interactif - configurer workspace + projet
|
|
49
|
+
envsafe init
|
|
65
50
|
|
|
66
|
-
|
|
51
|
+
# Ou lister les projets disponibles
|
|
52
|
+
envsafe list
|
|
67
53
|
|
|
68
|
-
|
|
69
|
-
envsafe
|
|
70
|
-
# or
|
|
71
|
-
envsafe ls
|
|
54
|
+
# Puis sélectionner un projet
|
|
55
|
+
envsafe select mon-projet
|
|
72
56
|
```
|
|
73
57
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
### `envsafe pull <project>`
|
|
58
|
+
## Commandes principales
|
|
77
59
|
|
|
78
|
-
|
|
60
|
+
### Récupérer les variables (Pull)
|
|
79
61
|
|
|
80
62
|
```bash
|
|
81
|
-
#
|
|
82
|
-
envsafe pull
|
|
83
|
-
|
|
84
|
-
# Specific environment
|
|
85
|
-
envsafe pull my-project --env staging
|
|
86
|
-
envsafe pull my-project --env production
|
|
87
|
-
|
|
88
|
-
# Custom output file
|
|
89
|
-
envsafe pull my-project --output .env.local
|
|
90
|
-
envsafe pull my-project --env production --output .env.prod
|
|
91
|
-
```
|
|
63
|
+
# Récupérer les variables development (par défaut)
|
|
64
|
+
envsafe pull
|
|
92
65
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
66
|
+
# Avec raccourcis d'environnement
|
|
67
|
+
envsafe pull -d # development
|
|
68
|
+
envsafe pull -s # staging
|
|
69
|
+
envsafe pull -p # production
|
|
96
70
|
|
|
97
|
-
|
|
71
|
+
# Spécifier un projet manuellement
|
|
72
|
+
envsafe pull mon-projet -p
|
|
98
73
|
|
|
99
|
-
|
|
74
|
+
# Changer le fichier de sortie
|
|
75
|
+
envsafe pull -d -o .env.local
|
|
76
|
+
```
|
|
100
77
|
|
|
101
|
-
|
|
78
|
+
### Envoyer les variables (Push)
|
|
102
79
|
|
|
103
80
|
```bash
|
|
104
|
-
#
|
|
105
|
-
envsafe push
|
|
106
|
-
|
|
107
|
-
# Specific environment and file
|
|
108
|
-
envsafe push my-project --env production --file .env.prod
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
**Options:**
|
|
112
|
-
- `-e, --env <environment>` : Target environment - Default: `development`
|
|
113
|
-
- `-f, --file <file>` : Source file - Default: `.env`
|
|
81
|
+
# Envoyer vers development (par défaut)
|
|
82
|
+
envsafe push
|
|
114
83
|
|
|
115
|
-
|
|
84
|
+
# Avec raccourcis d'environnement
|
|
85
|
+
envsafe push -d # development
|
|
86
|
+
envsafe push -s # staging
|
|
87
|
+
envsafe push -p # production
|
|
116
88
|
|
|
117
|
-
|
|
89
|
+
# Spécifier un fichier source
|
|
90
|
+
envsafe push -p -f .env.production
|
|
91
|
+
```
|
|
118
92
|
|
|
119
|
-
|
|
93
|
+
### Exécuter avec injection (Run)
|
|
120
94
|
|
|
121
95
|
```bash
|
|
122
|
-
#
|
|
123
|
-
envsafe run
|
|
124
|
-
envsafe run my-project -- npm run dev
|
|
96
|
+
# Exécuter une commande avec les variables injectées
|
|
97
|
+
envsafe run npm start
|
|
125
98
|
|
|
126
|
-
#
|
|
127
|
-
envsafe run
|
|
99
|
+
# Avec un environnement spécifique
|
|
100
|
+
envsafe run -p npm start
|
|
128
101
|
|
|
129
|
-
#
|
|
130
|
-
envsafe run
|
|
131
|
-
envsafe run my-project -- python main.py
|
|
132
|
-
envsafe run my-project -- docker-compose up
|
|
102
|
+
# Spécifier un projet
|
|
103
|
+
envsafe run mon-projet -s yarn dev
|
|
133
104
|
```
|
|
134
105
|
|
|
135
|
-
|
|
136
|
-
- ✅ More secure (no .env file on disk)
|
|
137
|
-
- ✅ Ideal for CI/CD
|
|
138
|
-
- ✅ No risk of accidentally committing secrets
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
### `envsafe whoami`
|
|
143
|
-
|
|
144
|
-
Display currently logged-in account information.
|
|
106
|
+
### Créer un projet
|
|
145
107
|
|
|
146
108
|
```bash
|
|
147
|
-
|
|
148
|
-
|
|
109
|
+
# Mode interactif
|
|
110
|
+
envsafe create
|
|
149
111
|
|
|
150
|
-
|
|
112
|
+
# Avec un nom
|
|
113
|
+
envsafe create "Mon Nouveau Projet"
|
|
114
|
+
```
|
|
151
115
|
|
|
152
|
-
|
|
116
|
+
## Toutes les commandes
|
|
153
117
|
|
|
154
|
-
|
|
118
|
+
| Commande | Alias | Description |
|
|
119
|
+
|----------|-------|-------------|
|
|
120
|
+
| `envsafe login` | - | Se connecter avec un token API |
|
|
121
|
+
| `envsafe logout` | - | Se déconnecter |
|
|
122
|
+
| `envsafe whoami` | - | Afficher l'utilisateur connecté |
|
|
123
|
+
| `envsafe link [workspace]` | - | Lier ce répertoire à un workspace |
|
|
124
|
+
| `envsafe init` | - | Configurer un projet (interactif) |
|
|
125
|
+
| `envsafe list` | `ls` | Lister les projets du workspace |
|
|
126
|
+
| `envsafe select <projet>` | - | Sélectionner un projet |
|
|
127
|
+
| `envsafe create [nom]` | `new` | Créer un nouveau projet |
|
|
128
|
+
| `envsafe pull [projet]` | - | Télécharger les variables |
|
|
129
|
+
| `envsafe push [projet]` | - | Envoyer les variables |
|
|
130
|
+
| `envsafe run [projet] <cmd>` | - | Exécuter avec injection |
|
|
131
|
+
| `envsafe projects` | - | Lister tous les projets (global) |
|
|
132
|
+
| `envsafe config` | - | Gérer la configuration |
|
|
155
133
|
|
|
156
|
-
|
|
157
|
-
envsafe logout
|
|
158
|
-
```
|
|
134
|
+
## Options d'environnement
|
|
159
135
|
|
|
160
|
-
|
|
136
|
+
Les commandes `pull`, `push` et `run` supportent ces raccourcis :
|
|
161
137
|
|
|
162
|
-
|
|
138
|
+
| Option | Environnement |
|
|
139
|
+
|--------|---------------|
|
|
140
|
+
| `-d`, `--dev` | development |
|
|
141
|
+
| `-s`, `--staging` | staging |
|
|
142
|
+
| `-p`, `--prod` | production |
|
|
143
|
+
| `-e <env>` | personnalisé |
|
|
163
144
|
|
|
164
|
-
|
|
145
|
+
## Fichier .envsafe
|
|
165
146
|
|
|
166
|
-
|
|
167
|
-
# Show current configuration
|
|
168
|
-
envsafe config --show
|
|
147
|
+
Le fichier `.envsafe` stocke la configuration locale du projet :
|
|
169
148
|
|
|
170
|
-
|
|
171
|
-
|
|
149
|
+
```json
|
|
150
|
+
{
|
|
151
|
+
"workspace": "mon-workspace",
|
|
152
|
+
"project": "mon-projet"
|
|
153
|
+
}
|
|
172
154
|
```
|
|
173
155
|
|
|
174
|
-
|
|
156
|
+
> **Conseil :** Ajoutez `.envsafe` à votre `.gitignore` si vous ne voulez pas partager cette configuration.
|
|
175
157
|
|
|
176
|
-
##
|
|
158
|
+
## CI/CD
|
|
177
159
|
|
|
178
|
-
|
|
160
|
+
Dans les environnements automatisés, utilisez la variable `ENVSAFE_TOKEN` :
|
|
179
161
|
|
|
180
|
-
|
|
162
|
+
```bash
|
|
163
|
+
export ENVSAFE_TOKEN=your-token-here
|
|
164
|
+
envsafe pull mon-projet -p
|
|
165
|
+
```
|
|
181
166
|
|
|
182
|
-
|
|
167
|
+
### GitHub Actions
|
|
183
168
|
|
|
184
169
|
```yaml
|
|
185
|
-
name: Deploy
|
|
186
|
-
on: [push]
|
|
187
|
-
|
|
188
170
|
jobs:
|
|
189
171
|
deploy:
|
|
190
172
|
runs-on: ubuntu-latest
|
|
191
173
|
steps:
|
|
192
174
|
- uses: actions/checkout@v4
|
|
193
|
-
|
|
194
175
|
- name: Install EnvSafe CLI
|
|
195
176
|
run: npm install -g @envsafes-org/cli
|
|
196
|
-
|
|
197
|
-
- name: Run tests with EnvSafe
|
|
177
|
+
- name: Pull secrets
|
|
198
178
|
env:
|
|
199
179
|
ENVSAFE_TOKEN: ${{ secrets.ENVSAFE_TOKEN }}
|
|
200
|
-
run:
|
|
201
|
-
envsafe run my-project --env staging -- npm test
|
|
202
|
-
|
|
203
|
-
- name: Deploy to production
|
|
204
|
-
env:
|
|
205
|
-
ENVSAFE_TOKEN: ${{ secrets.ENVSAFE_TOKEN }}
|
|
206
|
-
run: |
|
|
207
|
-
envsafe run my-project --env production -- npm run build
|
|
208
|
-
envsafe run my-project --env production -- npm run deploy
|
|
180
|
+
run: envsafe pull mon-projet -p -o .env
|
|
209
181
|
```
|
|
210
182
|
|
|
211
|
-
|
|
183
|
+
### GitLab CI
|
|
212
184
|
|
|
213
185
|
```yaml
|
|
214
186
|
deploy:
|
|
215
|
-
stage: deploy
|
|
216
187
|
script:
|
|
217
188
|
- npm install -g @envsafes-org/cli
|
|
218
|
-
- envsafe
|
|
189
|
+
- envsafe pull mon-projet -p -o .env
|
|
219
190
|
variables:
|
|
220
|
-
ENVSAFE_TOKEN: $
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
#### Docker
|
|
224
|
-
|
|
225
|
-
```dockerfile
|
|
226
|
-
FROM node:20-alpine
|
|
227
|
-
|
|
228
|
-
# Install the CLI
|
|
229
|
-
RUN npm install -g @envsafes-org/cli
|
|
230
|
-
|
|
231
|
-
WORKDIR /app
|
|
232
|
-
COPY . .
|
|
233
|
-
|
|
234
|
-
# Inject variables at startup
|
|
235
|
-
CMD ["envsafe", "run", "my-project", "--env", "production", "--", "npm", "start"]
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
---
|
|
239
|
-
|
|
240
|
-
## 💡 Usage Examples
|
|
241
|
-
|
|
242
|
-
### Local Development
|
|
243
|
-
|
|
244
|
-
```bash
|
|
245
|
-
# Option 1: .env file (traditional)
|
|
246
|
-
envsafe pull my-project
|
|
247
|
-
npm run dev
|
|
248
|
-
|
|
249
|
-
# Option 2: Direct injection (recommended)
|
|
250
|
-
envsafe run my-project -- npm run dev
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
### Deployment Script
|
|
254
|
-
|
|
255
|
-
```bash
|
|
256
|
-
#!/bin/bash
|
|
257
|
-
# deploy.sh
|
|
258
|
-
|
|
259
|
-
# Load production variables and deploy
|
|
260
|
-
envsafe run my-project --env production -- npm run build
|
|
261
|
-
envsafe run my-project --env production -- npm run deploy
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
### Automated Tests
|
|
265
|
-
|
|
266
|
-
```bash
|
|
267
|
-
# Run tests with staging variables
|
|
268
|
-
envsafe run my-project --env staging -- npm test
|
|
191
|
+
ENVSAFE_TOKEN: $ENVSAFE_TOKEN
|
|
269
192
|
```
|
|
270
193
|
|
|
271
|
-
|
|
194
|
+
## Aide
|
|
272
195
|
|
|
273
196
|
```bash
|
|
274
|
-
|
|
275
|
-
envsafe
|
|
276
|
-
|
|
277
|
-
# Staging
|
|
278
|
-
envsafe run my-project --env staging -- npm run build
|
|
279
|
-
|
|
280
|
-
# Production
|
|
281
|
-
envsafe run my-project --env production -- npm start
|
|
197
|
+
envsafe --help
|
|
198
|
+
envsafe <command> --help
|
|
282
199
|
```
|
|
283
200
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
## 🔐 Security
|
|
287
|
-
|
|
288
|
-
EnvSafe uses end-to-end encryption architecture:
|
|
289
|
-
|
|
290
|
-
- **Variable Encryption**: AES-256-GCM
|
|
291
|
-
- **Key Management**: RSA-2048 with asymmetric encryption
|
|
292
|
-
- **Transport**: TLS 1.3
|
|
293
|
-
- **Zero Knowledge**: Your private keys never leave your machine
|
|
294
|
-
|
|
295
|
-
### Best Practices
|
|
296
|
-
|
|
297
|
-
✅ **Do:**
|
|
298
|
-
- Use `ENVSAFE_TOKEN` in CI/CD
|
|
299
|
-
- Set expiration dates for your tokens
|
|
300
|
-
- Prefer `envsafe run` to avoid .env files
|
|
301
|
-
- Immediately revoke compromised tokens
|
|
302
|
-
|
|
303
|
-
❌ **Don't:**
|
|
304
|
-
- Never commit your tokens to Git
|
|
305
|
-
- Do not use `--token` in the command line (visible in history)
|
|
306
|
-
- Do not share your tokens via email/Slack
|
|
307
|
-
|
|
308
|
-
---
|
|
309
|
-
|
|
310
|
-
## 🌍 Environment Variables
|
|
311
|
-
|
|
312
|
-
| Variable | Description | Example |
|
|
313
|
-
|----------|-------------|---------|
|
|
314
|
-
| `ENVSAFE_TOKEN` | Authentication Token (recommended in CI/CD) | `es_live_xxx...` |
|
|
315
|
-
| `ENVSAFE_API_URL` | API URL (for self-hosted instances) | `https://api.example.com` |
|
|
316
|
-
|
|
317
|
-
---
|
|
318
|
-
|
|
319
|
-
## 📚 Complete Documentation
|
|
320
|
-
|
|
321
|
-
For more information, check out the [official documentation](https://www.envsafe.dev/docs).
|
|
322
|
-
|
|
323
|
-
---
|
|
324
|
-
|
|
325
|
-
## 🐛 Report a Bug
|
|
326
|
-
|
|
327
|
-
If you encounter an issue, [open an issue](https://github.com/Ifiboys/envsafe-cli/issues).
|
|
328
|
-
|
|
329
|
-
---
|
|
330
|
-
|
|
331
|
-
## 📄 License
|
|
332
|
-
|
|
333
|
-
MIT © EnvSafe Team
|
|
334
|
-
|
|
335
|
-
---
|
|
336
|
-
|
|
337
|
-
## 🤝 Contributing
|
|
201
|
+
## Liens
|
|
338
202
|
|
|
339
|
-
|
|
203
|
+
- 🌐 [Dashboard EnvSafe](https://www.envsafe.dev)
|
|
204
|
+
- 📖 [Documentation](https://www.envsafe.dev/docs)
|
|
205
|
+
- 🐛 [GitHub Issues](https://github.com/Ifiboys/envsafe-cli/issues)
|
|
340
206
|
|
|
341
|
-
|
|
207
|
+
## Licence
|
|
342
208
|
|
|
343
|
-
|
|
209
|
+
MIT
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function create(projectName?: string): Promise<void>;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.create = create;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
9
|
+
const ora_1 = __importDefault(require("ora"));
|
|
10
|
+
const index_js_1 = require("../index.js");
|
|
11
|
+
const api_js_1 = require("../utils/api.js");
|
|
12
|
+
const config_js_1 = require("../utils/config.js");
|
|
13
|
+
async function create(projectName) {
|
|
14
|
+
const token = index_js_1.config.get("token");
|
|
15
|
+
if (!token) {
|
|
16
|
+
console.log(chalk_1.default.red("✗ Non connecté. Utilisez 'envsafe login' d'abord."));
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const localConfig = (0, config_js_1.readConfig)();
|
|
20
|
+
if (!localConfig?.workspace) {
|
|
21
|
+
console.log(chalk_1.default.yellow("⚠ Aucun workspace lié."));
|
|
22
|
+
console.log(chalk_1.default.dim(" Utilisez 'envsafe link <workspace>' d'abord."));
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
let name = projectName;
|
|
26
|
+
let description;
|
|
27
|
+
if (!name) {
|
|
28
|
+
const answers = await inquirer_1.default.prompt([
|
|
29
|
+
{
|
|
30
|
+
type: "input",
|
|
31
|
+
name: "name",
|
|
32
|
+
message: "Nom du projet:",
|
|
33
|
+
validate: (input) => input.trim().length > 0 || "Le nom est requis",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
type: "input",
|
|
37
|
+
name: "description",
|
|
38
|
+
message: "Description (optionnel):",
|
|
39
|
+
},
|
|
40
|
+
]);
|
|
41
|
+
name = answers.name;
|
|
42
|
+
description = answers.description;
|
|
43
|
+
}
|
|
44
|
+
const spinner = (0, ora_1.default)(`Création du projet "${name}"...`).start();
|
|
45
|
+
try {
|
|
46
|
+
const response = await (0, api_js_1.apiRequest)(`/api/v1/workspaces/${localConfig.workspace}/projects`, {
|
|
47
|
+
method: "POST",
|
|
48
|
+
token,
|
|
49
|
+
body: {
|
|
50
|
+
name: name.trim(),
|
|
51
|
+
description: description?.trim() || undefined,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
if (response.error) {
|
|
55
|
+
spinner.fail(chalk_1.default.red(response.error));
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
spinner.succeed(chalk_1.default.green(`Projet "${response.project.name}" créé avec succès`));
|
|
59
|
+
console.log(chalk_1.default.dim(`\n Slug: ${response.project.slug}`));
|
|
60
|
+
console.log(chalk_1.default.dim(` Environnements: ${response.project.environments.join(", ")}`));
|
|
61
|
+
// Ask if user wants to select this project
|
|
62
|
+
const { selectProject } = await inquirer_1.default.prompt([
|
|
63
|
+
{
|
|
64
|
+
type: "confirm",
|
|
65
|
+
name: "selectProject",
|
|
66
|
+
message: "Sélectionner ce projet maintenant ?",
|
|
67
|
+
default: true,
|
|
68
|
+
},
|
|
69
|
+
]);
|
|
70
|
+
if (selectProject) {
|
|
71
|
+
(0, config_js_1.writeConfig)({
|
|
72
|
+
...localConfig,
|
|
73
|
+
project: response.project.slug,
|
|
74
|
+
});
|
|
75
|
+
console.log(chalk_1.default.green(`\n✓ Projet "${response.project.slug}" sélectionné`));
|
|
76
|
+
console.log(chalk_1.default.cyan("\n Commandes disponibles:"));
|
|
77
|
+
console.log(chalk_1.default.dim(" envsafe pull -d - Récupérer les variables (development)"));
|
|
78
|
+
console.log(chalk_1.default.dim(" envsafe push - Envoyer les variables"));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
spinner.fail(chalk_1.default.red(`Erreur: ${error.message}`));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function init(): Promise<void>;
|