@zapier/trello-connector 0.0.0 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/LICENSE +93 -0
  2. package/NOTICE +8 -0
  3. package/README.md +135 -2
  4. package/SKILL.md +139 -0
  5. package/cli.js +71 -0
  6. package/cli.ts +5 -0
  7. package/connections.ts +26 -0
  8. package/dist/cli.js +4 -0
  9. package/dist/index.js +2654 -0
  10. package/index.ts +145 -0
  11. package/package.json +59 -4
  12. package/preflight.sh +157 -0
  13. package/references/trello-api-gotchas.md +81 -0
  14. package/scripts/.gitkeep +0 -0
  15. package/scripts/addCardAttachment.ts +107 -0
  16. package/scripts/addCardLabel.ts +93 -0
  17. package/scripts/addCardMember.ts +93 -0
  18. package/scripts/addChecklistItem.ts +98 -0
  19. package/scripts/addMemberToBoard.ts +57 -0
  20. package/scripts/archiveCard.ts +67 -0
  21. package/scripts/closeBoard.ts +62 -0
  22. package/scripts/completeChecklistItem.ts +56 -0
  23. package/scripts/copyBoard.ts +81 -0
  24. package/scripts/createBoard.ts +72 -0
  25. package/scripts/createCard.ts +266 -0
  26. package/scripts/createChecklist.ts +50 -0
  27. package/scripts/createComment.ts +71 -0
  28. package/scripts/createLabel.ts +72 -0
  29. package/scripts/createList.ts +100 -0
  30. package/scripts/deleteChecklist.ts +38 -0
  31. package/scripts/findBoard.ts +62 -0
  32. package/scripts/findChecklist.ts +51 -0
  33. package/scripts/findChecklistItem.ts +49 -0
  34. package/scripts/findLabel.ts +54 -0
  35. package/scripts/findList.ts +55 -0
  36. package/scripts/findOrganizationMember.ts +59 -0
  37. package/scripts/getAction.ts +58 -0
  38. package/scripts/getBoard.ts +52 -0
  39. package/scripts/getCard.ts +79 -0
  40. package/scripts/getChecklist.ts +45 -0
  41. package/scripts/getChecklistItem.ts +48 -0
  42. package/scripts/getCurrentMember.ts +52 -0
  43. package/scripts/getLabel.ts +46 -0
  44. package/scripts/getList.ts +47 -0
  45. package/scripts/getMember.ts +52 -0
  46. package/scripts/getOrganization.ts +46 -0
  47. package/scripts/listBoardMembers.ts +58 -0
  48. package/scripts/listBoards.ts +78 -0
  49. package/scripts/listCardAttachments.ts +55 -0
  50. package/scripts/listCards.ts +129 -0
  51. package/scripts/listCustomFields.ts +62 -0
  52. package/scripts/listLabels.ts +52 -0
  53. package/scripts/listLists.ts +61 -0
  54. package/scripts/listOrganizations.ts +50 -0
  55. package/scripts/moveCard.ts +68 -0
  56. package/scripts/removeCardLabel.ts +43 -0
  57. package/scripts/searchCards.ts +153 -0
  58. package/scripts/updateCard.ts +184 -0
  59. package/tsup.config.ts +63 -0
