trello-cli-unofficial 0.1.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.
Files changed (41) hide show
  1. package/.eslintignore +26 -0
  2. package/CHANGELOG.md +48 -0
  3. package/LICENSE +21 -0
  4. package/README.md +261 -0
  5. package/bun.lock +788 -0
  6. package/dist/main.js +27751 -0
  7. package/install.sh +45 -0
  8. package/main.ts +19 -0
  9. package/package.json +75 -0
  10. package/src/application/index.ts +1 -0
  11. package/src/application/use-cases/AuthenticateUserUseCase.ts +47 -0
  12. package/src/application/use-cases/CreateCardUseCase.ts +14 -0
  13. package/src/application/use-cases/DeleteCardUseCase.ts +9 -0
  14. package/src/application/use-cases/GetBoardsUseCase.ts +10 -0
  15. package/src/application/use-cases/GetCardsUseCase.ts +10 -0
  16. package/src/application/use-cases/GetListsUseCase.ts +10 -0
  17. package/src/application/use-cases/MoveCardUseCase.ts +10 -0
  18. package/src/application/use-cases/UpdateCardUseCase.ts +17 -0
  19. package/src/application/use-cases/index.ts +8 -0
  20. package/src/domain/entities/Board.ts +17 -0
  21. package/src/domain/entities/Card.ts +53 -0
  22. package/src/domain/entities/Config.ts +20 -0
  23. package/src/domain/entities/List.ts +12 -0
  24. package/src/domain/entities/index.ts +4 -0
  25. package/src/domain/index.ts +3 -0
  26. package/src/domain/repositories/ConfigRepository.ts +6 -0
  27. package/src/domain/repositories/TrelloRepository.ts +11 -0
  28. package/src/domain/repositories/index.ts +2 -0
  29. package/src/domain/services/AuthenticationService.ts +26 -0
  30. package/src/domain/services/index.ts +1 -0
  31. package/src/index.ts +5 -0
  32. package/src/infrastructure/index.ts +1 -0
  33. package/src/infrastructure/repositories/FileConfigRepository.ts +51 -0
  34. package/src/infrastructure/repositories/TrelloApiRepository.ts +93 -0
  35. package/src/infrastructure/repositories/index.ts +2 -0
  36. package/src/presentation/cli/CommandController.ts +59 -0
  37. package/src/presentation/cli/TrelloCliController.ts +408 -0
  38. package/src/presentation/cli/index.ts +2 -0
  39. package/src/presentation/index.ts +1 -0
  40. package/src/shared/index.ts +1 -0
  41. package/src/shared/types.ts +31 -0
