@robinpath/trello
0.1.1Node.jsPublicTrello module for RobinPath.
Trello
Trello module for RobinPath.
Package: @robinpath/trello | Category: Project Management | Type: Integration
Authentication
trello.setCredentials "api_key" "token"
Call this once at the start of your script before using any other function. Credentials persist for the duration of the script execution.
Use Cases
Use the trello module when you need to:
- List all boards for the authenticated user. -- Use
trello.listBoardsto perform this operation - Get a board by ID. -- Use
trello.getBoardto perform this operation - List all lists in a board. -- Use
trello.listListsto perform this operation - Create a new list in a board. -- Use
trello.createListto perform this operation - List all cards in a list. -- Use
trello.listCardsto perform this operation
Quick Reference
| Function | Description | Returns |
|---|---|---|
setCredentials | Set Trello API key and token. | Confirmation message. |
listBoards | List all boards for the authenticated user. | Array of board objects. |
getBoard | Get a board by ID. | Board object. |
listLists | List all lists in a board. | Array of list objects. |
createList | Create a new list in a board. | Created list object. |
listCards | List all cards in a list. | Array of card objects. |
getCard | Get a card by ID. | Card object. |
createCard | Create a new card in a list. | Created card object. |
updateCard | Update a card's properties. | Updated card object. |
moveCard | Move a card to a different list. | Updated card object. |
deleteCard | Delete a card permanently. | Confirmation message. |
addComment | Add a comment to a card. | Created comment action. |
Functions
setCredentials
Set Trello API key and token.
Module: trello | Returns: string -- Confirmation message.
trello.setCredentials "api_key" "token"
| Parameter | Type | Required | Description |
|---|---|---|---|
apiKey | string | Yes | Trello API key |
token | string | Yes | Trello API token |
listBoards
List all boards for the authenticated user.
Module: trello | Returns: array -- Array of board objects.
trello.listBoards
| Parameter | Type | Required | Description |
|---|---|---|---|
| (none) | No | Call with no arguments |
getBoard
Get a board by ID.
Module: trello | Returns: object -- Board object.
trello.getBoard "board-id"
| Parameter | Type | Required | Description |
|---|---|---|---|
boardId | string | Yes | Board ID |
listLists
List all lists in a board.
Module: trello | Returns: array -- Array of list objects.
trello.listLists "board-id"
| Parameter | Type | Required | Description |
|---|---|---|---|
boardId | string | Yes | Board ID |
createList
Create a new list in a board.
Module: trello | Returns: object -- Created list object.
trello.createList "board-id" "Done"
| Parameter | Type | Required | Description |
|---|---|---|---|
boardId | string | Yes | Board ID |
name | string | Yes | List name |
listCards
List all cards in a list.
Module: trello | Returns: array -- Array of card objects.
trello.listCards "list-id"
| Parameter | Type | Required | Description |
|---|---|---|---|
listId | string | Yes | List ID |
getCard
Get a card by ID.
Module: trello | Returns: object -- Card object.
trello.getCard "card-id"
| Parameter | Type | Required | Description |
|---|---|---|---|
cardId | string | Yes | Card ID |
createCard
Create a new card in a list.
Module: trello | Returns: object -- Created card object.
trello.createCard "list-id" "Fix login bug" {"desc":"Users cannot log in","due":"2025-12-31"}
| Parameter | Type | Required | Description |
|---|---|---|---|
listId | string | Yes | List ID to add the card to |
name | string | Yes | Card title |
options | object | No | Options: desc, due, idMembers, idLabels, pos |
updateCard
Update a card's properties.
Module: trello | Returns: object -- Updated card object.
trello.updateCard "card-id" {"name":"Updated Title","closed":false}
| Parameter | Type | Required | Description |
|---|---|---|---|
cardId | string | Yes | Card ID |
updates | object | Yes | Fields to update (name, desc, due, closed, etc.) |
moveCard
Move a card to a different list.
Module: trello | Returns: object -- Updated card object.
trello.moveCard "card-id" "done-list-id"
| Parameter | Type | Required | Description |
|---|---|---|---|
cardId | string | Yes | Card ID |
listId | string | Yes | Target list ID |
deleteCard
Delete a card permanently.
Module: trello | Returns: string -- Confirmation message.
trello.deleteCard "card-id"
| Parameter | Type | Required | Description |
|---|---|---|---|
cardId | string | Yes | Card ID to delete |
addComment
Add a comment to a card.
Module: trello | Returns: object -- Created comment action.
trello.addComment "card-id" "This is done!"
| Parameter | Type | Required | Description |
|---|---|---|---|
cardId | string | Yes | Card ID |
text | string | Yes | Comment text |
Error Handling
All functions throw on failure. Common errors:
| Error | Cause |
|---|---|
Trello API error (${res.status}): ${text} | Check the error message for details |
trello.setCredentials requires apiKey and token. | Check the error message for details |
trello.getBoard requires a boardId. | Check the error message for details |
trello.listLists requires a boardId. | Check the error message for details |
trello.createList requires boardId and name. | Check the error message for details |
trello.listCards requires a listId. | Check the error message for details |
trello.getCard requires a cardId. | Check the error message for details |
trello.createCard requires listId and name. | Check the error message for details |
@desc "List boards and validate result"
do
set $result as trello.listBoards
if $result != null
print "Success"
else
print "No result"
end
enddo
Recipes
1. List and iterate Boards
Retrieve all items and loop through them.
@desc "Setup authentication"
do
trello.setCredentials $token
enddo
@desc "List boards and iterate results"
do
set $result as trello.listBoards
each $item in $result
print $item
end
enddo
2. Create a new item with createList
Create a new resource and capture the result.
@desc "Setup authentication"
do
trello.setCredentials $token
enddo
@desc "Create list"
do
set $result as trello.createList "board-id" "Done"
print "Created: " + $result
enddo
3. Create and update workflow
Create an item and then update it.
@desc "Setup authentication"
do
trello.setCredentials $token
enddo
@desc "Create list and update card"
do
set $created as trello.createList "board-id" "Done"
# Update the created item
trello.updateCard "card-id" {"name":"Updated Title","closed":false}
enddo
4. Check before creating
List existing items and only create if needed.
@desc "Setup authentication"
do
trello.setCredentials $token
enddo
@desc "List boards and create list"
do
set $existing as trello.listBoards
if $existing == null
trello.createList "board-id" "Done"
print "Item created"
else
print "Item already exists"
end
enddo
5. Multi-step Trello workflow
Chain multiple trello operations together.
@desc "Setup authentication"
do
trello.setCredentials $token
enddo
@desc "List boards, get board, and more"
do
set $r_listBoards as trello.listBoards
set $r_getBoard as trello.getBoard "board-id"
set $r_listLists as trello.listLists "board-id"
print "All operations complete"
enddo
6. Safe listBoards with validation
Check results before proceeding.
@desc "Setup authentication"
do
trello.setCredentials $token
enddo
@desc "List boards and validate result"
do
set $result as trello.listBoards
if $result != null
print "Success: " + $result
else
print "Operation returned no data"
end
enddo
Related Modules
- asana -- Asana module for complementary functionality
- clickup -- ClickUp module for complementary functionality
- jira -- Jira module for complementary functionality
- linear -- Linear module for complementary functionality
- monday -- Monday.com module for complementary functionality
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.1 | latest | 1 months ago |
Related Modules
rightplace
JS@robinpathv0.1.3
RightPlace integration — 130 functions for projects, WordPress, WooCommerce, email, files, git, spreadsheets, stages, docs, automations via rightplace-cli
asana
JS@robinpathv0.1.2
Asana module for RobinPath.
google-sheets
JS@robinpathv0.1.1
Google Sheets module for RobinPath.
airtable
JS@robinpathv0.1.2
Airtable module for RobinPath.
$ robinpath add @robinpath/trello