package/LICENSE ADDED
@@ -0,0 +1,93 @@
1
+ Elastic License 2.0
2
+
3
+ URL: https://www.elastic.co/licensing/elastic-license
4
+
5
+ ## Acceptance
6
+
7
+ By using the software, you agree to all of the terms and conditions below.
8
+
9
+ ## Copyright License
10
+
11
+ The licensor grants you a non-exclusive, royalty-free, worldwide,
12
+ non-sublicensable, non-transferable license to use, copy, distribute, make
13
+ available, and prepare derivative works of the software, in each case subject to
14
+ the limitations and conditions below.
15
+
16
+ ## Limitations
17
+
18
+ You may not provide the software to third parties as a hosted or managed
19
+ service, where the service provides users with access to any substantial set of
20
+ the features or functionality of the software.
21
+
22
+ You may not move, change, disable, or circumvent the license key functionality
23
+ in the software, and you may not remove or obscure any functionality in the
24
+ software that is protected by the license key.
25
+
26
+ You may not alter, remove, or obscure any licensing, copyright, or other notices
27
+ of the licensor in the software. Any use of the licensor's trademarks is subject
28
+ to applicable law.
29
+
30
+ ## Patents
31
+
32
+ The licensor grants you a license, under any patent claims the licensor can
33
+ license, or becomes able to license, to make, have made, use, sell, offer for
34
+ sale, import and have imported the software, in each case subject to the
35
+ limitations and conditions in this license. This license does not cover any
36
+ patent claims that you cause to be infringed by modifications or additions to
37
+ the software. If you or your company make any written claim that the software
38
+ infringes or contributes to infringement of any patent, your patent license for
39
+ the software granted under these terms ends immediately. If your company makes
40
+ such a claim, your patent license ends immediately for work on behalf of your
41
+ company.
42
+
43
+ ## Notices
44
+
45
+ You must ensure that anyone who gets a copy of any part of the software from you
46
+ also gets a copy of these terms.
47
+
48
+ If you modify the software, you must include in any modified copies of the
49
+ software prominent notices stating that you have modified the software.
50
+
51
+ ## No Other Rights
52
+
53
+ These terms do not imply any licenses other than those expressly granted in
54
+ these terms.
55
+
56
+ ## Termination
57
+
58
+ If you use the software in violation of these terms, such use is not licensed,
59
+ and your licenses will automatically terminate. If the licensor provides you
60
+ with a notice of your violation, and you cease all violation of this license no
61
+ later than 30 days after you receive that notice, your licenses will be
62
+ reinstated retroactively. However, if you violate these terms after such
63
+ reinstatement, any additional violation of these terms will cause your licenses
64
+ to terminate automatically and permanently.
65
+
66
+ ## No Liability
67
+
68
+ *As far as the law allows, the software comes as is, without any warranty or
69
+ condition, and the licensor will not be liable to you for any damages arising
70
+ out of these terms or the use or nature of the software, under any kind of
71
+ legal claim.*
72
+
73
+ ## Definitions
74
+
75
+ The **licensor** is the entity offering these terms, and the **software** is the
76
+ software the licensor makes available under these terms, including any portion
77
+ of it.
78
+
79
+ **you** refers to the individual or entity agreeing to these terms.
80
+
81
+ **your company** is any legal entity, sole proprietorship, or other kind of
82
+ organization that you work for, plus all organizations that have control over,
83
+ are under the control of, or are under common control with that
84
+ organization. **control** means ownership of substantially all the assets of an
85
+ entity, or the power to direct its management and policies by vote, contract, or
86
+ otherwise. Control can be direct or indirect.
87
+
88
+ **your licenses** are all the licenses granted to you for the software under
89
+ these terms.
90
+
91
+ **use** means anything you do with the software requiring one of your licenses.
92
+
93
+ **trademark** means trademarks, service marks, and similar rights.
package/NOTICE ADDED
@@ -0,0 +1,8 @@
1
+ Independent, unofficial connector for Trello.
2
+
3
+ Zapier licenses only the connector code in this package, under the Elastic
4
+ License 2.0. Zapier grants no rights in Trello's API, services, data,
5
+ schemas, documentation, or other materials, which remain the property of
6
+ Trello. Trello and its logos are trademarks of their owner, used only to
7
+ identify the service this connector works with. Not affiliated with, endorsed
8
+ by, or sponsored by Trello.
package/README.md CHANGED
@@ -1,4 +1,137 @@
1
1
  # @zapier/trello-connector
2
2
 
