terminal-smart-cli 0.97.6 → 0.97.7
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/bin/ts.js +5 -4
- package/package.json +1 -1
package/bin/ts.js
CHANGED
|
@@ -2667,11 +2667,12 @@ async function siteCmd(args) {
|
|
|
2667
2667
|
), { title: `ts site · ${r.plan} · limite ${r.siteLimit || 'demo'}` }) + '\n');
|
|
2668
2668
|
return;
|
|
2669
2669
|
}
|
|
2670
|
-
if (['criar', 'create', 'gerar', 'generate'].includes(sub)) {
|
|
2670
|
+
if (['criar', 'create', 'gerar', 'generate', 'editar', 'edit', 'alterar', 'update'].includes(sub)) {
|
|
2671
2671
|
const slug = String(rest.shift() || '').trim();
|
|
2672
2672
|
const prompt = rest.join(' ').trim();
|
|
2673
|
-
|
|
2674
|
-
console.log(
|
|
2673
|
+
const editing = ['editar', 'edit', 'alterar', 'update'].includes(sub);
|
|
2674
|
+
if (!slug || !prompt) return console.log(ui.errLine(`uso: ts site ${editing ? 'editar' : 'criar'} <nome> "<descreva ${editing ? 'a alteração' : 'o site'} em linguagem natural>"`));
|
|
2675
|
+
console.log(C.dim(editing ? 'carregando, alterando e republicando o site…' : 'criando e publicando o site…'));
|
|
2675
2676
|
const r = await api('/api/sites/generate', { token, method: 'POST', body: { slug, prompt }, timeoutMs: 240000 });
|
|
2676
2677
|
if (!r.ok) return console.log(ui.errLine(r.error || r.message || 'não foi possível criar o site'));
|
|
2677
2678
|
if (JSON_OUT) return console.log(JSON.stringify(r));
|
|
@@ -2699,7 +2700,7 @@ async function siteCmd(args) {
|
|
|
2699
2700
|
const r = await api('/api/sites/' + id, { token, method: 'DELETE' });
|
|
2700
2701
|
return console.log(r.ok ? ui.okLine('site removido') : ui.errLine(r.error || 'falha'));
|
|
2701
2702
|
}
|
|
2702
|
-
console.log(ui.infoLine('Comandos: ts site listar | criar <nome> "<descrição>" | publicar <nome> <arquivo.html> | apagar <id>'));
|
|
2703
|
+
console.log(ui.infoLine('Comandos: ts site listar | criar <nome> "<descrição>" | editar <nome> "<alteração>" | publicar <nome> <arquivo.html> | apagar <id>'));
|
|
2703
2704
|
} catch (e) {
|
|
2704
2705
|
console.log(ui.errLine(e.code === 'auth' ? T.need_login : (e.message || 'falha')));
|
|
2705
2706
|
}
|