- This is quick and dirty and not terribly maintainable. But it's very useful for creating quick cards from the terminal. Requires familiarity with Trello and a basic understanding of bash.
- Log-in to Trello.
- Go to: https://trello.com/1/appKey/generate
- Make note of your key. Replace any mention of
YourTrelloKey
with this hash. - Create a token. Go to https://trello.com/1/authorize?key=YourTrelloKey&name=SimpleBASHScript&expiration=never&response_type=token&scope=read,write in your browser and follow directions.
- Make note of the token. Replace any mention of
YourTrelloToken
with this looong hash. - Pick a reasonable number of the most popular boards you use. Grab the URLs of those boards. At the same time, think of short, one-word, easy-to-remember names for each board (e.g., work, homeprojects, wedding).
- Grab the board IDs of the boards you chose. It'll be the ~8 character hash-like string in the URL. E.g., for https://trello.com/b/aWsGTrsD/work the ID is aWsGTrsD
- One by one, plug those IDs into the following API call: https://trello.com/1/boards/insertBOARDIDhere/lists?key=YourTrelloKey (via browser or cURL)
- Look at the resulting json, and, for each board, decide on the list (e.g, bullpen, doing, To Be Done) where you would most likely put a quick placeholder card (the list won't be dynamic, only the board). Make note of the 'id' property for each chosen list (one per board).
- Make note of your new values that pair short board name with list id property. E.g. --
work => wjeh18ehdkqwjeh7y1987
- Take all this info and insert it into this bash script template: https://gist.github.com/CrookedNumber/8857003 [Name the file something like: 'trello']
- Make sure your new script is executable and in a sensible location, like
/usr/local/bin
- Adding a ticket should now be as easy as:
trello wedding "Taste cakes"
- Read much more about the Trello API at: https://trello.com/docs/
Last active
September 20, 2024 19:27
-
-
Save CrookedNumber/8856939 to your computer and use it in GitHub Desktop.
How to create Trello Cards from the Command Line (with a ~10 minute set-up)
#9, as Hwulex suggested (thanks btw)
https://trello.com/1/boards/<BOARDID>/lists?key=<KEY>&token=<TOKEN>
see: https://developers.trello.com/advanced-reference/list#get-1-lists-idlist
Thanks for this, right now Trello changed how to see the board. So step 8 URL should be:
https://api.trello.com/1/board/[BOARD_ID]?cards=open&lists=open&checklists=all&key=[APP_KEY]&token=[USER_TOKEN]
Thanks @CrookedNumber very helpful.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this excellent Gist, helped a lot with a small project. One thing to note is the API call in #9 is missing the token parameter, without which you get a permission denied error.