@geeveeh/atlassian-tools 0.2.0 → 0.4.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 (56) hide show
  1. package/README.md +156 -26
  2. package/dist/cli/confluence.d.ts.map +1 -1
  3. package/dist/cli/confluence.js +424 -9
  4. package/dist/cli/confluence.js.map +1 -1
  5. package/dist/cli/jira.d.ts.map +1 -1
  6. package/dist/cli/jira.js +518 -2
  7. package/dist/cli/jira.js.map +1 -1
  8. package/dist/confluence/client.d.ts +15 -1
  9. package/dist/confluence/client.d.ts.map +1 -1
  10. package/dist/confluence/client.js +114 -0
  11. package/dist/confluence/client.js.map +1 -1
  12. package/dist/confluence/index.d.ts +1 -0
  13. package/dist/confluence/index.d.ts.map +1 -1
  14. package/dist/confluence/index.js +1 -0
  15. package/dist/confluence/index.js.map +1 -1
  16. package/dist/confluence/markdown.d.ts +15 -0
  17. package/dist/confluence/markdown.d.ts.map +1 -0
  18. package/dist/confluence/markdown.js +83 -0
  19. package/dist/confluence/markdown.js.map +1 -0
  20. package/dist/confluence/types.d.ts +91 -0
  21. package/dist/confluence/types.d.ts.map +1 -1
  22. package/dist/core/auth.d.ts.map +1 -1
  23. package/dist/core/auth.js +54 -10
  24. package/dist/core/auth.js.map +1 -1
  25. package/dist/core/client.d.ts.map +1 -1
  26. package/dist/core/client.js +57 -18
  27. package/dist/core/client.js.map +1 -1
  28. package/dist/core/index.d.ts +1 -1
  29. package/dist/core/index.d.ts.map +1 -1
  30. package/dist/core/index.js +1 -1
  31. package/dist/core/index.js.map +1 -1
  32. package/dist/core/mime.d.ts +2 -0
  33. package/dist/core/mime.d.ts.map +1 -0
  34. package/dist/core/mime.js +21 -0
  35. package/dist/core/mime.js.map +1 -0
  36. package/dist/jira/client.d.ts +20 -1
  37. package/dist/jira/client.d.ts.map +1 -1
  38. package/dist/jira/client.js +127 -0
  39. package/dist/jira/client.js.map +1 -1
  40. package/dist/jira/types.d.ts +115 -0
  41. package/dist/jira/types.d.ts.map +1 -1
  42. package/dist/mcp/confluence.d.ts +3 -0
  43. package/dist/mcp/confluence.d.ts.map +1 -0
  44. package/dist/mcp/confluence.js +405 -0
  45. package/dist/mcp/confluence.js.map +1 -0
  46. package/dist/mcp/helpers.d.ts +3 -0
  47. package/dist/mcp/helpers.d.ts.map +1 -0
  48. package/dist/mcp/helpers.js +15 -0
  49. package/dist/mcp/helpers.js.map +1 -0
  50. package/dist/mcp/index.js +8 -354
  51. package/dist/mcp/index.js.map +1 -1
  52. package/dist/mcp/jira.d.ts +3 -0
  53. package/dist/mcp/jira.d.ts.map +1 -0
  54. package/dist/mcp/jira.js +479 -0
  55. package/dist/mcp/jira.js.map +1 -0
  56. package/package.json +3 -3
package/README.md CHANGED
@@ -4,8 +4,8 @@ CLI and MCP server for Atlassian Cloud. Manage Confluence pages and Jira issues
4
4
 
5
5
  ## Features
6
6
 
7
- - **Confluence** — Full CRUD for pages: search, read, create, update, delete
8
- - **Jira** — Issues: search (JQL), view, create, update, transition, delete
7
+ - **Confluence** — Pages: search (space-scoped or full CQL), read, create (from content or template), copy, update, delete; plus comments, labels, attachments, and child pages
8
+ - **Jira** — Issues: search (JQL), view, create (with subtask support), update, transition, delete; plus comments, attachments, issue links, work logs, epics, boards, sprints, and user search
9
9
  - **Shared auth** — One set of credentials (`ATLASSIAN_URL`, `ATLASSIAN_EMAIL`, `ATLASSIAN_TOKEN`) for all products
10
10
  - **CLI** — `atlassian` command with product subcommands, interactive confirmations, coloured output
11
11
  - **MCP server** — Expose all operations as tools for AI agents (Claude Code, etc.)
@@ -38,30 +38,70 @@ Generate an API token at https://id.atlassian.com/manage-profile/security/api-to
38
38
 
39
39
  ## CLI usage
40
40
 
