trello-cli-unofficial 0.15.1 → 0.16.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/CHANGELOG.md +16 -0
- package/README.md +38 -0
- package/bin/cli.js +25 -117
- package/bun.lock +448 -1
- package/dist/main.js +2431 -2329
- package/package.json +9 -5
- package/src/i18n/locales/en.json +5 -0
- package/src/i18n/locales/pt-BR.json +5 -0
- package/src/presentation/cli/AuthController.ts +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
# [0.16.0](https://github.com/JaegerCaiser/trello-cli-unofficial/compare/v0.15.1...v0.16.0) (2026-04-09)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* bun version on runner ([503fc7a](https://github.com/JaegerCaiser/trello-cli-unofficial/commit/503fc7a1c49957add117473a25f061450bdf1d61))
|
|
7
|
+
* bun version on runner 2 ([d025133](https://github.com/JaegerCaiser/trello-cli-unofficial/commit/d0251337bbbc6dbe0bfa0bd496dcaf07ca503736))
|
|
8
|
+
* bun version on runner 3 ([ca5d4f7](https://github.com/JaegerCaiser/trello-cli-unofficial/commit/ca5d4f730b42e4c9cd073968fff764f173430fbf))
|
|
9
|
+
* bun version on runner 4 ([2b5f561](https://github.com/JaegerCaiser/trello-cli-unofficial/commit/2b5f561ed028b5398655a8d6f7dc3d3d724f0d6c))
|
|
10
|
+
* **tests:** add pt-BR language setup in GetBoardDetailsUseCase test ([0ad8441](https://github.com/JaegerCaiser/trello-cli-unofficial/commit/0ad844153845297e34f391d9e5c3b59211d4f646))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* support Node production runtime and improve Trello auth ([283219f](https://github.com/JaegerCaiser/trello-cli-unofficial/commit/283219f0171fb6e92748c51990f8d43bb12426e4))
|
|
16
|
+
|
|
1
17
|
## [0.15.1](https://github.com/JaegerCaiser/trello-cli-unofficial/compare/v0.15.0...v0.15.1) (2026-04-06)
|
|
2
18
|
|
|
3
19
|
|
package/README.md
CHANGED
|
@@ -21,6 +21,42 @@ tcu setup
|
|
|
21
21
|
tcu interactive
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
## 🔑 Configurando o Token do Trello
|
|
25
|
+
|
|
26
|
+
Na primeira execução o CLI vai pedir seu token do Trello (autenticação via Power-Up). Siga os passos abaixo:
|
|
27
|
+
|
|
28
|
+
**Passo 1 — Acesse o painel de administração de Power-Ups:**
|
|
29
|
+
|
|
30
|
+
Abra no navegador: **https://trello.com/power-ups/admin**
|
|
31
|
+
|
|
32
|
+
Faça login no Trello se necessário.
|
|
33
|
+
|
|
34
|
+
**Passo 2 — Crie um novo Power-Up:**
|
|
35
|
+
|
|
36
|
+
Clique em **"New"** e preencha com qualquer nome (ex: `Meu CLI`). O nome não importa — é só para identificar o app na sua conta.
|
|
37
|
+
|
|
38
|
+
> Se você já criou um Power-Up antes, basta selecioná-lo na lista.
|
|
39
|
+
|
|
40
|
+
**Passo 3 — Gere o token manualmente:**
|
|
41
|
+
|
|
42
|
+
Dentro da página do seu Power-Up, você verá no painel à direita a mensagem:
|
|
43
|
+
|
|
44
|
+
> *"A maioria dos desenvolvedores precisará solicitar a cada usuário que autorize seu aplicativo. Se você deseja criar um aplicativo para si mesmo ou está fazendo testes locais, é possível gerar um **token** manualmente."*
|
|
45
|
+
|
|
46
|
+
Clique na palavra **token** destacada nessa mensagem. Uma nova página abrirá pedindo confirmação — clique em **"Permitir"**.
|
|
47
|
+
|
|
48
|
+
**Passo 4 — Copie o token:**
|
|
49
|
+
|
|
50
|
+
A página exibirá uma longa sequência de caracteres começando com `ATTA`. Copie tudo.
|
|
51
|
+
|
|
52
|
+
**Passo 5 — Cole no terminal:**
|
|
53
|
+
|
|
54
|
+
Quando o CLI perguntar `Por favor, insira seu token do Trello:`, cole o token e pressione Enter.
|
|
55
|
+
|
|
56
|
+
> **Dica:** O token começa obrigatoriamente com `ATTA`. Se o CLI rejeitar sua entrada, verifique se copiou o token completo sem espaços extras.
|
|
57
|
+
|
|
58
|
+
> **Segurança:** O token fica salvo localmente em `~/.trello-cli-unofficial/config.json`. Para revogar o acesso, acesse [trello.com/account](https://trello.com/account) → **Power-Ups & Tokens** e revogue o token desta aplicação.
|
|
59
|
+
|
|
24
60
|
## Features
|
|
25
61
|
|
|
26
62
|
- 🚀 Modo interativo com menu guiado
|
|
@@ -38,6 +74,8 @@ tcu lists
|
|
|
38
74
|
|
|
39
75
|
tcu cards
|
|
40
76
|
|
|
77
|
+
tcu checklists
|
|
78
|
+
|
|
41
79
|
tcu config
|
|
42
80
|
```
|
|
43
81
|
|
package/bin/cli.js
CHANGED
|
@@ -1,126 +1,34 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
import { execSync, spawn } from 'node:child_process';
|
|
2
|
+
import { existsSync } from 'node:fs';
|
|
4
3
|
import path from 'node:path';
|
|
5
4
|
import process from 'node:process';
|
|
6
|
-
import { fileURLToPath } from 'node:url';
|
|
5
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
7
6
|
|
|
8
7
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
9
|
-
|
|
10
|
-
// Detect language from environment
|
|
11
|
-
function detectLanguage() {
|
|
12
|
-
const langVars = ['LANG', 'LANGUAGE', 'LC_ALL', 'LC_MESSAGES'];
|
|
13
|
-
for (const varName of langVars) {
|
|
14
|
-
const value = process.env[varName];
|
|
15
|
-
if (value && value.toLowerCase().includes('pt')) {
|
|
16
|
-
return 'pt';
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
return 'en';
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
const lang = detectLanguage();
|
|
23
|
-
|
|
24
|
-
const messages = {
|
|
25
|
-
pt: {
|
|
26
|
-
bunRequired: '❌ Bun é necessário para executar o Trello CLI Unofficial',
|
|
27
|
-
bunNotFound: 'Bun não foi encontrado no sistema',
|
|
28
|
-
installBun: '📦 Instale o Bun primeiro:',
|
|
29
|
-
installCommand: 'curl -fsSL https://bun.sh/install | bash',
|
|
30
|
-
windowsInstall: 'powershell -c "irm bun.sh/install.ps1 | iex"',
|
|
31
|
-
afterInstall: 'Após instalar, reinicie o terminal e execute novamente',
|
|
32
|
-
versionCommand: 'Verifique com: bun --version',
|
|
33
|
-
},
|
|
34
|
-
en: {
|
|
35
|
-
bunRequired: '❌ Bun is required to run Trello CLI Unofficial',
|
|
36
|
-
bunNotFound: 'Bun was not found on the system',
|
|
37
|
-
installBun: '📦 Please install Bun first:',
|
|
38
|
-
installCommand: 'curl -fsSL https://bun.sh/install | bash',
|
|
39
|
-
windowsInstall: 'powershell -c "irm bun.sh/install.ps1 | iex"',
|
|
40
|
-
afterInstall: 'After installation, restart your terminal and run again',
|
|
41
|
-
versionCommand: 'Check with: bun --version',
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const msg = messages[lang];
|
|
46
|
-
|
|
47
|
-
// Check if Bun is available (local or global)
|
|
48
|
-
function isBunAvailable() {
|
|
49
|
-
try {
|
|
50
|
-
// First try local Bun
|
|
51
|
-
execSync('node_modules/.bin/bun --version', { stdio: 'pipe' });
|
|
52
|
-
return 'local';
|
|
53
|
-
}
|
|
54
|
-
catch {
|
|
55
|
-
try {
|
|
56
|
-
// Then try global Bun
|
|
57
|
-
execSync('bun --version', { stdio: 'pipe' });
|
|
58
|
-
return 'global';
|
|
59
|
-
}
|
|
60
|
-
catch {
|
|
61
|
-
return false;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
// Main execution
|
|
67
|
-
const bunType = isBunAvailable();
|
|
68
|
-
if (!bunType) {
|
|
69
|
-
console.log(msg.bunRequired);
|
|
70
|
-
console.log(msg.bunNotFound);
|
|
71
|
-
console.log('');
|
|
72
|
-
console.log(msg.installBun);
|
|
73
|
-
|
|
74
|
-
// Detect platform for appropriate install command
|
|
75
|
-
const platform = process.platform;
|
|
76
|
-
if (platform === 'win32') {
|
|
77
|
-
console.log(`Windows: ${msg.windowsInstall}`);
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
console.log(`Unix/Linux/macOS: ${msg.installCommand}`);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
console.log('');
|
|
84
|
-
console.log(msg.afterInstall);
|
|
85
|
-
console.log(msg.versionCommand);
|
|
86
|
-
process.exit(1);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
// Bun is available, execute the main script
|
|
90
8
|
const mainScript = path.join(__dirname, '..', 'dist', 'main.js');
|
|
91
|
-
const args = process.argv.slice(2);
|
|
92
9
|
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
10
|
+
if (!existsSync(mainScript)) {
|
|
11
|
+
const lang = ['LANG', 'LANGUAGE', 'LC_ALL', 'LC_MESSAGES']
|
|
12
|
+
.map(v => process.env[v] || '')
|
|
13
|
+
.some(v => v.toLowerCase().includes('pt'))
|
|
14
|
+
? 'pt'
|
|
15
|
+
: 'en';
|
|
16
|
+
|
|
17
|
+
const messages = {
|
|
18
|
+
pt: [
|
|
19
|
+
'❌ Build não encontrado. O pacote pode ter sido corrompido.',
|
|
20
|
+
' Tente reinstalar: npm install -g trello-cli-unofficial',
|
|
21
|
+
' Ou, se for desenvolvedor: bun run build',
|
|
22
|
+
],
|
|
23
|
+
en: [
|
|
24
|
+
'❌ Build not found. The package may be corrupted.',
|
|
25
|
+
' Try reinstalling: npm install -g trello-cli-unofficial',
|
|
26
|
+
' Or, if you are a developer: bun run build',
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
console.error(messages[lang].join('\n'));
|
|
31
|
+
process.exit(1);
|
|
106
32
|
}
|
|
107
33
|
|
|
108
|
-
|
|
109
|
-
const bunCommand = bunType === 'local'
|
|
110
|
-
? path.join(__dirname, '..', 'node_modules', '.bin', 'bun')
|
|
111
|
-
: 'bun';
|
|
112
|
-
|
|
113
|
-
const child = spawn(bunCommand, [mainScript, ...args], {
|
|
114
|
-
stdio: 'inherit',
|
|
115
|
-
cwd: process.cwd(),
|
|
116
|
-
env: { ...process.env, VERBOSE_ERRORS: process.env.VERBOSE_ERRORS || 'false' },
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
child.on('exit', (code) => {
|
|
120
|
-
process.exit(code);
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
child.on('error', (error) => {
|
|
124
|
-
console.error('Failed to start Bun:', error.message);
|
|
125
|
-
process.exit(1);
|
|
126
|
-
});
|
|
34
|
+
await import(pathToFileURL(mainScript).href);
|