trello-cli is a simple CLI tool for managing your Trello cards. It allows you to search, create and update your cards directly from your terminal without needing to access the Trello web interface.
- Card Search: Search for cards across all your boards
- Create Cards: Add new cards to any list with labels and comments
- Update Cards: Update existing cards, including their names, lists, comments and archival state
- Board Discovery: View all your Trello boards with their IDs
- List Discovery: View all lists within a board and cards within those lists
- Label Discovery: View all available labels in a board
- Environment Variable Support: Configure your Trello credentials via environment variables or command-line options
- Rich Terminal Output: Beautifully formatted output for better readability using
rich - Command Help System: Each subcommand has detailed help information available via the
--helpflag
- Change to the trello-cli directory:
cd trello-cli- Create and activate a virtual environment:
python -m venv .venv
source .venv/bin/activate- Install the package:
pip install .To install the package in editable mode, use the -e option:
pip install -e .You can provide your Trello API credentials in two ways:
- Using Environment Variables:
Create the following environment variables (by adding them to your .bashrc/.zshrc or other appropriate file):
export TRELLO_API_KEY=your_api_key
export TRELLO_TOKEN=your_token- Command-Line Options:
You can also provide credentials with each command using --api-key and --token options
The CLI provides several commands to help you manage your Trello boards and cards. Each command has detailed help information available via the --help flag. Its really helpful in telling you what options are available and how to use them.
- View All Commands and General Help
trello-cli --help- List Your Boards
trello-cli boards
trello-cli boards --help # for more information- View Lists in a Board
trello-cli lists --board-id <board_id>
trello-cli lists -b <board_id> # short form
trello-cli lists --help # for more information- View Cards in a List
trello-cli view-cards --list-id <list_id>
trello-cli view-cards -l <list_id> # short form- View Labels in a Board
trello-cli labels --board-id <board_id>
trello-cli labels -b <board_id> # short form
trello-cli labels --help # for more information- Search for Cards using a query string
trello-cli search --query <search_term>
trello-cli search --help # for more information- Create a new Card
trello-cli add-card --list-id <list_id> --name "Card Name"
trello-cli add-card --help # for more information- Create a new Card with Labels and Comment
trello-cli add-card --list-id <list_id> --name "Card Name" --label <label_id_1>,<label_id_2> --comment "Card Comment"- Update an existing Card (e.g., change name, list, add comments, archive/unarchive)
trello-cli update-card --card-id <card_id> --name "Updated Card Name" --list-id <new_list_id> --comment "New Comment"
trello-cli update-card --card-id <card_id> --archive # to archive the card
trello-cli update-card --card-id <card_id> --unarchive # to unarchive the card
trello-cli update-card --help # for more information- Find your board ID:
trello-cli boards- Find the desired list ID:
trello-cli lists --board-id <board_id>- Check available labels:
trello-cli labels --board-id <board_id>- Create a new card:
trello-cli add-card --list-id <list_id> --name "New Feature" --label <label_id> --comment "Priority task for sprint"- Update or archive your cards if you want:
trello-cli update-card --card-id <card_id> --name "Updated Feature" --list-id <new_list_id> --archiveI was unfamiliar with building installable packages in Python and it seemed fitting that a CLI tool should be pip installable. The following resources helped me a lot in understanding the process:
Also, I can't skip mentioning the excellent docs for Typer. It was a great learning experience building the CLI using it.
trello-cli is distributed under the terms of the MIT license.