41
+ All write/delete commands prompt for confirmation. Pass `-y` to skip (useful in scripts).
42
+
41
43
  ### Confluence
42
44
 
43
45
  ```bash
44
46
  # Verify connection
45
47
  atlassian confluence auth
46
48
 
47
- # List spaces
49
+ # Spaces
48
50
  atlassian confluence spaces
51
+ atlassian confluence spaces --limit 50
49
52
 
50
53
  # Read a page
51
54
  atlassian confluence read 12345678
52
55
  atlassian confluence read 12345678 --json
53
56
 
54
57
  # Search pages in a space
58
+ atlassian confluence search -s DEV
55
59
  atlassian confluence search -s DEV -t "Architecture"
56
60
 
61
+ # CQL search — full-text across all spaces, label filters, date ranges, etc.
62
+ atlassian confluence cql 'type=page AND text ~ "kubernetes"'
63
+ atlassian confluence cql 'type=page AND label = "approved" AND space.key = "DEV"'
64
+ atlassian confluence cql 'type=page AND lastModified > "2024-01-01"' --limit 10
65
+
66
+ # List child pages
67
+ atlassian confluence children 12345678
68
+
69
+ # List available templates
70
+ atlassian confluence templates
71
+ atlassian confluence templates -s DEV
72
+
57
73
  # Create a page (prompts for confirmation)
58
74
  atlassian confluence create -s DEV -t "New RFC" -f proposal.md
75
+ atlassian confluence create -s DEV -t "New RFC" -f proposal.md --parent 87654321
76
+ atlassian confluence create -s DEV -t "Draft" -f draft.md --draft
77
+ # Create from a template
78
+ atlassian confluence create -s DEV -t "Q3 Retro" --template "Retrospective"
79
+ atlassian confluence create -s DEV -t "Meeting" --template "Meeting Notes" --parent 87654321
59
80
 
60
81
  # Update a page
61
82
  atlassian confluence update 12345678 -f updated.md -m "Revised section 3"
83
+ atlassian confluence update 12345678 -t "New Title"
84
+
85
+ # Copy a page
86
+ atlassian confluence copy 12345678 -t "Copy of RFC" -d 87654321
87
+ atlassian confluence copy 12345678 -t "Copy of RFC" -d 87654321 --attachments --labels
62
88
 
63
89
  # Delete a page
64
90
  atlassian confluence delete 12345678
91
+
92
+ # Comments
93
+ atlassian confluence comments 12345678
94
+ atlassian confluence comment 12345678 -t "Looks good, approved."
95
+
96
+ # Labels
97
+ atlassian confluence labels 12345678
98
+ atlassian confluence add-label 12345678 rfc approved
99
+ atlassian confluence remove-label 12345678 rfc
100
+
101
+ # Attachments
102
+ atlassian confluence attachments 12345678
103
+ atlassian confluence attach 12345678 /path/to/screenshot.png
104
+ atlassian confluence attach 12345678 /path/to/diagram.pdf -c "Architecture diagram v2"
65
105
  ```
66
106
 
67
107
  ### Jira
@@ -70,12 +110,14 @@ atlassian confluence delete 12345678
70
110
  # Verify connection
71
111
  atlassian jira auth
72
112
 
73
- # List projects
113
+ # Projects
74
114
  atlassian jira projects
115
+ atlassian jira projects --limit 50
75
116
 
76
117
  # Search issues
77
118
  atlassian jira list --project CARD --status "In Progress"
78
119
  atlassian jira list --jql 'assignee = currentUser() AND status != Done'
120
+ atlassian jira list --type Bug --limit 10
79
121
 
80
122
  # View an issue
81
123
  atlassian jira view CARD-42
@@ -83,19 +125,53 @@ atlassian jira view CARD-42 --json
83
125
 
84
126
  # Create an issue (prompts for confirmation)
85
127
  atlassian jira create --project CARD --type Bug --summary "Fix login"
128
+ atlassian jira create --project CARD --type Task --summary "Set up CI" --priority High
129
+ # Create a subtask
130
+ atlassian jira create --project CARD --type Subtask --summary "Write tests" --parent CARD-42
86
131
 
87
132
  # Update an issue
88
133
  atlassian jira update CARD-42 --priority High --summary "Fix login regression"
134
+ atlassian jira update CARD-42 --labels "critical,frontend"
89
135
 
90
136
  # Transition an issue
137
+ atlassian jira transition CARD-42 --list # show available transitions
91
138
  atlassian jira transition CARD-42 --to "In Progress"
92
- atlassian jira transition CARD-42 --list # show available transitions
93
139
 
94
140
  # Delete an issue