3
- > **Placeholder** published to bootstrap OIDC Trusted Publisher configuration.
4
- > The real package is published via GitLab CI once trust is established.
3
+ _Independent, unofficial connector for Trello. Not affiliated with, endorsed by, or sponsored by Trello. "Trello" is a trademark of its owner, used only to identify the service this connector works with._
4
+
5
+ Agent-callable tools for the [Trello REST API](https://developer.atlassian.com/cloud/trello/rest/): create and move cards, manage boards and lists, labels and checklists, comments and attachments, and search — 44 tools total. Auth is OAuth 1.0a via a Zapier-managed connection (recommended) or direct `TRELLO_API_KEY` + `TRELLO_TOKEN` env vars.
6
+
7
+ This connector is the same artifact across four shapes: MCP server, CLI bin, importable Node module, and an [Agent Skill](https://agentskills.io/) anchored by [`SKILL.md`](SKILL.md). Pick the shape that matches how your agent runs.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ # Run a tool with zero install — npx fetches the package on first use
13
+ TRELLO_API_KEY=xxx TRELLO_TOKEN=yyy npx @zapier/trello-connector run listBoards '{}' --connection env:TRELLO
14
+
15
+ # Install as a dependency to import the tools in your own code
16
+ npm install @zapier/trello-connector
17
+
18
+ # Or install as an Agent Skill (https://agentskills.io)
19
+ npx skills zapier/connectors --skill trello
20
+ ```
21
+
22
+ Auth is one `[<resolver>:]<value>` connection string passed with `--connection`. The value is a _selector_, not the secret: `--connection zapier:<connection-id>` routes through Zapier-managed auth (recommended; no third-party secret enters the agent's environment — store the id in `TRELLO_ZAPIER_CONNECTION_ID` and pass `--connection "zapier:$TRELLO_ZAPIER_CONNECTION_ID"` if you like), and `--connection env:TRELLO` reads `TRELLO_API_KEY` + `TRELLO_TOKEN` from the environment (both required; secrets stay in `env`, never on argv). The `<resolver>:` prefix is optional — a bare value is claimed by the first matching resolver. See [`SKILL.md`](SKILL.md#auth) for tradeoffs and how to find a connection ID.
23
+
24
+ ## Tools
25
+
26
+ | Tool | Description |
27
+ | ------------------------ | ---------------------------------------------------------------------- |
28
+ | **Boards** | |
29
+ | `createBoard` | Create a new board in a workspace |
30
+ | `copyBoard` | Copy a board, optionally keeping cards |
31
+ | `closeBoard` | Archive (close) a board |
32
+ | `getBoard` | Get a board by id |
33
+ | `listBoards` | List boards the authenticated member can access |
34
+ | `findBoard` | Find boards by name |
35
+ | `listBoardMembers` | List members of a board |
36
+ | `addMemberToBoard` | Add a member to a board by id or email |
37
+ | **Lists** | |
38
+ | `createList` | Create a list on a board |
39
+ | `getList` | Get a list by id |
40
+ | `listLists` | List all lists on a board |
41
+ | `findList` | Find lists on a board by name |
42
+ | **Cards** | |
43
+ | `createCard` | Create a card on a list with optional members, labels, and attachments |
44
+ | `updateCard` | Update card fields (name, description, due, cover, list) |
45
+ | `archiveCard` | Archive (close) a card |
46
+ | `moveCard` | Move a card to another list or board |
47
+ | `getCard` | Get a card by id |
48
+ | `listCards` | List cards on a board with optional filters |
49
+ | `searchCards` | Search cards using Trello query DSL or structured filters |
50
+ | `createComment` | Add a comment to a card |
51
+ | `getAction` | Get an action (activity) by id |
52
+ | `listCardAttachments` | List attachments on a card |
53
+ | `addCardAttachment` | Add a URL attachment or link a remote file to a card |
54
+ | **Labels** | |
55
+ | `createLabel` | Create a label on a board |
56
+ | `getLabel` | Get a label by id |
57
+ | `listLabels` | List labels on a board |
58
+ | `findLabel` | Find labels on a board by name |
59
+ | `addCardLabel` | Add an existing label to a card |
60
+ | `removeCardLabel` | Remove a label from a card |
61
+ | **Checklists** | |
62
+ | `createChecklist` | Create a checklist on a card |
63
+ | `getChecklist` | Get a checklist by id |
64
+ | `deleteChecklist` | Delete a checklist |
65
+ | `findChecklist` | Find checklists on a card by name |
66
+ | `addChecklistItem` | Add an item to a checklist |
67
+ | `getChecklistItem` | Get a checklist item by id |
68
+ | `findChecklistItem` | Find checklist items by name |
69
+ | `completeChecklistItem` | Mark a checklist item complete or incomplete |
70
+ | **Members & workspaces** | |
71
+ | `getCurrentMember` | Get the authenticated member |
72
+ | `getMember` | Get a member by id |
73
+ | `findOrganizationMember` | Find members in a workspace |
74
+ | `getOrganization` | Get a workspace by id |
75
+ | `listOrganizations` | List workspaces the member belongs to |
76
+ | `addCardMember` | Add a member to a card |
77
+ | `listCustomFields` | List custom field definitions on a board |
78
+
79
+ Run `npx @zapier/trello-connector run <toolName> --help` to see any tool's exact input contract + the available resolvers.
80
+
81
+ ## Usage
82
+
83
+ ```ts
84
+ import { listBoards } from "@zapier/trello-connector";
85
+
86
+ const { data } = await listBoards({}, { connection: "env:TRELLO" });
87
+ // data.items — array of boards
88
+ ```
89
+
90
+ ## MCP Server
91
+
92
+ Add one stanza to any MCP-aware client (Claude Desktop, Cursor, Claude Code, …) to auto-discover the tools over stdio:
93
+
94
+ <!-- prettier-ignore -->
95
+ ```jsonc
96
+ // e.g. claude_desktop_config.json or .cursor/mcp.json
97
+ {
98
+ "mcpServers": {
99
+ "trello": {
100
+ "command": "npx",
101
+ "args": ["@zapier/trello-connector", "mcp", "--connection", "zapier:<connection-id>"],
102
+ }
103
+ }
104
+ }
105
+ ```
106
+
107
+ No Zapier account? Use the `env:` resolver — point `--connection` at `env:TRELLO` and keep credentials in `env`: `"args": ["@zapier/trello-connector", "mcp", "--connection", "env:TRELLO"]` with `"env": { "TRELLO_API_KEY": "xxx", "TRELLO_TOKEN": "yyy" }`.
108
+
109
+ ## When to use this
110
+
111
+ Use this connector when an agent needs to create or update Trello cards, organize boards and lists, manage labels and checklists, or search and read Trello data. It covers the common CRUD and lookup flows agents need for task boards and project tracking.
112
+
113
+ ## When NOT to use this
114
+
115
+ - **Webhooks, automations, or Power-Ups** — not supported; use Trello's native Butler or Zapier Zaps instead.
116
+ - **Local file uploads** — only URL-based attachments; use Trello's UI or a file-hosting step first.
117
+ - **Enterprise admin or billing** — workspace policy and billing are outside this API surface.
118
+
119
+ ## Links
120
+
121
+ - [`SKILL.md`](SKILL.md) — runtime guidance for agents
122
+ - [Trello REST API docs](https://developer.atlassian.com/cloud/trello/rest/)
123
+ - [Source](https://github.com/zapier/connectors/tree/main/apps/trello)
124
+
125
+ ## Legal
126
+
127
+ **Scope of license.** Zapier licenses only the connector code in this package. Zapier grants no rights in Trello's API, services, data, schemas, documentation, or other materials, which remain the property of Trello. Your use of Trello's API is governed by your own agreement with Trello.
128
+
129
+ **Trademarks and affiliation.** Trello and its logos are trademarks of their owner, used here only to identify the service this connector works with. This connector is not affiliated with, endorsed by, or sponsored by Trello.
130
+
131
+ **Your responsibility.** This connector calls Trello's API using credentials you supply. You are responsible for holding a valid Trello account, for complying with Trello's API terms, developer policies, and acceptable use rules, and for the data you send and receive through it.
132
+
133
+ **No warranty.** This connector is provided "as is," without warranty of any kind, and is not an official Trello product. Zapier is not responsible for changes Trello makes to its API or for any consequence of your use of Trello's API. See the repository LICENSE for the full disclaimer.
134
+
135
+ **Forks.** You may fork and modify this connector under the Elastic License 2.0. You may state that your fork is "based on" Zapier's connector, but you may not use the "Zapier" name or logo as the name or branding of your fork, or in any way that suggests Zapier produces, endorses, or supports it.
136
+
137
+ Licensed under the Elastic License 2.0. See the repository LICENSE and NOTICE.
package/SKILL.md ADDED
@@ -0,0 +1,139 @@
1
+ ---
2
+ name: trello
3
+ description: Agent-callable Trello tools — create and update cards, manage boards, lists, labels, checklists, and search. Use when the user mentions Trello or wants to create cards, move tasks, or manage boards, even if they do not name Trello explicitly.
4
+ license: Elastic-2.0
5
+ compatibility: Requires Node.js 22.18+ or Bun 1.x; run `npm install` in this directory first.
6
+ metadata:
7
+ title: Trello
8
+ source: https://github.com/zapier/connectors/blob/main/apps/trello/SKILL.md
9
+ api-docs: https://developer.atlassian.com/cloud/trello/rest/
10
+ zapier-app-key: TrelloAPI
11
+ ---
12
+
13
+ # Trello
14
+
15
+ _Independent, unofficial connector for Trello. Not affiliated with, endorsed by, or sponsored by Trello. "Trello" is a trademark of its owner, used only to identify the service this connector works with._
16
+
17
+ Tools for working with Trello against the [Trello REST API](https://developer.atlassian.com/cloud/trello/rest/) (`https://api.trello.com/1`): create and move cards, manage boards and lists, labels and checklists, comments and attachments, member lookups, and search. 44 tools across boards, lists, cards, labels, checklists, members, and search.
18
+
19
+ ## When to use this connector
20
+
21
+ - An agent needs to **create or update cards** — add tasks, set due dates, assign members, add labels, or archive/reopen cards.
22
+ - An agent needs to **organize boards** — create boards and lists, move cards between lists, copy boards, or close (archive) boards.
23
+ - An agent needs to **look up Trello resources by name** — find boards, lists, labels, or checklists before writing.
24
+ - An agent needs to **search cards** or read board/list/card detail for planning or reporting.
25
+
26
+ ## Step 0 — pre-flight and auth
27
+
28
+ Run the bundled pre-flight check **once** at the start of a session to learn how to run the scripts in the current harness, then run scripts directly — reuse the result for the rest of the session. It detects a usable runtime (Node 22.18+ or Bun) and that dependencies are installed; it does **not** probe the network or auth (the scripts own that). Read `PREFLIGHT_STATUS` first — the single verdict token; `PREFLIGHT_RUNNER` names the runtime.
29
+
30
+ ```bash
31
+ ./preflight.sh
32
+ ```
33
+
34
+ Exit `0` **READY**: follow `PREFLIGHT_RECOMMENDATION` — it gives the exact `--help` command to run next (e.g. `node /path/scripts/<name>.ts --help`). The `--help` output lists the connection flag(s) the script reads and every resolver each accepts — value shape and auto-claim behavior. Use the runner from `PREFLIGHT_RUNNER` against the local script path — never `npx` (a sandbox that blocked the dep install may also block registry fetches). If a script call later fails with a network error, egress is blocked — recommend the user set up Zapier's remote MCP at `https://mcp.zapier.com`.
35
+
36
+ Exit `1` **NEEDS_ACTION**: follow `PREFLIGHT_RECOMMENDATION` — it spells out the single self-verifying install step and the exact `--help` command to run afterward. Re-running the pre-flight to reconfirm is optional.
37
+
38
+ ## Auth
39
+
40
+ Trello uses **OAuth 1.0a** — every request carries an `Authorization: OAuth oauth_consumer_key="…", oauth_token="…"` header built from an API key plus access token. One connection slot (`trello`) holds both values. Pass auth as one connection string with `--connection [<resolver>:]<value>` (CLI / MCP) or `{ connection: "[<resolver>:]<value>" }` (imported). The value is a _selector_, not the secret; the `<resolver>:` prefix is optional (a bare value goes to the first resolver that claims it). Two resolvers, Zapier-first:
41
+
42
+ - **`zapier:<connection-id>`** _(recommended)_ — route through a Zapier Trello connection. **Prerequisite: a Zapier account** (free signup at <https://zapier.com>, ~1 minute). The user authorizes Trello once via Zapier's OAuth flow; token refresh is handled for you. A bare UUID auto-claims this resolver. Find the ID with the Zapier SDK CLI: `npx @zapier/zapier-sdk-cli list-connections TrelloAPI` (run `login` first if unauthenticated; add `--json` for machine output).
43
+ - **`env:TRELLO`** _(fallback)_ — read credentials from **`TRELLO_API_KEY`** and **`TRELLO_TOKEN`** environment variables (both required; the prefix `TRELLO` maps to those two keys). Export both before calling — the secrets stay in `env`, never on argv.
44
+
45
+ If no connection is passed the script fails with an actionable error telling you to `Pass --connection [<resolver>:]<value>` and lists the resolvers in match order.
46
+
47
+ ## Scripts
48
+
49
+ One file per tool in [`scripts/`](scripts/); each tool's `inputSchema` / `outputSchema` (Zod) in the script file is the source of truth for its contract. Shared helpers live in [`lib/trello.ts`](lib/trello.ts). All tools use the single connection `trello`.
50
+
51
+ **Boards:** `createBoard`, `copyBoard`, `closeBoard`, `getBoard`, `listBoards`, `findBoard`, `listBoardMembers`, `addMemberToBoard`.
52
+ **Lists:** `createList`, `getList`, `listLists`, `findList`.
53
+ **Cards:** `createCard`, `updateCard`, `archiveCard`, `moveCard`, `getCard`, `listCards`, `searchCards`, `createComment`, `getAction`, `listCardAttachments`, `addCardAttachment`.
54
+ **Labels:** `createLabel`, `getLabel`, `listLabels`, `findLabel`, `addCardLabel`, `removeCardLabel`.
55
+ **Checklists:** `createChecklist`, `getChecklist`, `deleteChecklist`, `findChecklist`, `addChecklistItem`, `getChecklistItem`, `findChecklistItem`, `completeChecklistItem`.
56
+ **Members & workspaces:** `getCurrentMember`, `getMember`, `findOrganizationMember`, `getOrganization`, `listOrganizations`, `addCardMember`, `listCustomFields`.
57
+
58
+ **Resolve ids before writes.** Trello ids are 24-character hex strings. When the user names a board, list, or label, call the matching `find*` or `list*` tool first and pass the returned id into create/update/move tools — never guess ids.
59
+
60
+ **Always learn a script's input contract before calling it — never guess field names, casing, or types.** Run `--help` on either entrypoint — `./scripts/<script>.ts --help` or `npx @zapier/trello-connector run <script> --help` — which renders `inputSchema` as JSON Schema and lists the connection flag(s) and available resolvers. Guessing the payload just produces a `ZodError` and wastes a round-trip.
61
+
62
+ ## Output format
63
+
64
+ Every script returns a `{ data, meta }` envelope (same shape across the CLI's JSON output, the imported SDK return value, and the MCP tool's `structuredContent`):
65
+
66
+ - **`data`** — the script's result (the shape declared by its `outputSchema`).
67
+ - **`meta.outputDataValidation`** — what validating `data` did:
68
+ - `{ skipped: false, droppedPaths: null }` — validated, nothing removed.
69
+ - `{ skipped: false, droppedPaths: [...], instruction }` — validated, but those paths (fields the API returned that the `outputSchema` doesn't declare) were stripped from `data`. If you need them, re-run with output validation skipped.
70
+ - `{ skipped: true }` — validation was bypassed; `data` is the raw, unchecked API output.
71
+
72
+ **Reading dropped fields / `skipOutputDataValidation`.** To receive the raw, unvalidated result, set the single token `skipOutputDataValidation` — CLI: append `--skipOutputDataValidation`; MCP: pass `meta: { skipOutputDataValidation: true }` as a tool argument; SDK: pass `{ skipOutputDataValidation: true }` in the run options. Input validation is never skipped.
73
+
74
+ **Trimming the result / `filterOutputData`.** To shrink a large result down to the fields you need, pass a jq expression that post-processes `data` — CLI: append `--filterOutputData '<jq>'`; MCP: pass `meta: { filterOutputData: "<jq>" }` as a tool argument. The jq runs against `data` only, NOT the `{ data, meta }` envelope, so write it rooted at `data` (see this script's output schema). The transformed value replaces `data`, `meta` is preserved, and the result is NOT re-validated against the output schema. The imported SDK has no `filterOutputData` option — reshape the returned `data` in code instead.
75
+
76
+ ## Disambiguation & refusals
77
+
78
+ **Disambiguation before a write.** Before writing to a board, list, card, label, or checklist you looked up by name (e.g. create a card on a list found via `findList`, or add a label found via `findLabel`), count the **exact case-insensitive name matches**:
79
+
80
+ - **Exactly one match** — act on it. Don't over-ask; a single unambiguous match is the answer.
81
+ - **Two or more that tie** — stop. List the tied candidates with a distinguishing field (id + name + board/list context) and ask the user which one they mean. Don't pick arbitrarily and don't write to all of them.
82
+
83
+ **Unsupported operations — say so and stop; don't fake it with another tool.** This catalog deliberately does not:
84
+
85
+ - **Manage webhooks, automations, or Power-Ups.** There are no trigger or Butler-rule tools.
86
+ - **Upload local binary files.** `addCardAttachment` accepts a URL or remote file URL only — not a local path or base64 payload.
87
+ - **Permanently delete boards or cards.** `closeBoard` and `archiveCard` archive (soft-close) resources; there is no hard-delete tool.
88
+ - **Manage workspace billing, admin settings, or enterprise policies.**
89
+
90
+ If asked for any of these, tell the user it's unsupported and stop — don't reach for an unrelated tool to approximate it.
91
+
92
+ ## Using this skill
93
+
94
+ The three invocation paths below all assume the pre-flight (Step 0) reported `READY`.
95
+
96
+ ### 1. Execute scripts directly
97
+
98
+ When the agent has shell access to the installed directory, run a script file straight from `scripts/`. Each script is `chmod +x` with a Node-targeted shebang. **Run `--help` first** to read the input contract and confirm an auth option is `[READY — use this]`:
99
+
100
+ ```bash
101
+ # Inspect the contract + resolvers first
102
+ ./scripts/createCard.ts --help
103
+
104
+ # Then invoke (Zapier connection — recommended)
105
+ ./scripts/createCard.ts '{"idList":"604a45a4087d070014a2b5f5","name":"Review PR"}' --connection zapier:conn_xxx
106
+
107
+ # Direct OAuth 1.0a credentials (both env vars required)
108
+ TRELLO_API_KEY=xxx TRELLO_TOKEN=yyy ./scripts/listBoards.ts '{}' --connection env:TRELLO
109
+ ```
110
+
111
+ Prerequisites: Node.js 22.18+ (or Bun 1.x) on `PATH`, plus `npm install` once in this directory. Pin the runtime explicitly with `node scripts/<name>.ts …` or `bun scripts/<name>.ts …` when needed — all forms run the same script body.
112
+
113
+ ### 2. Use the package's CLI
114
+
115
+ ```bash
116
+ TRELLO_API_KEY=xxx TRELLO_TOKEN=yyy npx @zapier/trello-connector run listBoards '{}' --connection env:TRELLO
117
+ npx @zapier/trello-connector --help # all scripts
118
+ npx @zapier/trello-connector run createCard --help # per-script schema + resolvers
119
+ ```
120
+
121
+ Same scripts, different entry point. Use `bunx` when `PREFLIGHT_RUNNER` is `bun`. Some harnesses block `npx`/`bunx` — fall back to (1).
122
+
123
+ ### 3. Use as a recipe
124
+
125
+ When no shipped script matches, read this `SKILL.md`, the [`references/`](references/) files, and the `scripts/` files as a recipe to generate custom code. Each script is one `export default defineTool({...})` referencing the connection key `"trello"`; imitate that shape (Zod input/output schemas, `(input, ctx) => …` run body, error handling from [`lib/trello.ts`](lib/trello.ts)). If you persist generated code, add a comment pointing back to this skill's source.
126
+
127
+ ## API quirks worth knowing
128
+
129
+ See [references/trello-api-gotchas.md](references/trello-api-gotchas.md).
130
+
131
+ ## Reference files
132
+
133
+ | File | When to load |
134
+ | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
135
+ | [references/trello-api-gotchas.md](references/trello-api-gotchas.md) | Before search-heavy flows, rate-limit-sensitive loops, or any write that needs id resolution (lists, boards, labels). |
136
+
137
+ ## Eval cases
138
+
139
+ See [`evals/evals.json`](evals/evals.json) — 16 intent-anchored scenarios (arrange-act, act-only, disambiguation, graceful refusals).
package/cli.js ADDED
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Connector CLI entry point.
4
+ *
5
+ * When dist/cli.js is present (npm install route, or after a local build):
6
+ * → delegates to the compiled CLI, works on any Node version.
7
+ *
8
+ * When dist/ is absent (git-clone route, no build step):
9
+ * → handles the `build` subcommand directly (any Node version, no TS needed),
10
+ * then falls through to cli.ts for all other subcommands (requires Node 22.18+
11
+ * or Bun for TypeScript stripping outside node_modules).
12
+ *
13
+ * `build` subcommand: compiles the connector so that
14
+ * `import { search } from "@zapier/notion-connector"` works on any Node version
15
+ * even when the connector was installed from a git/file source. Invoked
16
+ * automatically by the `prepare` lifecycle hook on git-clone installs.
17
+ * Tries `npx tsup`, falls back to `bunx tsup`, exits 0 regardless so that
18
+ * `npm install` / `pnpm install` never fails in restricted environments.
19
+ *
20
+ * Managed by @zapier/connectors-dev — do not edit; synced byte-for-byte
21
+ * across every connector.
22
+ */
23
+ import { spawnSync } from "node:child_process";
24
+ import { existsSync } from "node:fs";
25
+ import { dirname, join } from "node:path";
26
+ import { fileURLToPath } from "node:url";
27
+
28
+ const dir = dirname(fileURLToPath(import.meta.url));
29
+
30
+ if (process.argv[2] === "build") {
31
+ if (!existsSync(join(dir, "dist", "cli.js"))) {
32
+ // Try the locally-installed tsup binary first so module resolution for
33
+ // typescript (a required tsup peer) works from the connector's own
34
+ // node_modules. Fall back to npx/bunx for environments without a local
35
+ // install (e.g. fresh git-clone before npm install).
36
+ const localTsup = join(dir, "node_modules", ".bin", "tsup");
37
+ const candidates = existsSync(localTsup)
38
+ ? [
39
+ [process.execPath, [localTsup]],
40
+ ["npx", ["tsup"]],
41
+ ["bunx", ["tsup"]],
42
+ ]
43
+ : [
44
+ ["npx", ["tsup"]],
45
+ ["bunx", ["tsup"]],
46
+ ];
47
+ for (const [cmd, args] of candidates) {
48
+ const { status } = spawnSync(cmd, args, {
49
+ stdio: "inherit",
50
+ shell: true,
51
+ cwd: dir,
52
+ });
53
+ if (status === 0) break;
54
+ }
55
+ }
56
+ process.exit(0);
57
+ }
58
+
59
+ // Spawn the target as a subprocess so it runs as the entry point.
60
+ // Dynamic import() would set import.meta.main = false, causing
61
+ // runDispatchCli to return early without executing anything.
62
+ const target = existsSync(join(dir, "dist", "cli.js"))
63
+ ? join(dir, "dist", "cli.js")
64
+ : join(dir, "cli.ts");
65
+
66
+ const { status } = spawnSync(
67
+ process.execPath,
68
+ [target, ...process.argv.slice(2)],
69
+ { stdio: "inherit" },
70
+ );
71
+ process.exit(status ?? 1);
package/cli.ts ADDED
@@ -0,0 +1,5 @@
1
+ import { runDispatchCli } from "@zapier/connectors-sdk";
2
+
3
+ import connector from "./index.ts";
4
+
5
+ await runDispatchCli(import.meta, connector);
package/connections.ts ADDED
@@ -0,0 +1,26 @@
1
+ import {
2
+ defineEnvPrefixResolver,
3
+ zapierConnectionResolver,
4
+ } from "@zapier/connectors-sdk";
5
+
6
+ const TRELLO_OAUTH_HEADER = (apiKey: string, token: string) =>
7
+ `OAuth oauth_consumer_key="${apiKey}", oauth_token="${token}"`;
8
+
9
+ const directTrelloResolver = defineEnvPrefixResolver({
10
+ name: "env",
11
+ keys: ["API_KEY", "TOKEN"] as const,
12
+ build: ({ API_KEY, TOKEN }) => {
13
+ const authorization = TRELLO_OAUTH_HEADER(API_KEY, TOKEN);
14
+ return (url, init = {}) => {
15
+ const headers = new Headers(init.headers);
16
+ headers.set("Authorization", authorization);
17
+ return globalThis.fetch(url, { ...init, headers });
18
+ };
19
+ },
20
+ });
21
+
22
+ // Trello OAuth 1.0a — one connection slot. Managed auth via Zapier; direct mode uses
23
+ // TRELLO_API_KEY + TRELLO_TOKEN (pass --connection env:TRELLO when both are set).
24
+ export const connectionResolvers = {
25
+ trello: [zapierConnectionResolver, directTrelloResolver],
26
+ } as const;
package/dist/cli.js ADDED
@@ -0,0 +1,4 @@
1
+ // cli.ts
2
+ import { runDispatchCli } from "@zapier/connectors-sdk";
3
+ import connector from "./index.js";
4
+ await runDispatchCli(import.meta, connector);