@flowkode/cli 1.0.2 → 1.0.4
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/dist/commands/blog.js +9 -9
- package/dist/commands/config.js +4 -4
- package/dist/commands/deployments.js +6 -6
- package/dist/commands/domains.js +10 -10
- package/dist/commands/folders.js +11 -11
- package/dist/commands/jobs.js +6 -6
- package/dist/commands/login.js +31 -15
- package/dist/commands/projects.js +16 -16
- package/dist/commands/utilities.js +4 -4
- package/dist/index.js +1 -1
- package/dist/output.d.ts +1 -1
- package/dist/output.js +1 -1
- package/package.json +1 -1
package/dist/commands/blog.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { printTable, printSuccess, printError, printJson, } from "../output.js";
|
|
3
3
|
export function blogCommand(api) {
|
|
4
|
-
const cmd = new Command("blog").description("
|
|
4
|
+
const cmd = new Command("blog").description("Gérer les articles de blog");
|
|
5
5
|
cmd
|
|
6
6
|
.command("list")
|
|
7
7
|
.description("Lister les articles")
|
|
@@ -26,7 +26,7 @@ export function blogCommand(api) {
|
|
|
26
26
|
});
|
|
27
27
|
cmd
|
|
28
28
|
.command("get <articleId>")
|
|
29
|
-
.description("
|
|
29
|
+
.description("Détail d'un article")
|
|
30
30
|
.action(async (articleId) => {
|
|
31
31
|
try {
|
|
32
32
|
const res = await api.get(`/blog/articles/${articleId}`);
|
|
@@ -38,8 +38,8 @@ export function blogCommand(api) {
|
|
|
38
38
|
});
|
|
39
39
|
cmd
|
|
40
40
|
.command("generate <projectId>")
|
|
41
|
-
.description("
|
|
42
|
-
.requiredOption("-k, --keywords <keywords...>", "Mots-
|
|
41
|
+
.description("Générer des articles par mots-clés")
|
|
42
|
+
.requiredOption("-k, --keywords <keywords...>", "Mots-clés (un ou plusieurs)")
|
|
43
43
|
.option("--auto-publish", "Publier automatiquement")
|
|
44
44
|
.action(async (projectId, opts) => {
|
|
45
45
|
try {
|
|
@@ -48,7 +48,7 @@ export function blogCommand(api) {
|
|
|
48
48
|
auto_publish: opts.autoPublish ?? false,
|
|
49
49
|
});
|
|
50
50
|
printJson(res);
|
|
51
|
-
printSuccess("
|
|
51
|
+
printSuccess("Génération d'articles lancée.");
|
|
52
52
|
}
|
|
53
53
|
catch (e) {
|
|
54
54
|
printError(e);
|
|
@@ -68,12 +68,12 @@ export function blogCommand(api) {
|
|
|
68
68
|
});
|
|
69
69
|
cmd
|
|
70
70
|
.command("indexing-check <articleId>")
|
|
71
|
-
.description("
|
|
71
|
+
.description("Vérifier l'indexation d'un article")
|
|
72
72
|
.action(async (articleId) => {
|
|
73
73
|
try {
|
|
74
74
|
const res = await api.post(`/blog/articles/${articleId}/indexing/check`);
|
|
75
75
|
printJson(res);
|
|
76
|
-
printSuccess("Verification
|
|
76
|
+
printSuccess("Verification lancée.");
|
|
77
77
|
}
|
|
78
78
|
catch (e) {
|
|
79
79
|
printError(e);
|
|
@@ -81,12 +81,12 @@ export function blogCommand(api) {
|
|
|
81
81
|
});
|
|
82
82
|
cmd
|
|
83
83
|
.command("indexing-submit <articleId>")
|
|
84
|
-
.description("Soumettre un
|
|
84
|
+
.description("Soumettre un articlé pour indexation Google")
|
|
85
85
|
.action(async (articleId) => {
|
|
86
86
|
try {
|
|
87
87
|
const res = await api.post(`/blog/articles/${articleId}/indexing/submit`);
|
|
88
88
|
printJson(res);
|
|
89
|
-
printSuccess("
|
|
89
|
+
printSuccess("Articlé soumis pour indexation.");
|
|
90
90
|
}
|
|
91
91
|
catch (e) {
|
|
92
92
|
printError(e);
|
package/dist/commands/config.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { loadConfig, saveConfig } from "../config.js";
|
|
3
|
-
import { printSuccess,
|
|
3
|
+
import { printSuccess, printDétail } from "../output.js";
|
|
4
4
|
export function configCommand() {
|
|
5
|
-
const cmd = new Command("config").description("Configurer la
|
|
5
|
+
const cmd = new Command("config").description("Configurer la clé API et l'URL de base");
|
|
6
6
|
cmd
|
|
7
|
-
.option("-k, --api-key <key>", "
|
|
7
|
+
.option("-k, --api-key <key>", "Clé API Flowkode (ws_live_...)")
|
|
8
8
|
.option("-u, --base-url <url>", "URL de base de l'API")
|
|
9
9
|
.option("--show", "Afficher la configuration actuelle")
|
|
10
10
|
.action((opts) => {
|
|
11
11
|
if (opts.show) {
|
|
12
12
|
const config = loadConfig();
|
|
13
|
-
|
|
13
|
+
printDétail({
|
|
14
14
|
api_key: config.api_key
|
|
15
15
|
? `${config.api_key.slice(0, 12)}...`
|
|
16
16
|
: undefined,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import { printTable,
|
|
2
|
+
import { printTable, printDétail, printError } from "../output.js";
|
|
3
3
|
export function deploymentsCommand(api) {
|
|
4
|
-
const cmd = new Command("deployments").description("
|
|
4
|
+
const cmd = new Command("deployments").description("Gérer les déploiements");
|
|
5
5
|
cmd
|
|
6
6
|
.command("list")
|
|
7
|
-
.description("Lister les
|
|
7
|
+
.description("Lister les déploiements")
|
|
8
8
|
.option("--project <id>", "Filtrer par projet")
|
|
9
9
|
.option("--provider <provider>", "Filtrer (vercel, cloudflare)")
|
|
10
10
|
.option("-s, --status <status>", "Filtrer (pending, building, ready, error, canceled)")
|
|
@@ -29,18 +29,18 @@ export function deploymentsCommand(api) {
|
|
|
29
29
|
});
|
|
30
30
|
cmd
|
|
31
31
|
.command("get <id>")
|
|
32
|
-
.description("
|
|
32
|
+
.description("Détail d'un déploiement")
|
|
33
33
|
.action(async (id) => {
|
|
34
34
|
try {
|
|
35
35
|
const res = (await api.get(`/deployments/${id}`));
|
|
36
|
-
|
|
36
|
+
printDétail(res.data, [
|
|
37
37
|
{ key: "id", label: "ID" },
|
|
38
38
|
{ key: "project_name", label: "Projet" },
|
|
39
39
|
{ key: "provider", label: "Provider" },
|
|
40
40
|
{ key: "status", label: "Statut" },
|
|
41
41
|
{ key: "url", label: "URL" },
|
|
42
42
|
{ key: "error_message", label: "Erreur" },
|
|
43
|
-
{ key: "created_at", label: "
|
|
43
|
+
{ key: "created_at", label: "Créé le" },
|
|
44
44
|
]);
|
|
45
45
|
}
|
|
46
46
|
catch (e) {
|
package/dist/commands/domains.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import { printTable,
|
|
2
|
+
import { printTable, printDétail, printSuccess, printError, printJson, } from "../output.js";
|
|
3
3
|
export function domainsCommand(api) {
|
|
4
|
-
const cmd = new Command("domains").description("
|
|
4
|
+
const cmd = new Command("domains").description("Gérer les domaines");
|
|
5
5
|
cmd
|
|
6
6
|
.command("list")
|
|
7
7
|
.description("Lister les domaines")
|
|
8
8
|
.option("--registrar <registrar>", "Filtrer (internetbs, ovh, dynadot)")
|
|
9
|
-
.option("--provider <provider>", "Filtrer par provider de
|
|
9
|
+
.option("--provider <provider>", "Filtrer par provider de déploiement")
|
|
10
10
|
.option("--project <id>", "Filtrer par projet")
|
|
11
11
|
.option("--folder <id>", "Filtrer par dossier")
|
|
12
12
|
.action(async (opts) => {
|
|
@@ -32,11 +32,11 @@ export function domainsCommand(api) {
|
|
|
32
32
|
});
|
|
33
33
|
cmd
|
|
34
34
|
.command("get <id>")
|
|
35
|
-
.description("
|
|
35
|
+
.description("Détail d'un domaine")
|
|
36
36
|
.action(async (id) => {
|
|
37
37
|
try {
|
|
38
38
|
const res = (await api.get(`/domains/${id}`));
|
|
39
|
-
|
|
39
|
+
printDétail(res.data, [
|
|
40
40
|
{ key: "id", label: "ID" },
|
|
41
41
|
{ key: "name", label: "Domaine" },
|
|
42
42
|
{ key: "registrar", label: "Registrar" },
|
|
@@ -53,7 +53,7 @@ export function domainsCommand(api) {
|
|
|
53
53
|
});
|
|
54
54
|
cmd
|
|
55
55
|
.command("check <domain>")
|
|
56
|
-
.description("
|
|
56
|
+
.description("Vérifier la disponibilité d'un domaine")
|
|
57
57
|
.action(async (domain) => {
|
|
58
58
|
try {
|
|
59
59
|
const res = (await api.post("/domains/check", {
|
|
@@ -122,7 +122,7 @@ export function domainsCommand(api) {
|
|
|
122
122
|
.action(async (domainId) => {
|
|
123
123
|
try {
|
|
124
124
|
await api.delete(`/domains/${domainId}/associate`);
|
|
125
|
-
printSuccess("Domaine
|
|
125
|
+
printSuccess("Domaine dissocié.");
|
|
126
126
|
}
|
|
127
127
|
catch (e) {
|
|
128
128
|
printError(e);
|
|
@@ -142,7 +142,7 @@ export function domainsCommand(api) {
|
|
|
142
142
|
});
|
|
143
143
|
cmd
|
|
144
144
|
.command("propagation <domainId>")
|
|
145
|
-
.description("
|
|
145
|
+
.description("Vérifier la propagation DNS")
|
|
146
146
|
.action(async (domainId) => {
|
|
147
147
|
try {
|
|
148
148
|
const res = await api.post(`/domains/${domainId}/check-propagation`);
|
|
@@ -154,7 +154,7 @@ export function domainsCommand(api) {
|
|
|
154
154
|
});
|
|
155
155
|
cmd
|
|
156
156
|
.command("delete <id>")
|
|
157
|
-
.description("
|
|
157
|
+
.description("Supprimér un domaine")
|
|
158
158
|
.action(async (id) => {
|
|
159
159
|
try {
|
|
160
160
|
await api.delete(`/domains/${id}`);
|
|
@@ -174,7 +174,7 @@ export function domainsCommand(api) {
|
|
|
174
174
|
if (opts.folder !== undefined)
|
|
175
175
|
body.folder_id = opts.folder || null;
|
|
176
176
|
const res = (await api.patch(`/domains/${id}`, body));
|
|
177
|
-
|
|
177
|
+
printDétail(res.data, [
|
|
178
178
|
{ key: "id", label: "ID" },
|
|
179
179
|
{ key: "name", label: "Domaine" },
|
|
180
180
|
{ key: "folder_id", label: "Dossier" },
|
package/dist/commands/folders.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import { printTable,
|
|
2
|
+
import { printTable, printDétail, printSuccess, printError, } from "../output.js";
|
|
3
3
|
export function foldersCommand(api) {
|
|
4
|
-
const cmd = new Command("folders").description("
|
|
4
|
+
const cmd = new Command("folders").description("Gérer les dossiers");
|
|
5
5
|
cmd
|
|
6
6
|
.command("list")
|
|
7
7
|
.description("Lister les dossiers")
|
|
@@ -21,16 +21,16 @@ export function foldersCommand(api) {
|
|
|
21
21
|
});
|
|
22
22
|
cmd
|
|
23
23
|
.command("get <id>")
|
|
24
|
-
.description("
|
|
24
|
+
.description("Détail d'un dossier")
|
|
25
25
|
.action(async (id) => {
|
|
26
26
|
try {
|
|
27
27
|
const res = (await api.get(`/folders/${id}`));
|
|
28
|
-
|
|
28
|
+
printDétail(res.data, [
|
|
29
29
|
{ key: "id", label: "ID" },
|
|
30
30
|
{ key: "name", label: "Nom" },
|
|
31
31
|
{ key: "color", label: "Couleur" },
|
|
32
32
|
{ key: "position", label: "Position" },
|
|
33
|
-
{ key: "created_at", label: "
|
|
33
|
+
{ key: "created_at", label: "Créé le" },
|
|
34
34
|
]);
|
|
35
35
|
}
|
|
36
36
|
catch (e) {
|
|
@@ -39,7 +39,7 @@ export function foldersCommand(api) {
|
|
|
39
39
|
});
|
|
40
40
|
cmd
|
|
41
41
|
.command("create")
|
|
42
|
-
.description("
|
|
42
|
+
.description("Créer un dossier")
|
|
43
43
|
.requiredOption("-n, --name <name>", "Nom du dossier")
|
|
44
44
|
.option("-c, --color <color>", "Couleur (gray, red, orange, amber, green, blue, violet, pink)", "gray")
|
|
45
45
|
.action(async (opts) => {
|
|
@@ -48,12 +48,12 @@ export function foldersCommand(api) {
|
|
|
48
48
|
name: opts.name,
|
|
49
49
|
color: opts.color,
|
|
50
50
|
}));
|
|
51
|
-
|
|
51
|
+
printDétail(res.data, [
|
|
52
52
|
{ key: "id", label: "ID" },
|
|
53
53
|
{ key: "name", label: "Nom" },
|
|
54
54
|
{ key: "color", label: "Couleur" },
|
|
55
55
|
]);
|
|
56
|
-
printSuccess("Dossier
|
|
56
|
+
printSuccess("Dossier créé.");
|
|
57
57
|
}
|
|
58
58
|
catch (e) {
|
|
59
59
|
printError(e);
|
|
@@ -75,7 +75,7 @@ export function foldersCommand(api) {
|
|
|
75
75
|
if (opts.position !== undefined)
|
|
76
76
|
body.position = parseInt(opts.position);
|
|
77
77
|
const res = (await api.patch(`/folders/${id}`, body));
|
|
78
|
-
|
|
78
|
+
printDétail(res.data, [
|
|
79
79
|
{ key: "id", label: "ID" },
|
|
80
80
|
{ key: "name", label: "Nom" },
|
|
81
81
|
{ key: "color", label: "Couleur" },
|
|
@@ -89,11 +89,11 @@ export function foldersCommand(api) {
|
|
|
89
89
|
});
|
|
90
90
|
cmd
|
|
91
91
|
.command("delete <id>")
|
|
92
|
-
.description("
|
|
92
|
+
.description("Supprimér un dossier")
|
|
93
93
|
.action(async (id) => {
|
|
94
94
|
try {
|
|
95
95
|
await api.delete(`/folders/${id}`);
|
|
96
|
-
printSuccess("Dossier supprime. Projets et domaines
|
|
96
|
+
printSuccess("Dossier supprime. Projets et domaines déplacés a la racine.");
|
|
97
97
|
}
|
|
98
98
|
catch (e) {
|
|
99
99
|
printError(e);
|
package/dist/commands/jobs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import { printTable,
|
|
2
|
+
import { printTable, printDétail, printError } from "../output.js";
|
|
3
3
|
export function jobsCommand(api) {
|
|
4
|
-
const cmd = new Command("jobs").description("Suivre les jobs de
|
|
4
|
+
const cmd = new Command("jobs").description("Suivre les jobs de génération");
|
|
5
5
|
cmd
|
|
6
6
|
.command("list")
|
|
7
7
|
.description("Lister les jobs")
|
|
@@ -15,7 +15,7 @@ export function jobsCommand(api) {
|
|
|
15
15
|
{ key: "id", label: "ID", width: 36 },
|
|
16
16
|
{ key: "status", label: "Statut", width: 12 },
|
|
17
17
|
{ key: "project_id", label: "Projet", width: 36 },
|
|
18
|
-
{ key: "created_at", label: "
|
|
18
|
+
{ key: "created_at", label: "Créé le", width: 20 },
|
|
19
19
|
]);
|
|
20
20
|
}
|
|
21
21
|
catch (e) {
|
|
@@ -24,16 +24,16 @@ export function jobsCommand(api) {
|
|
|
24
24
|
});
|
|
25
25
|
cmd
|
|
26
26
|
.command("get <id>")
|
|
27
|
-
.description("
|
|
27
|
+
.description("Détail d'un job")
|
|
28
28
|
.action(async (id) => {
|
|
29
29
|
try {
|
|
30
30
|
const res = (await api.get(`/jobs/${id}`));
|
|
31
|
-
|
|
31
|
+
printDétail(res.data, [
|
|
32
32
|
{ key: "id", label: "ID" },
|
|
33
33
|
{ key: "status", label: "Statut" },
|
|
34
34
|
{ key: "project_id", label: "Projet" },
|
|
35
35
|
{ key: "error_message", label: "Erreur" },
|
|
36
|
-
{ key: "created_at", label: "
|
|
36
|
+
{ key: "created_at", label: "Créé le" },
|
|
37
37
|
{ key: "updated_at", label: "Mis a jour" },
|
|
38
38
|
]);
|
|
39
39
|
}
|
package/dist/commands/login.js
CHANGED
|
@@ -20,7 +20,7 @@ function openBrowser(url) {
|
|
|
20
20
|
}
|
|
21
21
|
export function loginCommand() {
|
|
22
22
|
const cmd = new Command("login")
|
|
23
|
-
.description("Se connecter
|
|
23
|
+
.description("Se connecter à Flowkode via le navigateur")
|
|
24
24
|
.option("--no-browser", "Ne pas ouvrir le navigateur automatiquement")
|
|
25
25
|
.action(async (opts) => {
|
|
26
26
|
const baseUrl = getBaseUrl();
|
|
@@ -55,9 +55,9 @@ export function loginCommand() {
|
|
|
55
55
|
res.writeHead(200, {
|
|
56
56
|
"Content-Type": "text/html; charset=utf-8",
|
|
57
57
|
});
|
|
58
|
-
res.end(htmlPage("Autorisation
|
|
58
|
+
res.end(htmlPage("Autorisation refusée", "Vous pouvez fermer cette page.", "#dc2626"));
|
|
59
59
|
server.close();
|
|
60
|
-
reject(new Error("Autorisation
|
|
60
|
+
reject(new Error("Autorisation refusée par l'utilisateur."));
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
63
|
if (!key) {
|
|
@@ -68,14 +68,14 @@ export function loginCommand() {
|
|
|
68
68
|
res.writeHead(200, {
|
|
69
69
|
"Content-Type": "text/html; charset=utf-8",
|
|
70
70
|
});
|
|
71
|
-
res.end(htmlPage("
|
|
71
|
+
res.end(htmlPage("Connecté !", "Vous pouvez fermer cette page et retourner dans votre terminal.", "#16a34a"));
|
|
72
72
|
server.close();
|
|
73
73
|
resolve({ key, email });
|
|
74
74
|
});
|
|
75
75
|
server.listen(port, "127.0.0.1");
|
|
76
76
|
setTimeout(() => {
|
|
77
77
|
server.close();
|
|
78
|
-
reject(new Error("Timeout — aucune
|
|
78
|
+
reject(new Error("Timeout — aucune réponse reçue du navigateur (5 min)."));
|
|
79
79
|
}, 5 * 60 * 1000);
|
|
80
80
|
});
|
|
81
81
|
const authorizeUrl = `${baseUrl}/cli/authorize?port=${port}&code=${code}`;
|
|
@@ -94,8 +94,8 @@ export function loginCommand() {
|
|
|
94
94
|
config.api_key = key;
|
|
95
95
|
saveConfig(config);
|
|
96
96
|
console.log();
|
|
97
|
-
printSuccess(`
|
|
98
|
-
console.log(chalk.dim("
|
|
97
|
+
printSuccess(`Connecté${email ? ` en tant que ${chalk.bold(email)}` : ""} !`);
|
|
98
|
+
console.log(chalk.dim(" Clé sauvegardée dans ~/.flowkode/config.json"));
|
|
99
99
|
console.log();
|
|
100
100
|
console.log(chalk.dim(" Essayez : flowkode projects list"));
|
|
101
101
|
console.log();
|
|
@@ -109,25 +109,41 @@ export function loginCommand() {
|
|
|
109
109
|
}
|
|
110
110
|
export function logoutCommand() {
|
|
111
111
|
return new Command("logout")
|
|
112
|
-
.description("Se
|
|
112
|
+
.description("Se déconnecter (supprime la clé API locale)")
|
|
113
113
|
.action(() => {
|
|
114
114
|
const config = loadConfig();
|
|
115
115
|
if (!config.api_key) {
|
|
116
|
-
console.log(chalk.dim("Pas de
|
|
116
|
+
console.log(chalk.dim("Pas de clé API configurée."));
|
|
117
117
|
return;
|
|
118
118
|
}
|
|
119
119
|
delete config.api_key;
|
|
120
120
|
saveConfig(config);
|
|
121
|
-
printSuccess("
|
|
121
|
+
printSuccess("Déconnecté. Clé API supprimée de ~/.flowkode/config.json");
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
function htmlPage(title, message, color) {
|
|
125
|
+
const isSuccess = color === "#16a34a";
|
|
126
|
+
const icon = isSuccess
|
|
127
|
+
? `<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="${color}" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="m4.5 12.75 6 6 9-13.5"/></svg>`
|
|
128
|
+
: `<svg width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="${color}" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>`;
|
|
125
129
|
return `<!DOCTYPE html>
|
|
126
|
-
<html><head><meta charset="utf-8"><title>Flowkode CLI</title
|
|
127
|
-
<
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
<html><head><meta charset="utf-8"><title>Flowkode CLI</title>
|
|
131
|
+
<style>
|
|
132
|
+
*{margin:0;padding:0;box-sizing:border-box}
|
|
133
|
+
body{font-family:system-ui,-apple-system,sans-serif;display:flex;justify-content:center;align-items:center;min-height:100vh;background:#fafafa;padding:1rem}
|
|
134
|
+
.card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:2rem;max-width:400px;width:100%;text-align:center;box-shadow:0 1px 3px rgba(0,0,0,.06)}
|
|
135
|
+
.icon{display:inline-flex;align-items:center;justify-content:center;width:64px;height:64px;border-radius:50%;background:${color}10;margin-bottom:1.25rem}
|
|
136
|
+
h2{font-size:1.5rem;font-weight:700;color:${color};margin-bottom:.5rem}
|
|
137
|
+
p{color:#6b7280;font-size:.9rem;line-height:1.5}
|
|
138
|
+
.logo{margin-bottom:1.5rem}
|
|
139
|
+
.logo svg{height:32px}
|
|
140
|
+
</style></head>
|
|
141
|
+
<body>
|
|
142
|
+
<div class="card">
|
|
143
|
+
<div class="logo"><svg height="32" viewBox="0 0 180 40" fill="none" xmlns="http://www.w3.org/2000/svg"><text x="0" y="30" font-family="system-ui" font-weight="700" font-size="28" fill="#0f172a">flowkode</text></svg></div>
|
|
144
|
+
<div class="icon">${icon}</div>
|
|
145
|
+
<h2>${title}</h2>
|
|
146
|
+
<p>${message}</p>
|
|
131
147
|
</div>
|
|
132
148
|
</body></html>`;
|
|
133
149
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import { printTable,
|
|
2
|
+
import { printTable, printDétail, printSuccess, printError, printJson, } from "../output.js";
|
|
3
3
|
export function projectsCommand(api) {
|
|
4
|
-
const cmd = new Command("projects").description("
|
|
4
|
+
const cmd = new Command("projects").description("Gérer les projets");
|
|
5
5
|
cmd
|
|
6
6
|
.command("list")
|
|
7
7
|
.description("Lister les projets")
|
|
@@ -15,7 +15,7 @@ export function projectsCommand(api) {
|
|
|
15
15
|
{ key: "id", label: "ID", width: 36 },
|
|
16
16
|
{ key: "name", label: "Nom", width: 30 },
|
|
17
17
|
{ key: "description", label: "Description", width: 40 },
|
|
18
|
-
{ key: "created_at", label: "
|
|
18
|
+
{ key: "created_at", label: "Créé le", width: 20 },
|
|
19
19
|
]);
|
|
20
20
|
}
|
|
21
21
|
catch (e) {
|
|
@@ -24,18 +24,18 @@ export function projectsCommand(api) {
|
|
|
24
24
|
});
|
|
25
25
|
cmd
|
|
26
26
|
.command("get <id>")
|
|
27
|
-
.description("
|
|
27
|
+
.description("Détail d'un projet")
|
|
28
28
|
.action(async (id) => {
|
|
29
29
|
try {
|
|
30
30
|
const res = (await api.get(`/projects/${id}`));
|
|
31
|
-
|
|
31
|
+
printDétail(res.data, [
|
|
32
32
|
{ key: "id", label: "ID" },
|
|
33
33
|
{ key: "name", label: "Nom" },
|
|
34
34
|
{ key: "description", label: "Description" },
|
|
35
35
|
{ key: "site_type", label: "Type" },
|
|
36
|
-
{ key: "keywords", label: "Mots-
|
|
36
|
+
{ key: "keywords", label: "Mots-clés" },
|
|
37
37
|
{ key: "folder_id", label: "Dossier" },
|
|
38
|
-
{ key: "created_at", label: "
|
|
38
|
+
{ key: "created_at", label: "Créé le" },
|
|
39
39
|
]);
|
|
40
40
|
}
|
|
41
41
|
catch (e) {
|
|
@@ -44,13 +44,13 @@ export function projectsCommand(api) {
|
|
|
44
44
|
});
|
|
45
45
|
cmd
|
|
46
46
|
.command("create")
|
|
47
|
-
.description("
|
|
47
|
+
.description("Créer un projet (mode rapide)")
|
|
48
48
|
.requiredOption("-n, --name <name>", "Nom du projet")
|
|
49
49
|
.requiredOption("-t, --type <type>", "Type de site (vitrine, affiliation)")
|
|
50
|
-
.requiredOption("-k, --keywords <keywords>", "Mots-
|
|
50
|
+
.requiredOption("-k, --keywords <keywords>", "Mots-clés SEO")
|
|
51
51
|
.option("-l, --language <lang>", "Langue", "fr")
|
|
52
52
|
.option("-d, --description <desc>", "Description du site")
|
|
53
|
-
.option("--ai-model <model>", "ID du
|
|
53
|
+
.option("--ai-model <model>", "ID du modèle IA")
|
|
54
54
|
.action(async (opts) => {
|
|
55
55
|
try {
|
|
56
56
|
const res = await api.post("/projects", {
|
|
@@ -63,7 +63,7 @@ export function projectsCommand(api) {
|
|
|
63
63
|
aiModel: opts.aiModel,
|
|
64
64
|
});
|
|
65
65
|
printJson(res);
|
|
66
|
-
printSuccess("Projet en cours de
|
|
66
|
+
printSuccess("Projet en cours de génération. Suivez avec: flowkode jobs get <jobId>");
|
|
67
67
|
}
|
|
68
68
|
catch (e) {
|
|
69
69
|
printError(e);
|
|
@@ -85,7 +85,7 @@ export function projectsCommand(api) {
|
|
|
85
85
|
if (opts.folder !== undefined)
|
|
86
86
|
body.folder_id = opts.folder || null;
|
|
87
87
|
const res = (await api.patch(`/projects/${id}`, body));
|
|
88
|
-
|
|
88
|
+
printDétail(res.data, [
|
|
89
89
|
{ key: "id", label: "ID" },
|
|
90
90
|
{ key: "name", label: "Nom" },
|
|
91
91
|
{ key: "description", label: "Description" },
|
|
@@ -99,7 +99,7 @@ export function projectsCommand(api) {
|
|
|
99
99
|
});
|
|
100
100
|
cmd
|
|
101
101
|
.command("deploy <id>")
|
|
102
|
-
.description("
|
|
102
|
+
.description("Déployer un projet")
|
|
103
103
|
.requiredOption("-p, --provider <provider>", "Provider (vercel, cloudflare)")
|
|
104
104
|
.option("--domain <id>", "ID du domaine a associer")
|
|
105
105
|
.option("--configure-ns", "Configurer les nameservers automatiquement")
|
|
@@ -111,7 +111,7 @@ export function projectsCommand(api) {
|
|
|
111
111
|
configure_ns: opts.configureNs,
|
|
112
112
|
});
|
|
113
113
|
printJson(res);
|
|
114
|
-
printSuccess("
|
|
114
|
+
printSuccess("Déploiement lancé.");
|
|
115
115
|
}
|
|
116
116
|
catch (e) {
|
|
117
117
|
printError(e);
|
|
@@ -119,12 +119,12 @@ export function projectsCommand(api) {
|
|
|
119
119
|
});
|
|
120
120
|
cmd
|
|
121
121
|
.command("redeploy <id>")
|
|
122
|
-
.description("Re-
|
|
122
|
+
.description("Re-déployer sur le dernier provider")
|
|
123
123
|
.action(async (id) => {
|
|
124
124
|
try {
|
|
125
125
|
const res = await api.post(`/projects/${id}/redeploy`);
|
|
126
126
|
printJson(res);
|
|
127
|
-
printSuccess("Re-
|
|
127
|
+
printSuccess("Re-déploiement lancé.");
|
|
128
128
|
}
|
|
129
129
|
catch (e) {
|
|
130
130
|
printError(e);
|
|
@@ -20,7 +20,7 @@ export function utilitiesCommands(api) {
|
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
22
|
const aiModels = new Command("ai-models")
|
|
23
|
-
.description("Lister les
|
|
23
|
+
.description("Lister les modèles IA disponibles")
|
|
24
24
|
.option("-c, --category <cat>", "Filtrer par categorie")
|
|
25
25
|
.action(async (opts) => {
|
|
26
26
|
try {
|
|
@@ -34,7 +34,7 @@ export function utilitiesCommands(api) {
|
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
const legalNotices = new Command("legal-notices")
|
|
37
|
-
.description("Lister les mentions
|
|
37
|
+
.description("Lister les mentions légales")
|
|
38
38
|
.action(async () => {
|
|
39
39
|
try {
|
|
40
40
|
const res = (await api.get("/legal-notices"));
|
|
@@ -47,7 +47,7 @@ export function utilitiesCommands(api) {
|
|
|
47
47
|
printError(e);
|
|
48
48
|
}
|
|
49
49
|
});
|
|
50
|
-
const affiliation = new Command("affiliation").description("
|
|
50
|
+
const affiliation = new Command("affiliation").description("Gérer les projets d'affiliation");
|
|
51
51
|
affiliation
|
|
52
52
|
.command("list")
|
|
53
53
|
.description("Lister les projets d'affiliation")
|
|
@@ -66,7 +66,7 @@ export function utilitiesCommands(api) {
|
|
|
66
66
|
});
|
|
67
67
|
affiliation
|
|
68
68
|
.command("get <id>")
|
|
69
|
-
.description("
|
|
69
|
+
.description("Détail d'un projet d'affiliation")
|
|
70
70
|
.action(async (id) => {
|
|
71
71
|
try {
|
|
72
72
|
const res = await api.get(`/affiliation-projects/${id}`);
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import { utilitiesCommands } from "./commands/utilities.js";
|
|
|
15
15
|
const program = new Command();
|
|
16
16
|
program
|
|
17
17
|
.name("flowkode")
|
|
18
|
-
.description("CLI pour l'API Flowkode —
|
|
18
|
+
.description("CLI pour l'API Flowkode — Créer, déployer et gérer vos sites")
|
|
19
19
|
.version("1.0.0")
|
|
20
20
|
.option("--json", "Sortie en JSON brut")
|
|
21
21
|
.hook("preAction", (thisCommand) => {
|
package/dist/output.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare function printTable(rows: Record<string, unknown>[], columns: {
|
|
|
7
7
|
}[]): void;
|
|
8
8
|
export declare function printSuccess(message: string): void;
|
|
9
9
|
export declare function printError(error: unknown): void;
|
|
10
|
-
export declare function
|
|
10
|
+
export declare function printDétail(data: Record<string, unknown>, fields: {
|
|
11
11
|
key: string;
|
|
12
12
|
label: string;
|
|
13
13
|
}[]): void;
|
package/dist/output.js
CHANGED