95
141
  atlassian jira delete CARD-42
96
- ```
97
142
 
98
- All write/delete commands prompt for confirmation. Pass `-y` to skip (useful in scripts).
143
+ # Comments
144
+ atlassian jira comments CARD-42
145
+ atlassian jira comment CARD-42 -t "Blocked on CARD-10, see discussion."
146
+
147
+ # Issue links
148
+ atlassian jira link-types # show available link types
149
+ atlassian jira links CARD-42 # list links on an issue
150
+ atlassian jira link CARD-42 --type "Blocks" --target CARD-99
151
+ atlassian jira link CARD-42 --type "Relates to" --target CARD-7
152
+
153
+ # Work logs
154
+ atlassian jira worklogs CARD-42
155
+ atlassian jira log CARD-42 --time "2h 30m"
156
+ atlassian jira log CARD-42 --time "1d" --comment "Implemented auth flow"
157
+
158
+ # Attachments
159
+ atlassian jira attachments CARD-42
160
+ atlassian jira attach CARD-42 /path/to/screenshot.png
161
+
162
+ # User search (find accountIds for assignee)
163
+ atlassian jira users "Jane Smith"
164
+ atlassian jira users "jane@"
165
+
166
+ # Epics
167
+ atlassian jira epic CARD-5 # list all issues in an epic
168
+
169
+ # Boards & sprints
170
+ atlassian jira boards
171
+ atlassian jira sprints 42 # list sprints on board 42
172
+ atlassian jira sprints 42 --state active
173
+ atlassian jira move-to-sprint 10 CARD-42 CARD-43 # move issues to sprint 10
174
+ ```
99
175
 
100
176
  ## MCP server usage
101
177
 
@@ -138,28 +214,54 @@ Or without a global install:
138
214
 
139
215
  #### Confluence
140
216
 
141
- | Tool | Description | Confirmation needed |
142
- |----------------------------|--------------------------------------|---------------------|
143
- | `confluence_auth` | Verify connection | No |
144
- | `confluence_list_spaces` | List spaces | No |
145
- | `confluence_read_page` | Read page content by ID | No |
146
- | `confluence_search_pages` | Search by space key and title | No |
147
- | `confluence_create_page` | Create a new page | **Yes** |
148
- | `confluence_update_page` | Update an existing page | **Yes** |
149
- | `confluence_delete_page` | Delete a page | **Yes** |
217
+ | Tool | Description | Confirmation needed |
218
+ |-----------------------------------|---------------------------------------------|---------------------|
219
+ | `confluence_auth` | Verify connection | No |
220
+ | `confluence_list_spaces` | List spaces | No |
221
+ | `confluence_read_page` | Read page content by ID | No |
222
+ | `confluence_search_pages` | Search by space key and title | No |
223
+ | `confluence_search_cql` | Full-text CQL search across all spaces | No |
224
+ | `confluence_list_templates` | List page templates for a space or globally | No |
225
+ | `confluence_list_child_pages` | List child pages of a page | No |
226
+ | `confluence_create_page` | Create a new page (supports `templateName`) | **Yes** |
227
+ | `confluence_copy_page` | Copy a page to a new location | **Yes** |
228
+ | `confluence_update_page` | Update an existing page | **Yes** |
229
+ | `confluence_delete_page` | Delete a page | **Yes** |
230
+ | `confluence_list_comments` | List comments on a page | No |
231
+ | `confluence_add_comment` | Add a comment to a page | **Yes** |
232
+ | `confluence_list_labels` | List labels on a page | No |
233
+ | `confluence_add_labels` | Add labels to a page | **Yes** |
234
+ | `confluence_remove_label` | Remove a label from a page | **Yes** |
235
+ | `confluence_list_attachments` | List attachments on a page | No |
236
+ | `confluence_upload_attachment` | Upload a file as an attachment to a page | **Yes** |
150
237
 
151
238
  #### Jira
152
239
 