package/.eslintignore ADDED
@@ -0,0 +1,26 @@
1
+ # Dependencies
2
+ node_modules/
3
+ bun.lock
4
+
5
+ # Build outputs
6
+ dist/
7
+ *.tsbuildinfo
8
+
9
+ # Config files backup
10
+ *.backup
11
+
12
+ # Environment
13
+ .env
14
+ .env.*
15
+
16
+ # IDE
17
+ .vscode/
18
+ .idea/
19
+
20
+ # OS
21
+ .DS_Store
22
+ Thumbs.db
23
+
24
+ # Coverage
25
+ coverage/
26
+ *.lcov
package/CHANGELOG.md ADDED
@@ -0,0 +1,48 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Planned
11
+
12
+ - Enhanced error handling and user feedback
13
+ - Configuration export/import functionality
14
+ - Support for additional Trello features (labels, due dates, checklists)
15
+ - Integration tests with real Trello API
16
+
17
+ ## [0.1.0] - 2025-11-08
18
+
19
+ ### Added
20
+
21
+ - 🎉 Initial release of Trello CLI Unofficial
22
+ - ⚡ Built with Bun for maximum performance (10-50x faster than Node.js)
23
+ - 🏗️ Clean Domain-Driven Design (DDD) architecture
24
+ - 🔐 Trello Power-Up authentication system
25
+ - 📋 Interactive CLI with inquirer menus
26
+ - 🛠️ Direct command support with commander
27
+ - ✅ Comprehensive test suite (57 tests, 100% pass rate)
28
+ - 🎨 ESLint integration with @antfu/eslint-config
29
+ - 📦 Dual command aliases: `trello-cli-unofficial` and `tcu`
30
+
31
+ ### Core Features
32
+
33
+ - View all Trello boards
34
+ - Explore boards and lists
35
+ - Create, edit, and delete cards
36
+ - Move cards between lists
37
+ - Persistent configuration in `~/.trello-cli-unofficial/config.json`
38
+
39
+ ### Developer Experience
40
+
41
+ - TypeScript with strict mode
42
+ - Bun test runner (30ms execution time)
43
+ - Hot reload development mode
44
+ - CI validation pipeline (lint + typecheck + test)
45
+ - Comprehensive documentation for AI agents
46
+
47
+ [Unreleased]: https://github.com/JaegerCaiser/trello-cli-unofficial/compare/v0.1.0...HEAD
48
+ [0.1.0]: https://github.com/JaegerCaiser/trello-cli-unofficial/releases/tag/v0.1.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Matheus Caiser
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,261 @@
1
+ # Trello CLI Unofficial
2
+
3
+ [![npm version](https://img.shields.io/npm/v/trello-cli-unofficial.svg)](https://www.npmjs.com/package/trello-cli-unofficial)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+ [![Bun](https://img.shields.io/badge/Bun-%23000000.svg?style=flat&logo=bun&logoColor=white)](https://bun.sh)
6
+ [![TypeScript](https://img.shields.io/badge/TypeScript-%23007ACC.svg?style=flat&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
7
+ [![Tests](https://img.shields.io/badge/tests-57%20passing-brightgreen.svg)](./tests)
8
+
9
+ An unofficial Trello CLI using Power-Up authentication, built with Bun for maximum performance.
10
+
11
+ ## 🚀 Features
12
+
13
+ - ⚡ **Ultra-fast**: Built with Bun (10-50x faster than Node.js)
14
+ - 🔐 **Power-Up Authentication**: Compatible with Trello's newer authentication system
15
+ - 💾 **Persistent Configuration**: Automatically saves your token
16
+ - 🎯 **Interactive Interface**: Intuitive menu with interactive prompts
17
+ - 📋 **Complete Management**: Boards, lists, cards
18
+ - ✏️ **CRUD Operations**: Create, read, update, and delete cards
19
+ - 📦 **Move Cards**: Between lists in the same board
20
+ - 🛠️ **Traditional CLI**: Also works as a command-line tool
21
+
22
+ ## 📦 Installation
23
+
24
+ ### Prerequisites
25
+
26
+ - [Bun](https://bun.sh/) installed
27
+ - Trello account with Power-Up enabled
28
+
29
+ ### Global Installation (Recommended)
30
+
31
+ ```bash
32
+ # Clone the repository
33
+ git clone https://github.com/JaegerCaiser/trello-cli-unofficial.git
34
+ cd trello-cli-unofficial
35
+
36
+ # Install dependencies
37
+ bun install
38
+
39
+ # Install globally (optional)
40
+ bun link
41
+ ```
42
+
43
+ ### Local Installation
44
+
45
+ ```bash
46
+ # Clone and install
47
+ git clone https://github.com/JaegerCaiser/trello-cli-unofficial.git
48
+ cd trello-cli-unofficial
49
+ bun install
50
+ ```
51
+
52
+ ## 🔧 Configuration
53
+
54
+ ### First Run
55
+
56
+ On first run, the CLI will guide you through setup:
57
+
58
+ ```bash
59
+ # Run the CLI
60
+ bun run main.ts
61
+
62
+ # Or if installed globally
63
+ trello-cli-unofficial
64
+ # or use the shortcut:
65
+ tcu
66
+ ```
67
+
68
+ The CLI will ask for your Trello token. To get it:
69
+
70
+ 1. Go to [https://trello.com/power-ups/admin](https://trello.com/power-ups/admin)
71
+ 2. Create a new Power-Up or use an existing one
72
+ 3. Copy the "API Key" and generate a token
73
+ 4. Paste the token when prompted (starts with `ATTA...`)
74
+
75
+ ### Manual Configuration
76
+
77
+ ```bash
78
+ # Configure token
79
+ tcu setup
80
+
81
+ # View current configuration
82
+ tcu config
83
+ ```
84
+
85
+ ### Configuration File
86
+
87
+ The token is automatically saved in `~/.trello-cli-unofficial/config.json`:
88
+
89
+ ```json
90
+ {
91
+ "apiKey": "630a01228b85df706aa520f3611e6490",
92
+ "token": "ATTA..."
93
+ }
94
+ ```
95
+
96
+ ## 🎮 Usage
97
+
98
+ ### Interactive Mode (Recommended)
99
+
100
+ ```bash
101
+ # With global installation
102
+ tcu
103
+
104
+ # Or directly
105
+ bun run main.ts
106
+ ```
107
+
108
+ Main menu options:
109
+
110
+ - 📋 View my boards
111
+ - 📝 Explore board
112
+ - ➕ Create card
113
+ - ⚙️ Settings
114
+ - 🚪 Exit
115
+
116
+ ### Direct Commands
117
+
118
+ ```bash
119
+ # View boards
120
+ tcu boards
121
+
122
+ # Interactive mode
123
+ tcu interactive
124
+
125
+ # Configure token
126
+ tcu setup
127
+ ```
128
+
129
+ ## 📚 Usage Examples
130
+
131
+ ### Create a Card
132
+
133
+ ```bash
134
+ # Interactive mode
135
+ tcu
136
+ # Select "➕ Create card"
137
+ # Choose board → list → enter name and description
138
+ ```
139
+
140
+ ### Explore a Board
141
+
142
+ ```bash
143
+ # Interactive mode
144
+ tcu
145
+ # Select "📝 Explore board"
146
+ # Choose board → list → see cards
147
+ # Optionally: edit, delete, or move cards
148
+ ```
149
+
150
+ ### Manage Cards
151
+
152
+ - **Edit**: Change name and description
153
+ - **Delete**: Confirm before removing
154
+ - **Move**: Select destination list
155
+
156
+ ## 🛠️ Development
157
+
158
+ ### Project Structure
159
+
160
+ ```
161
+ trello-cli-unofficial/
162
+ ├── src/
163
+ │ ├── domain/ # Business logic & entities
164
+ │ ├── application/ # Use cases
165
+ │ ├── infrastructure/ # External implementations
166
+ │ └── presentation/ # CLI controllers
167
+ ├── tests/ # Test suite
168
+ ├── main.ts # Entry point
169
+ ├── package.json # Dependencies
170
+ └── README.md # This documentation
171
+ ```
172
+
173
+ ### Dependencies
174
+
175
+ - `commander`: CLI framework
176
+ - `inquirer`: Interactive prompts
177
+ - `fs-extra`: File operations
178
+ - `dotenv`: Environment variables
179
+
180
+ ### Available Scripts
181
+
182
+ ```bash
183
+ # Run
184
+ bun run main.ts
185
+
186
+ # Development
187
+ bun run dev
188
+
189
+ # Build
190
+ bun run build
191
+
192
+ # Tests
193
+ bun test
194
+
195
+ # Validation (lint + typecheck + test)
196
+ bun run validate
197
+ ```
198
+
199
+ ## 🔒 Security
200
+
201
+ - Token saved locally in protected file
202
+ - No data sent to external servers
203
+ - Uses HTTPS for all Trello communications
204
+ - Compatible with Trello's Power-Up authentication
205
+
206
+ ## 🐛 Troubleshooting
207
+
208
+ ### 401 Unauthorized Error
209
+
210
+ - Verify the token is correct
211
+ - Confirm the Power-Up has necessary permissions
212
+ - Try generating a new token
213
+
214
+ ### Network Error
215
+
216
+ - Check your internet connection
217
+ - Confirm api.trello.com is accessible
218
+
219
+ ### Configuration Not Saving
220
+
221
+ - Check write permissions in `~/.trello-cli-unofficial/`
222
+ - Run as user with appropriate permissions
223
+
224
+ ## 🤝 Contributing
225
+
226
+ Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) before submitting PRs.
227
+
228
+ 1. Fork the project
229
+ 2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
230
+ 3. Commit your changes (`git commit -m 'feat: add some amazing feature'`)
231
+ 4. Run the tests (`bun run validate`)
232
+ 5. Push to the branch (`git push origin feature/AmazingFeature`)
233
+ 6. Open a Pull Request
234
+
235
+ ## 📜 License
236
+
237
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
238
+
239
+ ## 🙏 Acknowledgments
240
+
241
+ - [Trello API](https://developer.atlassian.com/cloud/trello/) - Official Trello API
242
+ - [Bun](https://bun.sh/) - Ultra-fast JavaScript runtime
243
+ - [Inquirer](https://github.com/SBoudrias/Inquirer.js) - Interactive command-line interface
244
+ - [Commander](https://github.com/tj/commander.js) - CLI framework for Node.js
245
+
246
+ ## 📊 Project Status
247
+
248
+ - ✅ Initial release (v0.1.0)
249
+ - 🚀 57 tests passing
250
+ - 📦 Clean DDD architecture
251
+ - 🎨 ESLint + TypeScript strict
252
+ - ⚡ Performance optimized with Bun
253
+
254
+ ---
255
+
256
+ **Note**: This is an unofficial project and is not affiliated with Atlassian or Trello.
257
+
258
+ ---
259
+
260
+ **Made with ❤️ and Bun**
261
+ # Test