trello-cli-unofficial 0.9.2 → 0.9.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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [0.9.4](https://github.com/JaegerCaiser/trello-cli-unofficial/compare/v0.9.3...v0.9.4) (2025-11-14)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* create CLI wrapper to ensure Bun execution ([87deabf](https://github.com/JaegerCaiser/trello-cli-unofficial/commit/87deabf6c8be566a764bb52d057bebb49090f88f))
|
|
7
|
+
|
|
8
|
+
## [0.9.3](https://github.com/JaegerCaiser/trello-cli-unofficial/compare/v0.9.2...v0.9.3) (2025-11-14)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* make check-dependencies script Windows-compatible ([358fb98](https://github.com/JaegerCaiser/trello-cli-unofficial/commit/358fb9816045aef97631a257ab7a8d1dcfa4aea8))
|
|
14
|
+
|
|
1
15
|
## [0.9.2](https://github.com/JaegerCaiser/trello-cli-unofficial/compare/v0.9.1...v0.9.2) (2025-11-14)
|
|
2
16
|
|
|
3
17
|
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { execSync, spawn } from 'node:child_process';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import process from 'node:process';
|
|
6
|
+
import { fileURLToPath } from 'node:url';
|
|
7
|
+
|
|
8
|
+
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
|
|
48
|
+
function isBunAvailable() {
|
|
49
|
+
try {
|
|
50
|
+
execSync('bun --version', { stdio: 'pipe' });
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Main execution
|
|
59
|
+
if (!isBunAvailable()) {
|
|
60
|
+
console.log(msg.bunRequired);
|
|
61
|
+
console.log(msg.bunNotFound);
|
|
62
|
+
console.log('');
|
|
63
|
+
console.log(msg.installBun);
|
|
64
|
+
|
|
65
|
+
// Detect platform for appropriate install command
|
|
66
|
+
const platform = process.platform;
|
|
67
|
+
if (platform === 'win32') {
|
|
68
|
+
console.log(`Windows: ${msg.windowsInstall}`);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
console.log(`Unix/Linux/macOS: ${msg.installCommand}`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
console.log('');
|
|
75
|
+
console.log(msg.afterInstall);
|
|
76
|
+
console.log(msg.versionCommand);
|
|
77
|
+
process.exit(1);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Bun is available, execute the main script
|
|
81
|
+
const mainScript = path.join(__dirname, '..', 'dist', 'main.js');
|
|
82
|
+
const args = process.argv.slice(2);
|
|
83
|
+
|
|
84
|
+
const child = spawn('bun', [mainScript, ...args], {
|
|
85
|
+
stdio: 'inherit',
|
|
86
|
+
cwd: process.cwd(),
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
child.on('exit', (code) => {
|
|
90
|
+
process.exit(code);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
child.on('error', (error) => {
|
|
94
|
+
console.error('Failed to start Bun:', error.message);
|
|
95
|
+
process.exit(1);
|
|
96
|
+
});
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trello-cli-unofficial",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.9.
|
|
4
|
+
"version": "0.9.4",
|
|
5
5
|
"private": false,
|
|
6
6
|
"description": "Unofficial Trello CLI using Power-Up authentication, built with Bun for maximum performance",
|
|
7
7
|
"author": "Matheus Caiser <matheus.kaiser@gmail.com> (https://www.mrdeveloper.com.br/)",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
],
|
|
27
27
|
"module": "main.ts",
|
|
28
28
|
"bin": {
|
|
29
|
-
"trello-cli-unofficial": "./
|
|
30
|
-
"tcu": "./
|
|
29
|
+
"trello-cli-unofficial": "./bin/cli.js",
|
|
30
|
+
"tcu": "./bin/cli.js"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"LICENSE",
|
|
39
39
|
"PAT_SETUP.md",
|
|
40
40
|
"README.md",
|
|
41
|
+
"bin",
|
|
41
42
|
"bun.lock",
|
|
42
43
|
"bunfig.toml",
|
|
43
44
|
"dist",
|
|
@@ -90,20 +90,65 @@ else {
|
|
|
90
90
|
console.log(msg.bunBenefit);
|
|
91
91
|
console.log('');
|
|
92
92
|
|
|
93
|
-
//
|
|
94
|
-
process.stdout.
|
|
93
|
+
// Check if we're in an interactive environment
|
|
94
|
+
const isInteractive = process.stdout.isTTY && process.stdin.isTTY;
|
|
95
|
+
const isCI = process.env.CI || process.env.CONTINUOUS_INTEGRATION;
|
|
96
|
+
|
|
97
|
+
if (!isInteractive || isCI) {
|
|
98
|
+
console.log(msg.nonInteractiveInstall);
|
|
99
|
+
console.log(msg.installing);
|
|
100
|
+
|
|
101
|
+
try {
|
|
102
|
+
// Auto-install Bun in non-interactive environments
|
|
103
|
+
const platform = os.platform();
|
|
104
|
+
let installCommand;
|
|
105
|
+
|
|
106
|
+
if (platform === 'win32') {
|
|
107
|
+
// Windows - use PowerShell (non-interactive)
|
|
108
|
+
installCommand = 'powershell -Command "try { irm bun.sh/install.ps1 | iex } catch { Write-Host \'Failed to install Bun. Please install manually from https://bun.sh\' }"';
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
// Unix-like systems (non-interactive)
|
|
112
|
+
installCommand = 'curl -fsSL https://bun.sh/install | bash || echo "Failed to install Bun. Please install manually from https://bun.sh"';
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
console.log(`Running: ${installCommand}`);
|
|
116
|
+
execSync(installCommand, { stdio: 'inherit', timeout: 30000 });
|
|
117
|
+
console.log(msg.installSuccess);
|
|
118
|
+
|
|
119
|
+
// Check if installation was successful
|
|
120
|
+
const newBunVersion = isBunInstalled();
|
|
121
|
+
if (newBunVersion) {
|
|
122
|
+
console.log(`${msg.version} ${newBunVersion}`);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
console.log('');
|
|
126
|
+
console.log(msg.success);
|
|
127
|
+
process.exit(0);
|
|
128
|
+
}
|
|
129
|
+
catch (error) {
|
|
130
|
+
console.log(msg.installFailed);
|
|
131
|
+
console.log('Please install Bun manually from https://bun.sh');
|
|
132
|
+
process.exit(1);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Interactive mode - ask user
|
|
137
|
+
console.log(msg.installPrompt);
|
|
95
138
|
|
|
96
|
-
|
|
97
|
-
|
|
139
|
+
// Use readline for cross-platform input
|
|
140
|
+
const readline = require('node:readline');
|
|
141
|
+
const rl = readline.createInterface({
|
|
142
|
+
input: process.stdin,
|
|
143
|
+
output: process.stdout,
|
|
144
|
+
});
|
|
98
145
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
process.stdin.pause();
|
|
146
|
+
rl.question('', (answer) => {
|
|
147
|
+
rl.close();
|
|
102
148
|
|
|
103
|
-
const
|
|
104
|
-
console.log(''); // New line after input
|
|
149
|
+
const normalizedAnswer = answer.toString().toLowerCase().trim();
|
|
105
150
|
|
|
106
|
-
if (
|
|
151
|
+
if (normalizedAnswer === 'y' || normalizedAnswer === 'yes' || normalizedAnswer === '') {
|
|
107
152
|
console.log(msg.installing);
|
|
108
153
|
|
|
109
154
|
try {
|
|
@@ -147,8 +192,8 @@ else {
|
|
|
147
192
|
console.log(msg.retry);
|
|
148
193
|
process.exit(1);
|
|
149
194
|
}
|
|
195
|
+
|
|
196
|
+
console.log('');
|
|
197
|
+
console.log(msg.success);
|
|
150
198
|
});
|
|
151
199
|
}
|
|
152
|
-
|
|
153
|
-
console.log('');
|
|
154
|
-
console.log(msg.success);
|
|
Binary file
|