Modules@robinpath/trello
trello

@robinpath/trello

0.1.1Node.jsPublic

Trello 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.listBoards to perform this operation
  • Get a board by ID. -- Use trello.getBoard to perform this operation
  • List all lists in a board. -- Use trello.listLists to perform this operation
  • Create a new list in a board. -- Use trello.createList to perform this operation
  • List all cards in a list. -- Use trello.listCards to perform this operation

Quick Reference

FunctionDescriptionReturns
setCredentialsSet Trello API key and token.Confirmation message.
listBoardsList all boards for the authenticated user.Array of board objects.
getBoardGet a board by ID.Board object.
listListsList all lists in a board.Array of list objects.
createListCreate a new list in a board.Created list object.
listCardsList all cards in a list.Array of card objects.
getCardGet a card by ID.Card object.
createCardCreate a new card in a list.Created card object.
updateCardUpdate a card's properties.Updated card object.
moveCardMove a card to a different list.Updated card object.
deleteCardDelete a card permanently.Confirmation message.
addCommentAdd 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"
ParameterTypeRequiredDescription
apiKeystringYesTrello API key
tokenstringYesTrello API token

listBoards

List all boards for the authenticated user.

Module: trello | Returns: array -- Array of board objects.

trello.listBoards
ParameterTypeRequiredDescription
(none)NoCall with no arguments

getBoard

Get a board by ID.

Module: trello | Returns: object -- Board object.

trello.getBoard "board-id"
ParameterTypeRequiredDescription
boardIdstringYesBoard ID

listLists

List all lists in a board.

Module: trello | Returns: array -- Array of list objects.

trello.listLists "board-id"
ParameterTypeRequiredDescription
boardIdstringYesBoard ID

createList

Create a new list in a board.

Module: trello | Returns: object -- Created list object.

trello.createList "board-id" "Done"
ParameterTypeRequiredDescription
boardIdstringYesBoard ID
namestringYesList name

listCards

List all cards in a list.

Module: trello | Returns: array -- Array of card objects.

trello.listCards "list-id"
ParameterTypeRequiredDescription
listIdstringYesList ID

getCard

Get a card by ID.

Module: trello | Returns: object -- Card object.

trello.getCard "card-id"
ParameterTypeRequiredDescription
cardIdstringYesCard 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"}
ParameterTypeRequiredDescription
listIdstringYesList ID to add the card to
namestringYesCard title
optionsobjectNoOptions: 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}
ParameterTypeRequiredDescription
cardIdstringYesCard ID
updatesobjectYesFields 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"
ParameterTypeRequiredDescription
cardIdstringYesCard ID
listIdstringYesTarget list ID

deleteCard

Delete a card permanently.

Module: trello | Returns: string -- Confirmation message.

trello.deleteCard "card-id"
ParameterTypeRequiredDescription
cardIdstringYesCard ID to delete

addComment

Add a comment to a card.

Module: trello | Returns: object -- Created comment action.

trello.addComment "card-id" "This is done!"
ParameterTypeRequiredDescription
cardIdstringYesCard ID
textstringYesComment text

Error Handling

All functions throw on failure. Common errors:

ErrorCause
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)

VersionTagPublished
0.1.1latest1 months ago
Install
$ robinpath add @robinpath/trello

Collaborators

Dumitru Balaban
Dumitru Balaban
@dumitru
View all @robinpath modules
Version0.1.1
LicenseMIT
Unpacked Size5.3 KB
Versions1
Weekly Downloads21
Total Downloads21
Stars0
Last Publish1 months ago
Created1 months ago

Category

productivity