@kody/trello
README.md
138 lines · 5.5 KB · Markdown@kody/trello
community-icon.svg is Trello's official logomark from the
Wikimedia Commons Trello logo
(Atlassian product mark, Pacific Bridge gradient #0052CC → #2684FF).
Trello® is a trademark of Atlassian. This package is not affiliated with or
endorsed by Atlassian.
Intent
Reusable Trello helpers so Kody agents can list and update the caller's
boards, lists, cards, and comments. Reads are free-form. Mutations support
dryRun: true and require confirm: true.
This listing is meant to be forked. After you fork, connect your Trello account. No board ids, list names, or workspace ids are baked in.
Share this package as https://kody.codes/@kody/trello
(never a /community/{listing_id} URL).
Agent setup
Trello has no built-in Kody OAuth app. Trello REST still authenticates with
an API key + user token (query key and token). Trello OAuth 2 is not
generally available; Kody can still use a saved trello / trello-*
integration when one exists.
| Lane | When to use | Credential |
|---|---|---|
| API key + token (recommended) | Personal automation, Power-Up key | User secrets trelloApiKey + trelloToken (or trelloApiKey-<purpose> / trelloToken-<purpose>) |
| OAuth integration | Saved trello / trello-* connection | createAuthenticatedFetch via integrationName |
Required API host: api.trello.com. Approve it in the account secrets UI.
Saving a secret does not approve hosts by itself. Never paste keys or tokens
into chat.
Lane A — API key + token
- Create a Power-Up and API key at Trello Power-Ups admin
- Save the API key (do not paste the value in chat):
- Authorize a user token with that key (
read,write; replaceYOUR_API_KEYwith the key you just created — in the Trello page, not in chat):
- Save the user token:
- Approve host
api.trello.com - Run the smoke test below
Lane B — Saved OAuth integration
Trello's live OAuth is 1.0 (/1/OAuthGetRequestToken, /1/OAuthAuthorizeToken,
/1/OAuthGetAccessToken). Kody /connect/oauth is OAuth 2, so a first-time
Trello OAuth 2 connect is not available until Atlassian ships those endpoints.
If a trello integration is already saved, reconnect while signed in to Kody:
https://kody.codes/connect/oauth?provider=trello
For a new BYO connection page (provider + API host prefilled; add authorize and token URLs when Trello documents OAuth 2):
Redirect URI for any future Trello OAuth 2 app: https://kody.codes/connect/oauth.
To connect a second account, change provider (for example
provider=trello-work) and pass account: 'work' or
integrationName: 'trello-work' / secretName: 'trelloToken-work' /
apiKeySecretName: 'trelloApiKey-work' on every call.
When To Use
- List or inspect the caller's boards, lists, cards, and comments
- Create or update boards, lists, cards, and comments after explicit confirmation
- Call an unwrapped Trello REST path through
./request - Verify credentials with
./smoke-testbefore any write
Mutation safety
- Pass
dryRun: trueon writes to return{ dryRun: true, method, path, body }without contacting Trello. - Live writes throw unless
confirm: true. - Board ids, list ids, and card ids come from the call. This package has no default board.
import trello from 'kody:@kody/trello'
import { createCard } from 'kody:@kody/trello/cards'
const preview = await createCard({
listId: 'list-id-from-caller',
name: 'Write the release notes',
dryRun: true,
})
const smoke = await trello({ action: 'smoke-test' })Multiple accounts
Every export accepts:
account—work→ integrationtrello-work, secretstrelloApiKey-work+trelloToken-workintegrationName/integration— saved OAuth name (trelloortrello-*)secretName— token secret override (defaulttrelloToken)apiKeySecretName— API key secret override (defaulttrelloApiKey)auth—'keyToken'or'oauth'when both lanes exist
Exports
| Export | Purpose |
|---|---|
. | Dispatcher. Defaults to smoke-test. |
./accounts | Resolve integration + secret names and setup URLs |
./viewer | GET /members/me |
./boards | list / get / create / update boards |
./lists | list / get / create / update lists |
./cards | list / get / create / update cards |
./comments | list comments / add comment |
./request | Raw api.trello.com path |
./smoke-test | Dry-run self-check + optional live member/boards read |
./scheduled-account-health | No-arg read-only wrapper; job disabled by default |
Jobs
account-health is declared with "enabled": false. Do not enable it until a
representative invoke of ./scheduled-account-health succeeds.
Auth docs
https://developer.atlassian.com/cloud/trello/guides/rest-api/authorization/