trello-cli-unofficial 0.13.13 → 0.14.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 +14 -0
- package/README.md +21 -761
- package/dist/main.js +240 -8
- package/package.json +7 -2
- package/src/application/use-cases/AddChecklistItemUseCase.ts +15 -0
- package/src/application/use-cases/CreateChecklistUseCase.ts +15 -0
- package/src/application/use-cases/index.ts +2 -0
- package/src/domain/entities/Checklist.ts +65 -0
- package/src/domain/entities/index.ts +1 -0
- package/src/domain/repositories/TrelloRepository.ts +4 -0
- package/src/i18n/locales/en.json +31 -1
- package/src/i18n/locales/pt-BR.json +31 -1
- package/src/infrastructure/repositories/TrelloApiRepository.ts +53 -1
- package/src/presentation/cli/CardController.ts +22 -6
- package/src/presentation/cli/ChecklistController.ts +48 -0
- package/src/presentation/cli/CommandController.ts +45 -1
- package/src/presentation/cli/TrelloCliController.ts +1 -3
- package/src/presentation/cli/index.ts +1 -0
package/README.md
CHANGED
|
@@ -8,788 +8,48 @@
|
|
|
8
8
|
[](https://github.com/JaegerCaiser/trello-cli-unofficial/actions)
|
|
9
9
|
[](https://github.com/JaegerCaiser/trello-cli-unofficial/actions)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Um CLI não-oficial para Trello com autenticação Power-Up, feito em Bun e TypeScript. Permite gerenciar boards, lists e cards com saídas modernas e suporte a múltiplos perfis.
|
|
12
12
|
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
- ⚡ **Ultra-fast**: Built with Bun (10-50x faster than Node.js)
|
|
16
|
-
- 🔐 **Power-Up Authentication**: Compatible with Trello's newer authentication system
|
|
17
|
-
- 💾 **Persistent Configuration**: Automatically saves your token
|
|
18
|
-
- 🎯 **Interactive Interface**: Intuitive menu with interactive prompts
|
|
19
|
-
- 📋 **Complete Management**: Boards, lists, cards with detailed information
|
|
20
|
-
- ✏️ **CRUD Operations**: Create, read, update, and delete cards
|
|
21
|
-
- 📦 **Move Cards**: Between lists in the same board
|
|
22
|
-
- 👀 **Detailed Views**: Show comprehensive board and card details
|
|
23
|
-
- 📊 **Multiple Output Formats**: Table, JSON, CSV formats
|
|
24
|
-
- 🏷️ **Rich Metadata**: Labels, members, checklists, and attachments support
|
|
25
|
-
- 🛠️ **Traditional CLI**: Also works as a command-line tool
|
|
26
|
-
- 🌍 **Internationalization**: Support for Portuguese (pt-BR) and English (en) with auto-detection
|
|
27
|
-
- 🤖 **Automated CI/CD**: Semantic versioning and NPM publishing on every release
|
|
28
|
-
- 🧪 **Quality Gates**: 95% test coverage threshold enforced in CI/CD
|
|
29
|
-
- 🔐 **Secure Publishing**: NPM provenance with GitHub Actions OIDC
|
|
30
|
-
|
|
31
|
-
## 📦 Installation
|
|
32
|
-
|
|
33
|
-
### Prerequisites
|
|
34
|
-
|
|
35
|
-
- **[Node.js 16+](https://nodejs.org/) (Required)**
|
|
36
|
-
- **[Bun](https://bun.sh/) (Required)** - Deve ser instalado separadamente
|
|
37
|
-
- Trello account with Power-Up enabled
|
|
38
|
-
- **Supported Platforms:** Linux, macOS, Windows
|
|
39
|
-
|
|
40
|
-
### NPM Installation (Recommended)
|
|
41
|
-
|
|
42
|
-
O CLI requer Bun para funcionar. Instale-o primeiro:
|
|
13
|
+
## Quick Start
|
|
43
14
|
|
|
44
15
|
```bash
|
|
45
|
-
# 1. Instale o Bun primeiro
|
|
46
|
-
curl -fsSL https://bun.sh/install | bash
|
|
47
|
-
# ou no Windows: powershell -c "irm bun.sh/install.ps1 | iex"
|
|
48
|
-
|
|
49
|
-
# 2. Instale o CLI
|
|
50
16
|
npm install -g trello-cli-unofficial
|
|
51
|
-
|
|
52
|
-
# 3. Use
|
|
53
|
-
tcu --version
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
**Ready to use immediately!**
|
|
57
|
-
|
|
58
|
-
`tcu --version`
|
|
59
|
-
|
|
60
|
-
#### Windows Installation
|
|
61
|
-
|
|
62
|
-
Para usuários Windows, primeiro instale o Bun, depois o CLI:
|
|
63
|
-
|
|
64
|
-
```powershell
|
|
65
|
-
# 1. Instale o Bun
|
|
66
|
-
powershell -c "irm bun.sh/install.ps1 | iex"
|
|
67
|
-
|
|
68
|
-
# 2. Instale o CLI
|
|
69
|
-
npm install -g trello-cli-unofficial
|
|
70
|
-
|
|
71
|
-
# 3. Use
|
|
72
|
-
tcu --version
|
|
73
17
|
```
|
|
74
18
|
|
|
75
|
-
**Nota:** No Windows, você pode precisar reiniciar o terminal após instalar o Bun.
|
|
76
|
-
|
|
77
|
-
### Manual Installation (Development)
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
# Clone the repository
|
|
81
|
-
git clone https://github.com/JaegerCaiser/trello-cli-unofficial.git
|
|
82
|
-
cd trello-cli-unofficial
|
|
83
|
-
|
|
84
|
-
# Install dependencies
|
|
85
|
-
bun install
|
|
86
|
-
|
|
87
|
-
# Install globally (optional)
|
|
88
|
-
bun link
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## 🔧 Configuration
|
|
92
|
-
|
|
93
|
-
### First Run Setup
|
|
94
|
-
|
|
95
|
-
On first run, the CLI will guide you through setup:
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
# Run the CLI
|
|
99
|
-
tcu
|
|
100
|
-
|
|
101
|
-
# Or if running from source
|
|
102
|
-
bun run main.ts
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
The CLI will ask for your Trello token. To get it:
|
|
106
|
-
|
|
107
|
-
1. Go to [https://trello.com/power-ups/admin](https://trello.com/power-ups/admin)
|
|
108
|
-
2. Create a new Power-Up or use an existing one
|
|
109
|
-
3. Copy the "API Key" and generate a token
|
|
110
|
-
4. Paste the token when prompted (starts with `ATTA...`)
|
|
111
|
-
|
|
112
|
-
### Manual Configuration
|
|
113
|
-
|
|
114
19
|
```bash
|
|
115
|
-
# Configure token interactively
|
|
116
20
|
tcu setup
|
|
117
|
-
|
|
118
|
-
# View current configuration
|
|
119
|
-
tcu config
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### Configuration File
|
|
123
|
-
|
|
124
|
-
The token is automatically saved in `~/.trello-cli-unofficial/config.json`:
|
|
125
|
-
|
|
126
|
-
```json
|
|
127
|
-
{
|
|
128
|
-
"apiKey": "630a01228b85df706aa520f3611e6490",
|
|
129
|
-
"token": "ATTA..."
|
|
130
|
-
}
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### Environment Variables
|
|
134
|
-
|
|
135
|
-
You can configure the CLI using environment variables instead of the configuration file:
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
# Copy the example file
|
|
139
|
-
cp .env.example .env
|
|
140
|
-
|
|
141
|
-
# Edit with your credentials
|
|
142
|
-
nano .env
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Available environment variables:
|
|
146
|
-
|
|
147
|
-
- `TRELLO_API_KEY`: Your Trello API key (optional, defaults to built-in key)
|
|
148
|
-
- `TRELLO_TOKEN`: Your Trello token (optional, will be prompted if not set)
|
|
149
|
-
|
|
150
|
-
Example `.env` file:
|
|
151
|
-
|
|
152
|
-
```bash
|
|
153
|
-
# Trello CLI Unofficial - Environment Variables
|
|
154
|
-
TRELLO_TOKEN=ATTA...
|
|
155
|
-
TRELLO_API_KEY=your-custom-api-key
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
**Security Note**: Never commit your `.env` file to version control. The `.env.example` file contains safe defaults.
|
|
159
|
-
|
|
160
|
-
## Internationalization (i18n)
|
|
161
|
-
|
|
162
|
-
The CLI automatically detects your system language and displays messages in the appropriate language.
|
|
163
|
-
|
|
164
|
-
### Supported Languages
|
|
165
|
-
|
|
166
|
-
- 🇧🇷 **Portuguese (pt-BR)** - Default for Portuguese-speaking systems
|
|
167
|
-
- 🇺🇸 **English (en)** - Default for other systems
|
|
168
|
-
|
|
169
|
-
### Language Detection
|
|
170
|
-
|
|
171
|
-
The language is automatically detected from your system's `LANG` environment variable:
|
|
172
|
-
|
|
173
|
-
```bash
|
|
174
|
-
# Force Portuguese
|
|
175
|
-
LANG=pt_BR.UTF-8 tcu
|
|
176
|
-
|
|
177
|
-
# Force English
|
|
178
|
-
LANG=en_US.UTF-8 tcu
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### Manual Language Switching
|
|
182
|
-
|
|
183
|
-
```typescript
|
|
184
|
-
import { changeLanguage } from "trello-cli-unofficial";
|
|
185
|
-
|
|
186
|
-
// Switch to Portuguese
|
|
187
|
-
changeLanguage("pt-BR");
|
|
188
|
-
|
|
189
|
-
// Switch to English
|
|
190
|
-
changeLanguage("en");
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
## 📖 Usage
|
|
194
|
-
|
|
195
|
-
### Interactive Mode (Recommended)
|
|
196
|
-
|
|
197
|
-
```bash
|
|
198
|
-
# Start interactive mode
|
|
199
|
-
tcu
|
|
200
|
-
|
|
201
|
-
# Or the full command name
|
|
202
|
-
trello-cli-unofficial
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
Main menu options:
|
|
206
|
-
|
|
207
|
-
- 📋 View my boards
|
|
208
|
-
- 📝 Explore board
|
|
209
|
-
- ➕ Create card
|
|
210
|
-
- ⚙️ Settings
|
|
211
|
-
- 🚪 Exit
|
|
212
|
-
|
|
213
|
-
### Direct Commands
|
|
214
|
-
|
|
215
|
-
```bash
|
|
216
|
-
# View all boards
|
|
217
|
-
tcu boards list
|
|
218
|
-
|
|
219
|
-
# Show detailed board information
|
|
220
|
-
tcu boards show <boardId>
|
|
221
|
-
|
|
222
|
-
# View lists in a board
|
|
223
|
-
tcu lists list <boardId>
|
|
224
|
-
|
|
225
|
-
# View cards in a list
|
|
226
|
-
tcu cards list <listId>
|
|
227
|
-
|
|
228
|
-
# Show detailed card information
|
|
229
|
-
tcu cards show <cardId>
|
|
230
|
-
|
|
231
|
-
# Create a new card
|
|
232
|
-
tcu cards create <listId> <name> [--desc "description"]
|
|
233
|
-
|
|
234
|
-
# Update an existing card
|
|
235
|
-
tcu cards update <cardId> --name "new name" [--desc "new description"]
|
|
236
|
-
|
|
237
|
-
# Move a card to another list
|
|
238
|
-
tcu cards move <cardId> --to <listId>
|
|
239
|
-
|
|
240
|
-
# Delete a card
|
|
241
|
-
tcu cards delete <cardId>
|
|
242
|
-
|
|
243
|
-
# Start interactive mode
|
|
244
|
-
tcu interactive
|
|
245
|
-
|
|
246
|
-
# Configure token
|
|
247
|
-
tcu setup
|
|
248
|
-
|
|
249
|
-
# Show version
|
|
250
|
-
tcu --version
|
|
251
|
-
|
|
252
|
-
# Output format options (available for most commands)
|
|
253
|
-
tcu boards list --format json
|
|
254
|
-
tcu boards list --format csv
|
|
255
|
-
tcu boards list --format table # default
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
## 🏗️ Command Structure
|
|
259
|
-
|
|
260
|
-
The CLI uses a hierarchical subcommand structure for better organization:
|
|
261
|
-
|
|
262
|
-
```
|
|
263
|
-
tcu [command] [subcommand] [options] [arguments]
|
|
264
|
-
```
|
|
265
|
-
|
|
266
|
-
### Main Commands
|
|
267
|
-
|
|
268
|
-
- **`boards`** - Manage Trello boards
|
|
269
|
-
- `list` - List all boards
|
|
270
|
-
- `show <boardId>` - Show detailed board information
|
|
271
|
-
- `create <name>` - Create a new board
|
|
272
|
-
- `delete <boardId>` - Delete a board
|
|
273
|
-
|
|
274
|
-
- **`lists`** - Manage Trello lists
|
|
275
|
-
- `list <boardId>` - List all lists in a board
|
|
276
|
-
- `create <boardId> <name>` - Create a new list
|
|
277
|
-
- `delete <listId>` - Delete a list
|
|
278
|
-
- `move <listId> <position>` - Move list to new position
|
|
279
|
-
|
|
280
|
-
- **`cards`** - Manage Trello cards
|
|
281
|
-
- `list <listId>` - List all cards in a list
|
|
282
|
-
- `show <cardId>` - Show detailed card information
|
|
283
|
-
- `create <listId> <name>` - Create a new card
|
|
284
|
-
- `update <cardId>` - Update an existing card
|
|
285
|
-
- `move <cardId>` - Move card to another list
|
|
286
|
-
- `delete <cardId>` - Delete a card
|
|
287
|
-
|
|
288
|
-
- **`config`** - Configuration management
|
|
289
|
-
- `setup` - Configure Trello token
|
|
290
|
-
- `show` - Display current configuration
|
|
291
|
-
|
|
292
|
-
### Global Options
|
|
293
|
-
|
|
294
|
-
- `--format <format>` - Output format: `table` (default), `json`, `csv`
|
|
295
|
-
- `--help` - Show help for any command
|
|
296
|
-
- `--version` - Show CLI version
|
|
297
|
-
|
|
298
|
-
### Interactive Mode
|
|
299
|
-
|
|
300
|
-
```bash
|
|
301
|
-
# Start interactive menu
|
|
302
|
-
tcu
|
|
303
|
-
|
|
304
|
-
# Or explicitly
|
|
305
21
|
tcu interactive
|
|
306
22
|
```
|
|
307
23
|
|
|
308
|
-
##
|
|
309
|
-
|
|
310
|
-
### View Boards
|
|
311
|
-
|
|
312
|
-
```bash
|
|
313
|
-
# List all your boards
|
|
314
|
-
tcu boards list
|
|
315
|
-
|
|
316
|
-
# Show detailed information about a specific board
|
|
317
|
-
tcu boards show 60d5ecb74e2b8c3b8c8c8c8c
|
|
24
|
+
## Features
|
|
318
25
|
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
```
|
|
26
|
+
- 🚀 Modo interativo com menu guiado
|
|
27
|
+
- 📊 Saída em JSON, table e CSV
|
|
28
|
+
- 🌍 Suporte a i18n (pt-BR / en)
|
|
29
|
+
- 🔐 Autenticação Power-Up para Trello
|
|
30
|
+
- 👤 Suporte a múltiplos perfis e configuração persistente
|
|
325
31
|
|
|
326
|
-
|
|
32
|
+
## Commands
|
|
327
33
|
|
|
328
34
|
```bash
|
|
329
|
-
|
|
330
|
-
tcu lists list 60d5ecb74e2b8c3b8c8c8c8c
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
### Manage Cards
|
|
334
|
-
|
|
335
|
-
```bash
|
|
336
|
-
# List all cards in a list
|
|
337
|
-
tcu cards list 60d5ecb74e2b8c3b8c8c8c8d
|
|
338
|
-
|
|
339
|
-
# Show detailed information about a card
|
|
340
|
-
tcu cards show 60d5ecb74e2b8c3b8c8c8c8e
|
|
341
|
-
|
|
342
|
-
# Create a new card
|
|
343
|
-
tcu cards create 60d5ecb74e2b8c3b8c8c8c8d "Implement new feature" --desc "Add support for card templates"
|
|
344
|
-
|
|
345
|
-
# Update an existing card
|
|
346
|
-
tcu cards update 60d5ecb74e2b8c3b8c8c8c8e --name "Updated feature name" --desc "Updated description"
|
|
347
|
-
|
|
348
|
-
# Move a card to another list
|
|
349
|
-
tcu cards move 60d5ecb74e2b8c3b8c8c8c8e --to 60d5ecb74e2b8c3b8c8c8c8f
|
|
35
|
+
tcu boards
|
|
350
36
|
|
|
351
|
-
|
|
352
|
-
tcu cards delete 60d5ecb74e2b8c3b8c8c8c8e
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
### Create a Card
|
|
356
|
-
|
|
357
|
-
```bash
|
|
358
|
-
# Interactive mode
|
|
359
|
-
tcu
|
|
360
|
-
# Select "➕ Create card"
|
|
361
|
-
# Choose board → list → enter name and description
|
|
362
|
-
```
|
|
363
|
-
|
|
364
|
-
### Explore a Board
|
|
37
|
+
tcu lists
|
|
365
38
|
|
|
366
|
-
|
|
367
|
-
# Interactive mode
|
|
368
|
-
tcu
|
|
369
|
-
# Select "📝 Explore board"
|
|
370
|
-
# Choose board → list → see cards
|
|
371
|
-
# Optionally: edit, delete, or move cards
|
|
372
|
-
```
|
|
39
|
+
tcu cards
|
|
373
40
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
```bash
|
|
377
|
-
# Show detailed information about a card, including checklists, members, labels and attachments
|
|
378
|
-
tcu cards show <cardId>
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
### Output Formats
|
|
382
|
-
|
|
383
|
-
```bash
|
|
384
|
-
# Table format (default)
|
|
385
|
-
tcu boards list
|
|
386
|
-
|
|
387
|
-
# JSON format
|
|
388
|
-
tcu boards list --format json
|
|
389
|
-
|
|
390
|
-
# CSV format
|
|
391
|
-
tcu boards list --format csv
|
|
392
|
-
|
|
393
|
-
# All formats work with most commands
|
|
394
|
-
tcu cards list <listId> --format json
|
|
395
|
-
tcu lists list <boardId> --format csv
|
|
396
|
-
```
|
|
397
|
-
|
|
398
|
-
## 🔄 Backward Compatibility
|
|
399
|
-
|
|
400
|
-
### Legacy Command Support
|
|
401
|
-
|
|
402
|
-
During the transition period, the CLI maintains backward compatibility with older command formats. These legacy commands will show deprecation warnings but continue to work:
|
|
403
|
-
|
|
404
|
-
```bash
|
|
405
|
-
# Legacy commands (show deprecation warnings)
|
|
406
|
-
tcu boards # → Use "tcu boards list" instead
|
|
407
|
-
tcu lists legacy <boardName> # → Use "tcu lists list <boardId>" instead
|
|
408
|
-
tcu cards legacy <boardName> <listName> # → Use "tcu cards list <listId>" instead
|
|
409
|
-
|
|
410
|
-
# Legacy card management commands
|
|
411
|
-
tcu create-card <boardName> <listName> <cardName>
|
|
412
|
-
tcu move-card <cardId> <listName>
|
|
413
|
-
tcu delete-card <cardId>
|
|
414
|
-
```
|
|
415
|
-
|
|
416
|
-
### Migration Guide
|
|
417
|
-
|
|
418
|
-
| Old Command | New Command | Status |
|
|
419
|
-
|-------------|-------------|--------|
|
|
420
|
-
| `tcu boards` | `tcu boards list` | ⚠️ Deprecated |
|
|
421
|
-
| `tcu lists <boardName>` | `tcu lists list <boardId>` | ⚠️ Deprecated |
|
|
422
|
-
| `tcu cards <boardName> <listName>` | `tcu cards list <listId>` | ⚠️ Deprecated |
|
|
423
|
-
| `tcu create-card <boardName> <listName> <name>` | `tcu cards create <listId> <name>` | ⚠️ Deprecated |
|
|
424
|
-
| `tcu move-card <cardId> <listName>` | `tcu cards move <cardId> --to <listId>` | ⚠️ Deprecated |
|
|
425
|
-
| `tcu delete-card <cardId>` | `tcu cards delete <cardId>` | ⚠️ Deprecated |
|
|
426
|
-
|
|
427
|
-
**Migration Timeline:**
|
|
428
|
-
- **Current:** Legacy commands work with deprecation warnings
|
|
429
|
-
- **Future:** Legacy commands will be removed (TBD)
|
|
430
|
-
|
|
431
|
-
### Why the Changes?
|
|
432
|
-
|
|
433
|
-
The new command structure provides:
|
|
434
|
-
- **Better organization** with hierarchical subcommands
|
|
435
|
-
- **Improved discoverability** with `tcu <command> --help`
|
|
436
|
-
- **Consistency** with modern CLI patterns
|
|
437
|
-
- **Future extensibility** for additional subcommands
|
|
438
|
-
|
|
439
|
-
## 🤖 CI/CD & Automation
|
|
440
|
-
|
|
441
|
-
This project uses automated CI/CD with semantic versioning based on **commit messages**:
|
|
442
|
-
|
|
443
|
-
### Version Bumping
|
|
444
|
-
|
|
445
|
-
- `feat:` commits → **Minor version bump** (0.5.0 → 0.6.0)
|
|
446
|
-
- `fix:` commits → **Patch version bump** (0.5.0 → 0.5.1)
|
|
447
|
-
- `BREAKING CHANGE:` in commit body → **Major version bump** (0.5.0 → 1.0.0)
|
|
448
|
-
- Other commits (docs, test, chore) → **No release**
|
|
449
|
-
|
|
450
|
-
### Automated Publishing
|
|
451
|
-
|
|
452
|
-
Every push to `main` branch triggers:
|
|
453
|
-
|
|
454
|
-
1. **CI Pipeline**: Linting, type checking, tests, coverage, and build
|
|
455
|
-
2. **Release Pipeline**: Automatic version bump based on commit message
|
|
456
|
-
3. **NPM Publishing**: Package published with provenance and signed builds
|
|
457
|
-
4. **GitHub Release**: Automatic release notes and changelog
|
|
458
|
-
|
|
459
|
-
### Conventional Commits
|
|
460
|
-
|
|
461
|
-
```bash
|
|
462
|
-
# Feature commit (minor version bump)
|
|
463
|
-
git commit -m "feat: add new card templates"
|
|
464
|
-
|
|
465
|
-
# Bug fix (patch version bump)
|
|
466
|
-
git commit -m "fix: handle network timeouts gracefully"
|
|
467
|
-
|
|
468
|
-
# Breaking change (major version bump) - Method 1
|
|
469
|
-
git commit -m "feat!: redesign authentication flow"
|
|
470
|
-
|
|
471
|
-
# Breaking change (major version bump) - Method 2
|
|
472
|
-
git commit -m "feat: redesign authentication flow
|
|
473
|
-
|
|
474
|
-
BREAKING CHANGE: token format changed from legacy API to Power-Up"
|
|
475
|
-
|
|
476
|
-
# Non-releasing commits
|
|
477
|
-
git commit -m "docs: update installation guide"
|
|
478
|
-
git commit -m "test: add integration tests"
|
|
479
|
-
git commit -m "chore: update dependencies"
|
|
480
|
-
```
|
|
481
|
-
|
|
482
|
-
**Important:** Version bumps are **automatic** and based on the **commit message when merged to main**, not PR titles or descriptions.
|
|
483
|
-
|
|
484
|
-
## 🛠️ Development
|
|
485
|
-
|
|
486
|
-
### Project Structure
|
|
487
|
-
|
|
488
|
-
```
|
|
489
|
-
trello-cli-unofficial/
|
|
490
|
-
├── src/
|
|
491
|
-
│ ├── domain/ # Business logic & entities
|
|
492
|
-
│ ├── application/ # Use cases & orchestration
|
|
493
|
-
│ ├── infrastructure/ # External implementations
|
|
494
|
-
│ └── presentation/ # CLI controllers & UI
|
|
495
|
-
├── tests/ # Test suite (57 tests)
|
|
496
|
-
├── .github/workflows/ # CI/CD pipelines
|
|
497
|
-
├── main.ts # Entry point
|
|
498
|
-
├── package.json # Dependencies & scripts
|
|
499
|
-
└── README.md # This documentation
|
|
500
|
-
```
|
|
501
|
-
|
|
502
|
-
### Dependencies
|
|
503
|
-
|
|
504
|
-
- `commander`: CLI framework
|
|
505
|
-
- `inquirer`: Interactive prompts
|
|
506
|
-
- `fs-extra`: File operations
|
|
507
|
-
- `dotenv`: Environment variables
|
|
508
|
-
|
|
509
|
-
### Available Scripts
|
|
510
|
-
|
|
511
|
-
```bash
|
|
512
|
-
# Run locally
|
|
513
|
-
bun run main.ts
|
|
514
|
-
|
|
515
|
-
# Development with watch mode
|
|
516
|
-
bun run --watch main.ts
|
|
517
|
-
|
|
518
|
-
# Build for production
|
|
519
|
-
bun run build
|
|
520
|
-
|
|
521
|
-
# Run tests
|
|
522
|
-
bun test
|
|
523
|
-
|
|
524
|
-
# Run tests with coverage
|
|
525
|
-
bun test:coverage
|
|
526
|
-
|
|
527
|
-
# Validation (lint + typecheck + test)
|
|
528
|
-
bun run validate
|
|
529
|
-
|
|
530
|
-
# Type checking only
|
|
531
|
-
bun run typecheck
|
|
532
|
-
|
|
533
|
-
# Linting only
|
|
534
|
-
bun run lint
|
|
535
|
-
```
|
|
536
|
-
|
|
537
|
-
## 🔧 Architecture & Extensibility
|
|
538
|
-
|
|
539
|
-
### Domain-Driven Design Structure
|
|
540
|
-
|
|
541
|
-
The CLI follows Domain-Driven Design principles with clear separation of concerns:
|
|
542
|
-
|
|
543
|
-
```
|
|
544
|
-
src/
|
|
545
|
-
├── domain/ # Business logic & entities
|
|
546
|
-
│ ├── entities/ # Board, List, Card entities
|
|
547
|
-
│ ├── repositories/ # Repository interfaces
|
|
548
|
-
│ └── services/ # Domain services (Authentication)
|
|
549
|
-
├── application/ # Use cases & business logic
|
|
550
|
-
│ └── use-cases/ # Business operations
|
|
551
|
-
├── infrastructure/ # External implementations
|
|
552
|
-
│ ├── repositories/ # Trello API, File system implementations
|
|
553
|
-
│ └── external/ # External service integrations
|
|
554
|
-
├── presentation/ # CLI interface layer
|
|
555
|
-
│ └── cli/ # Command controllers & UI
|
|
556
|
-
└── shared/ # Cross-cutting concerns
|
|
557
|
-
├── ErrorHandler.ts
|
|
558
|
-
├── OutputFormatter.ts
|
|
559
|
-
└── types.ts
|
|
560
|
-
```
|
|
561
|
-
|
|
562
|
-
### Adding New Commands
|
|
563
|
-
|
|
564
|
-
To extend the CLI with new functionality:
|
|
565
|
-
|
|
566
|
-
1. **Create a Use Case** in `src/application/use-cases/`
|
|
567
|
-
2. **Implement Repository Interface** if needed
|
|
568
|
-
3. **Add Controller Method** in appropriate CLI controller
|
|
569
|
-
4. **Register Command** in `CommandController.ts`
|
|
570
|
-
5. **Add Tests** following the existing pattern
|
|
571
|
-
|
|
572
|
-
### Output Formatters
|
|
573
|
-
|
|
574
|
-
The CLI supports multiple output formats through the `OutputFormatter` class:
|
|
575
|
-
|
|
576
|
-
- **Table**: Human-readable tabular output (default)
|
|
577
|
-
- **JSON**: Machine-readable structured data
|
|
578
|
-
- **CSV**: Spreadsheet-compatible format
|
|
579
|
-
|
|
580
|
-
All formatters handle complex nested data structures automatically.
|
|
581
|
-
|
|
582
|
-
## 🧪 Cross-Platform Development Testing
|
|
583
|
-
|
|
584
|
-
This project includes tools for testing cross-platform compatibility during development:
|
|
585
|
-
|
|
586
|
-
### Quick Cross-Platform Test
|
|
587
|
-
|
|
588
|
-
```bash
|
|
589
|
-
# Run comprehensive cross-platform tests
|
|
590
|
-
bun run test:cross-platform
|
|
591
|
-
|
|
592
|
-
# This will test:
|
|
593
|
-
# ✅ Build process
|
|
594
|
-
# ✅ Installation process
|
|
595
|
-
# ✅ CLI functionality (--version, --help)
|
|
596
|
-
# ✅ File system operations
|
|
597
|
-
# ✅ Environment variable handling
|
|
598
|
-
# ✅ Platform-specific features
|
|
599
|
-
```
|
|
600
|
-
|
|
601
|
-
### Individual Test Commands
|
|
602
|
-
|
|
603
|
-
```bash
|
|
604
|
-
# Test build process only
|
|
605
|
-
bun run test:build
|
|
606
|
-
|
|
607
|
-
# Test installation process
|
|
608
|
-
bun run test:install
|
|
609
|
-
|
|
610
|
-
# Quick smoke tests
|
|
611
|
-
bun run test:smoke
|
|
612
|
-
```
|
|
613
|
-
|
|
614
|
-
### Docker-Based Cross-Platform Testing
|
|
615
|
-
|
|
616
|
-
For comprehensive testing across platforms, use Docker containers:
|
|
617
|
-
|
|
618
|
-
```bash
|
|
619
|
-
# Test on all platforms (Linux + Windows when available)
|
|
620
|
-
npm run test:docker
|
|
621
|
-
|
|
622
|
-
# Test specific platforms
|
|
623
|
-
npm run test:docker:ubuntu # Ubuntu Linux
|
|
624
|
-
npm run test:docker:alpine # Alpine Linux
|
|
625
|
-
npm run test:docker:windows # Windows (requires Windows host or WSL2)
|
|
626
|
-
```
|
|
627
|
-
|
|
628
|
-
**Platform Support:**
|
|
629
|
-
- ✅ **Linux**: Ubuntu 22.04, Ubuntu 20.04, Alpine Linux
|
|
630
|
-
- ✅ **Windows**: Windows Server Core 2022 (via Docker Desktop)
|
|
631
|
-
- ✅ **macOS**: Tested via GitHub Actions CI/CD
|
|
632
|
-
|
|
633
|
-
**Requirements:**
|
|
634
|
-
- Docker Desktop installed
|
|
635
|
-
- 4GB+ RAM allocated to Docker
|
|
636
|
-
- For Windows containers: Windows 10/11 Pro+ or WSL2
|
|
637
|
-
|
|
638
|
-
See [`WINDOWS_TESTING.md`](./WINDOWS_TESTING.md) for detailed Windows setup instructions.
|
|
639
|
-
|
|
640
|
-
### Manual Windows Testing Checklist
|
|
641
|
-
|
|
642
|
-
When testing on Windows, verify these scenarios:
|
|
643
|
-
|
|
644
|
-
1. **Installation Methods:**
|
|
645
|
-
```powershell
|
|
646
|
-
# Method 1: NPM global install
|
|
647
|
-
npm install -g trello-cli-unofficial
|
|
648
|
-
|
|
649
|
-
# Method 2: From source
|
|
650
|
-
bun install
|
|
651
|
-
bun link # or bun run install-global
|
|
652
|
-
```
|
|
653
|
-
|
|
654
|
-
2. **Command Availability:**
|
|
655
|
-
```powershell
|
|
656
|
-
# Test both command names
|
|
657
|
-
tcu --version
|
|
658
|
-
trello-cli-unofficial --version
|
|
659
|
-
|
|
660
|
-
# Test in different terminals
|
|
661
|
-
# - Command Prompt (cmd)
|
|
662
|
-
# - PowerShell
|
|
663
|
-
# - Windows Terminal
|
|
664
|
-
```
|
|
665
|
-
|
|
666
|
-
3. **PATH Configuration:**
|
|
667
|
-
```powershell
|
|
668
|
-
# Check if commands are in PATH
|
|
669
|
-
where tcu
|
|
670
|
-
where trello-cli-unofficial
|
|
671
|
-
|
|
672
|
-
# Refresh environment (PowerShell)
|
|
673
|
-
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
|
|
674
|
-
```
|
|
675
|
-
|
|
676
|
-
4. **File System Operations:**
|
|
677
|
-
- Config directory creation: `%USERPROFILE%\.trello-cli-unofficial\`
|
|
678
|
-
- File read/write permissions
|
|
679
|
-
- Path separator handling (`\` vs `/`)
|
|
680
|
-
|
|
681
|
-
5. **Environment Variables:**
|
|
682
|
-
- `TRELLO_TOKEN` handling
|
|
683
|
-
- Language detection (`LANG`, `LC_ALL`, etc.)
|
|
684
|
-
- Node.js/Bun path resolution
|
|
685
|
-
|
|
686
|
-
### Common Windows Issues & Solutions
|
|
687
|
-
|
|
688
|
-
| Issue | Symptom | Solution |
|
|
689
|
-
|-------|---------|----------|
|
|
690
|
-
| PATH not updated | `tcu command not found` | Restart terminal or run `refreshenv` |
|
|
691
|
-
| Permission denied | Installation fails | Run as Administrator |
|
|
692
|
-
| Antivirus blocking | Installation interrupted | Temporarily disable or whitelist |
|
|
693
|
-
| Node version conflicts | Runtime errors | Use Node 18+ or Bun 1.0+ |
|
|
694
|
-
|
|
695
|
-
## 🔒 Security
|
|
696
|
-
|
|
697
|
-
- Token saved locally in protected file (`~/.trello-cli-unofficial/config.json`)
|
|
698
|
-
- No data sent to external servers
|
|
699
|
-
- Uses HTTPS for all Trello API communications
|
|
700
|
-
- Compatible with Trello's Power-Up authentication
|
|
701
|
-
- NPM packages published with provenance attestation
|
|
702
|
-
|
|
703
|
-
## 🐛 Troubleshooting
|
|
704
|
-
|
|
705
|
-
### 401 Unauthorized Error
|
|
706
|
-
|
|
707
|
-
- Verify the token is correct and starts with `ATTA`
|
|
708
|
-
- Confirm the Power-Up has necessary permissions
|
|
709
|
-
- Try generating a new token from [trello.com/power-ups/admin](https://trello.com/power-ups/admin)
|
|
710
|
-
|
|
711
|
-
### Network Error
|
|
712
|
-
|
|
713
|
-
- Check your internet connection
|
|
714
|
-
- Confirm `api.trello.com` is accessible
|
|
715
|
-
- Try again in a few minutes
|
|
716
|
-
|
|
717
|
-
### Configuration Not Saving
|
|
718
|
-
|
|
719
|
-
- Check write permissions in `~/.trello-cli-unofficial/`
|
|
720
|
-
- Run as user with appropriate permissions
|
|
721
|
-
- Try running `tcu setup` again
|
|
722
|
-
|
|
723
|
-
### Installation Issues
|
|
724
|
-
|
|
725
|
-
- **Runtime Required:** Ensure Bun or Node.js 16+ is installed
|
|
726
|
-
- **Package Manager Fallback:** Try `npm install -g trello-cli-unofficial` if Bun fails
|
|
727
|
-
- **PATH Issues:** Check that `tcu` command is in your PATH
|
|
728
|
-
- **Permission Issues:** Try running as administrator/sudo
|
|
729
|
-
|
|
730
|
-
#### Windows-specific Issues
|
|
731
|
-
|
|
732
|
-
- **PATH not updated:** Restart your terminal or run `refreshenv` in PowerShell
|
|
733
|
-
- **Permission errors:** Run PowerShell/Command Prompt as Administrator
|
|
734
|
-
- **Node.js version:** Ensure you have Node.js 16+ or Bun 1.0+
|
|
735
|
-
- **Antivirus blocking:** Some antivirus software may block global NPM installations
|
|
736
|
-
|
|
737
|
-
## 🤝 Contributing
|
|
738
|
-
|
|
739
|
-
Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) before submitting PRs.
|
|
740
|
-
|
|
741
|
-
1. Fork the project
|
|
742
|
-
2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
|
|
743
|
-
3. Commit your changes using conventional commits (`git commit -m 'feat: add some amazing feature'`)
|
|
744
|
-
4. Run the tests (`bun run validate`)
|
|
745
|
-
5. Push to the branch (`git push origin feature/AmazingFeature`)
|
|
746
|
-
6. Open a Pull Request
|
|
747
|
-
|
|
748
|
-
### Development Setup
|
|
749
|
-
|
|
750
|
-
```bash
|
|
751
|
-
# Clone and setup
|
|
752
|
-
git clone https://github.com/JaegerCaiser/trello-cli-unofficial.git
|
|
753
|
-
cd trello-cli-unofficial
|
|
754
|
-
bun install
|
|
755
|
-
|
|
756
|
-
# Run tests
|
|
757
|
-
bun test
|
|
758
|
-
|
|
759
|
-
# Start development
|
|
760
|
-
bun run --watch main.ts
|
|
41
|
+
tcu config
|
|
761
42
|
```
|
|
762
43
|
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
766
|
-
|
|
767
|
-
## 🙏 Acknowledgments
|
|
768
|
-
|
|
769
|
-
- [Trello API](https://developer.atlassian.com/cloud/trello/) - Official Trello REST API
|
|
770
|
-
- [Bun](https://bun.sh/) - Ultra-fast JavaScript runtime
|
|
771
|
-
- [Inquirer](https://github.com/SBoudrias/Inquirer.js) - Interactive command-line interface
|
|
772
|
-
- [Commander](https://github.com/tj/commander.js) - CLI framework for Node.js
|
|
773
|
-
- [GitHub Actions](https://github.com/features/actions) - CI/CD automation
|
|
774
|
-
|
|
775
|
-
## 📊 Project Status
|
|
776
|
-
|
|
777
|
-
- 🚀 195 tests passing (100% coverage)
|
|
778
|
-
- 📦 Clean Domain-Driven Design architecture
|
|
779
|
-
- 🎨 ESLint + TypeScript strict mode
|
|
780
|
-
- ⚡ Performance optimized with Bun
|
|
781
|
-
- 🤖 Automated CI/CD with semantic versioning
|
|
782
|
-
- 🔒 Secure publishing with NPM provenance
|
|
783
|
-
- 🌍 Internationalization (pt-BR/en)
|
|
784
|
-
- 📊 Multiple output formats (table/json/csv)
|
|
785
|
-
- 🏗️ Hierarchical command structure
|
|
786
|
-
|
|
787
|
-
---
|
|
44
|
+
*Para ver todos os parâmetros e opções, execute `tcu <comando> --help` no seu terminal.*
|
|
788
45
|
|
|
789
|
-
|
|
46
|
+
## 📚 Documentação Completa
|
|
790
47
|
|
|
791
|
-
|
|
48
|
+
- [./docs/commands.md](./docs/commands.md)
|
|
49
|
+
- [./docs/architecture.md](./docs/architecture.md)
|
|
50
|
+
- [./docs/migration-guide.md](./docs/migration-guide.md)
|
|
51
|
+
- [./docs/troubleshooting.md](./docs/troubleshooting.md)
|
|
792
52
|
|
|
793
|
-
|
|
53
|
+
## Contribuição
|
|
794
54
|
|
|
795
|
-
|
|
55
|
+
Quer ajudar a melhorar o projeto? Veja nosso [Guia de Contribuição](CONTRIBUTING.md).
|