153
- | Tool | Description | Confirmation needed |
154
- |----------------------------|--------------------------------------|---------------------|
155
- | `jira_auth` | Verify connection | No |
156
- | `jira_list_projects` | List projects | No |
157
- | `jira_get_issue` | Get issue details by key | No |
158
- | `jira_search_issues` | Search with JQL or filters | No |
159
- | `jira_create_issue` | Create a new issue | **Yes** |
160
- | `jira_update_issue` | Update an existing issue | **Yes** |
161
- | `jira_transition_issue` | Transition issue status | **Yes** |
162
- | `jira_delete_issue` | Delete an issue | **Yes** |
240
+ | Tool | Description | Confirmation needed |
241
+ |-----------------------------------|---------------------------------------------|---------------------|
242
+ | `jira_auth` | Verify connection | No |
243
+ | `jira_list_projects` | List projects | No |
244
+ | `jira_get_issue` | Get issue details by key | No |
245
+ | `jira_search_issues` | Search with JQL or filters | No |
246
+ | `jira_create_issue` | Create a new issue (supports `parentKey` for subtasks) | **Yes** |
247
+ | `jira_update_issue` | Update an existing issue | **Yes** |
248
+ | `jira_transition_issue` | Transition issue status | **Yes** |
249
+ | `jira_delete_issue` | Delete an issue | **Yes** |
250
+ | `jira_list_comments` | List comments on an issue | No |
251
+ | `jira_add_comment` | Add a comment to an issue | **Yes** |
252
+ | `jira_list_link_types` | List available issue link types | No |
253
+ | `jira_list_issue_links` | List links on an issue | No |
254
+ | `jira_link_issues` | Link two issues together | **Yes** |
255
+ | `jira_remove_issue_link` | Remove a link between two issues | **Yes** |
256
+ | `jira_list_worklogs` | List work log entries on an issue | No |
257
+ | `jira_log_work` | Log time worked on an issue | **Yes** |
258
+ | `jira_list_attachments` | List attachments on an issue | No |
259
+ | `jira_upload_attachment` | Upload a file as an attachment to an issue | **Yes** |
260
+ | `jira_search_users` | Search users by name or email (for accountIds) | No |
261
+ | `jira_list_epic_issues` | List all issues in an epic | No |
262
+ | `jira_list_boards` | List Scrum and Kanban boards | No |
263
+ | `jira_list_sprints` | List sprints on a board | No |
264
+ | `jira_move_to_sprint` | Move issues to a sprint | **Yes** |
163
265
 
164
266
  ## Project structure
165
267
 
@@ -177,6 +279,7 @@ src/
177
279
  │ └── index.ts # Barrel export
178
280
  ├── jira/ # Jira-specific client + types
179
281
  │ ├── client.ts # Jira REST API v3 client
282
+ │ ├── helpers.ts # ADF conversion + JQL builder
180
283
  │ ├── types.ts # Jira interfaces
181
284
  │ └── index.ts # Barrel export
182
285
  ├── cli/ # Commander.js with product subcommands
@@ -199,8 +302,35 @@ const config = loadConfigFromEnv();
199
302
  const confluence = new ConfluenceClient(config);
200
303
  const jira = new JiraClient(config);
201
304
 
305
+ // Pages
202
306
  const pages = await confluence.searchPages({ spaceKey: "DEV", title: "RFC" });
307
+ const results = await confluence.searchCQL('type=page AND text ~ "kubernetes"');
308
+ const children = await confluence.listChildPages("12345678");
309
+ const templates = await confluence.listTemplates("DEV");
310
+ const copy = await confluence.copyPage({ pageId: "12345678", title: "Copy of RFC", destinationPageId: "87654321" });
311
+
312
+ // Comments & labels
313
+ await confluence.addComment("12345678", "<p>Approved.</p>");
314
+ await confluence.addLabels("12345678", ["approved", "published"]);
315
+
316
+ // Attachments
317
+ await confluence.uploadAttachment({ pageId: "12345678", filePath: "/tmp/diagram.png" });
318
+
319
+ // Jira issues
203
320
  const issues = await jira.searchIssues({ project: "CARD", status: "In Progress" });
321
+ const epicIssues = await jira.listEpicIssues("CARD-5");
322
+ await jira.addComment("CARD-42", "Blocked on infra, see CARD-10.");
323
+ await jira.linkIssues("CARD-42", "Blocks", "CARD-99");
324
+ await jira.addWorklog({ issueKey: "CARD-42", timeSpent: "2h", comment: "Auth implementation" });
325
+ await jira.uploadAttachment({ issueKey: "CARD-42", filePath: "/tmp/screenshot.png" });
326
+
327
+ // Boards & sprints
328
+ const boards = await jira.listBoards();
329
+ const sprints = await jira.listSprints(boards[0].id, "active");
330
+ await jira.moveToSprint(sprints[0].id, ["CARD-42", "CARD-43"]);
331
+
332
+ // User search
333
+ const users = await jira.searchUsers("Jane Smith");
204
334
  ```
205
335
 
206
336
  ## Development
@@ -1 +1 @@
1
- {"version":3,"file":"confluence.d.ts","sourceRoot":"","sources":["../../src/cli/confluence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBpC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,QAuM1D"}
1
+ {"version":3,"file":"confluence.d.ts","sourceRoot":"","sources":["../../src/cli/confluence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBpC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,QA6lB1D"}