confluence-cli 1.19.0 → 1.21.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.
@@ -0,0 +1,610 @@
1
+ # confluence-cli Skill
2
+
3
+ A CLI tool for Atlassian Confluence. Lets you read, search, create, update, move, and delete pages and attachments from the terminal or from an agent.
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ npm install -g confluence-cli
9
+ confluence --version # verify install
10
+ ```
11
+
12
+ ## Configuration
13
+
14
+ **Preferred for agents — environment variables (no interactive prompt):**
15
+
16
+ | Variable | Description | Example |
17
+ |---|---|---|
18
+ | `CONFLUENCE_DOMAIN` | Your Confluence hostname | `company.atlassian.net` |
19
+ | `CONFLUENCE_API_PATH` | REST API base path | `/wiki/rest/api` (Cloud) or `/rest/api` (Server/DC) |
20
+ | `CONFLUENCE_AUTH_TYPE` | `basic` or `bearer` | `basic` |
21
+ | `CONFLUENCE_EMAIL` | Email address (basic auth only) | `user@company.com` |
22
+ | `CONFLUENCE_API_TOKEN` | API token or personal access token | `ATATT3x...` |
23
+
24
+ **Non-interactive init (good for CI/CD scripts):**
25
+
26
+ ```sh
27
+ confluence init \
28
+ --domain "company.atlassian.net" \
29
+ --api-path "/wiki/rest/api" \
30
+ --auth-type basic \
31
+ --email "user@company.com" \
32
+ --token "ATATT3x..."
33
+ ```
34
+
35
+ **Cloud vs Server/DC:**
36
+ - Atlassian Cloud (`*.atlassian.net`): use `--api-path "/wiki/rest/api"`, auth type `basic` with email + API token
37
+ - Self-hosted / Data Center: use `--api-path "/rest/api"`, auth type `bearer` with a personal access token (no email needed)
38
+
39
+ ## Page ID Resolution
40
+
41
+ Most commands accept `<pageId>` — a numeric ID or any of the supported URL formats below.
42
+
43
+ **Supported formats:**
44
+
45
+ | Format | Example |
46
+ |---|---|
47
+ | Numeric ID | `123456789` |
48
+ | `?pageId=` URL | `https://company.atlassian.net/wiki/viewpage.action?pageId=123456789` |
49
+ | Pretty `/pages/<id>` URL | `https://company.atlassian.net/wiki/spaces/SPACE/pages/123456789/Page+Title` |
50
+ | Display `/display/<space>/<title>` URL | `https://company.atlassian.net/wiki/display/SPACE/Page+Title` |
51
+
52
+ ```sh
53
+ confluence read 123456789
54
+ confluence read "https://company.atlassian.net/wiki/viewpage.action?pageId=123456789"
55
+ confluence read "https://company.atlassian.net/wiki/spaces/MYSPACE/pages/123456789/My+Page"
56
+ ```
57
+
58
+ > **Note:** Display-style URLs (`/display/<space>/<title>`) perform a title-based lookup, so the page title in the URL must match exactly. When possible, prefer numeric IDs or `/pages/<id>` URLs for reliability.
59
+
60
+ ## Content Formats
61
+
62
+ | Format | Notes |
63
+ |---|---|
64
+ | `markdown` | Recommended for agent-generated content. Automatically converted by the API. |
65
+ | `storage` | Confluence XML storage format (default for create/update). Use for programmatic round-trips. |
66
+ | `html` | Raw HTML. |
67
+ | `text` | Plain text — for read/export output only, not for creation. |
68
+
69
+ ---
70
+
71
+ ## Commands Reference
72
+
73
+ ### `init`
74
+
75
+ Initialize configuration. Saves credentials to `~/.confluence-cli/config.json`.
76
+
77
+ ```sh
78
+ confluence init [--domain <domain>] [--api-path <path>] [--auth-type basic|bearer] [--email <email>] [--token <token>]
79
+ ```
80
+
81
+ All flags are optional; omitting any flag triggers an interactive prompt for that field. Provide all flags to run fully non-interactive.
82
+
83
+ ---
84
+
85
+ ### `read <pageId>`
86
+
87
+ Read page content. Outputs to stdout.
88
+
89
+ ```sh
90
+ confluence read <pageId> [--format html|text|markdown]
91
+ ```
92
+
93
+ | Option | Default | Description |
94
+ |---|---|---|
95
+ | `--format` | `text` | Output format: `html`, `text`, or `markdown` |
96
+
97
+ ```sh
98
+ confluence read 123456789
99
+ confluence read 123456789 --format markdown
100
+ ```
101
+
102
+ ---
103
+
104
+ ### `info <pageId>`
105
+
106
+ Get page metadata (title, ID, type, status, space).
107
+
108
+ ```sh
109
+ confluence info <pageId>
110
+ ```
111
+
112
+ ```sh
113
+ confluence info 123456789
114
+ ```
115
+
116
+ ---
117
+
118
+ ### `find <title>`
119
+
120
+ Find a page by exact or partial title. Returns the first match.
121
+
122
+ ```sh
123
+ confluence find <title> [--space <spaceKey>]
124
+ ```
125
+
126
+ | Option | Description |
127
+ |---|---|
128
+ | `--space` | Restrict search to a specific space key |
129
+
130
+ ```sh
131
+ confluence find "Architecture Overview"
132
+ confluence find "API Reference" --space MYSPACE
133
+ ```
134
+
135
+ ---
136
+
137
+ ### `search <query>`
138
+
139
+ Search pages using a keyword or CQL expression.
140
+
141
+ ```sh
142
+ confluence search <query> [--limit <number>]
143
+ ```
144
+
145
+ | Option | Default | Description |
146
+ |---|---|---|
147
+ | `--limit` | `10` | Maximum number of results |
148
+
149
+ ```sh
150
+ confluence search "deployment pipeline"
151
+ confluence search "type=page AND space=MYSPACE" --limit 50
152
+ ```
153
+
154
+ ---
155
+
156
+ ### `spaces`
157
+
158
+ List all accessible Confluence spaces (key and name).
159
+
160
+ ```sh
161
+ confluence spaces
162
+ ```
163
+
164
+ ---
165
+
166
+ ### `children <pageId>`
167
+
168
+ List child pages of a page.
169
+
170
+ ```sh
171
+ confluence children <pageId> [--recursive] [--max-depth <number>] [--format list|tree|json] [--show-id] [--show-url]
172
+ ```
173
+
174
+ | Option | Default | Description |
175
+ |---|---|---|
176
+ | `--recursive` | false | List all descendants recursively |
177
+ | `--max-depth` | `10` | Maximum depth for recursive listing |
178
+ | `--format` | `list` | Output format: `list`, `tree`, or `json` |
179
+ | `--show-id` | false | Show page IDs |
180
+ | `--show-url` | false | Show page URLs |
181
+
182
+ ```sh
183
+ confluence children 123456789
184
+ confluence children 123456789 --recursive --format json
185
+ confluence children 123456789 --recursive --format tree --show-id
186
+ ```
187
+
188
+ ---
189
+
190
+ ### `create <title> <spaceKey>`
191
+
192
+ Create a new top-level page in a space.
193
+
194
+ ```sh
195
+ confluence create <title> <spaceKey> [--content <string>] [--file <path>] [--format storage|html|markdown]
196
+ ```
197
+
198
+ | Option | Default | Description |
199
+ |---|---|---|
200
+ | `--content` | — | Inline content string |
201
+ | `--file` | — | Path to content file |
202
+ | `--format` | `storage` | Content format |
203
+
204
+ Either `--content` or `--file` is required.
205
+
206
+ ```sh
207
+ confluence create "Project Overview" MYSPACE --content "# Hello" --format markdown
208
+ confluence create "Release Notes" MYSPACE --file ./notes.md --format markdown
209
+ ```
210
+
211
+ Outputs the new page ID and URL on success.
212
+
213
+ ---
214
+
215
+ ### `create-child <title> <parentId>`
216
+
217
+ Create a child page under an existing page. Inherits the parent's space automatically.
218
+
219
+ ```sh
220
+ confluence create-child <title> <parentId> [--content <string>] [--file <path>] [--format storage|html|markdown]
221
+ ```
222
+
223
+ Options are identical to `create`. Either `--content` or `--file` is required.
224
+
225
+ ```sh
226
+ confluence create-child "Chapter 1" 123456789 --content "Content here" --format markdown
227
+ confluence create-child "API Guide" 123456789 --file ./api.md --format markdown
228
+ ```
229
+
230
+ ---
231
+
232
+ ### `update <pageId>`
233
+
234
+ Update an existing page's title and/or content. At least one of `--title`, `--content`, or `--file` is required.
235
+
236
+ ```sh
237
+ confluence update <pageId> [--title <title>] [--content <string>] [--file <path>] [--format storage|html|markdown]
238
+ ```
239
+
240
+ | Option | Default | Description |
241
+ |---|---|---|
242
+ | `--title` | — | New title |
243
+ | `--content` | — | Inline content string |
244
+ | `--file` | — | Path to content file |
245
+ | `--format` | `storage` | Content format |
246
+
247
+ ```sh
248
+ confluence update 123456789 --title "New Title"
249
+ confluence update 123456789 --file ./updated.md --format markdown
250
+ confluence update 123456789 --title "New Title" --file ./updated.xml --format storage
251
+ ```
252
+
253
+ ---
254
+
255
+ ### `move <pageId_or_url> <newParentId_or_url>`
256
+
257
+ Move a page to a new parent. Both pages must be in the same space.
258
+
259
+ ```sh
260
+ confluence move <pageId_or_url> <newParentId_or_url> [--title <newTitle>]
261
+ ```
262
+
263
+ | Option | Description |
264
+ |---|---|
265
+ | `--title` | Rename the page during the move |
266
+
267
+ ```sh
268
+ confluence move 123456789 987654321
269
+ confluence move 123456789 987654321 --title "Renamed After Move"
270
+ ```
271
+
272
+ ---
273
+
274
+ ### `delete <pageIdOrUrl>`
275
+
276
+ Delete (trash) a page by ID or URL.
277
+
278
+ ```sh
279
+ confluence delete <pageIdOrUrl> [--yes]
280
+ ```
281
+
282
+ | Option | Description |
283
+ |---|---|
284
+ | `--yes` | Skip confirmation prompt (required for non-interactive/agent use) |
285
+
286
+ ```sh
287
+ confluence delete 123456789 --yes
288
+ ```
289
+
290
+ ---
291
+
292
+ ### `edit <pageId>`
293
+
294
+ Fetch a page's raw storage-format content for editing locally.
295
+
296
+ ```sh
297
+ confluence edit <pageId> [--output <file>]
298
+ ```
299
+
300
+ | Option | Description |
301
+ |---|---|
302
+ | `--output` | Save content to a file (instead of printing to stdout) |
303
+
304
+ ```sh
305
+ confluence edit 123456789 --output ./page.xml
306
+ # Edit page.xml, then:
307
+ confluence update 123456789 --file ./page.xml --format storage
308
+ ```
309
+
310
+ ---
311
+
312
+ ### `export <pageId>`
313
+
314
+ Export a page and its attachments to a local directory.
315
+
316
+ ```sh
317
+ confluence export <pageId> [--format html|text|markdown] [--dest <directory>] [--file <filename>] [--attachments-dir <name>] [--pattern <glob>] [--referenced-only] [--skip-attachments]
318
+ ```
319
+
320
+ | Option | Default | Description |
321
+ |---|---|---|
322
+ | `--format` | `markdown` | Content format for the exported file |
323
+ | `--dest` | `.` | Base directory to export into |
324
+ | `--file` | `page.<ext>` | Filename for the content file |
325
+ | `--attachments-dir` | `attachments` | Subdirectory name for attachments |
326
+ | `--pattern` | — | Glob filter for attachments (e.g. `*.png`) |
327
+ | `--referenced-only` | false | Only download attachments referenced in the page content |
328
+ | `--skip-attachments` | false | Do not download attachments |
329
+
330
+ ```sh
331
+ confluence export 123456789 --format markdown --dest ./docs
332
+ confluence export 123456789 --format markdown --dest ./docs --skip-attachments
333
+ confluence export 123456789 --pattern "*.png" --dest ./output
334
+ ```
335
+
336
+ Creates a subdirectory named after the page title under `--dest`.
337
+
338
+ ---
339
+
340
+ ### `attachments <pageId>`
341
+
342
+ List or download attachments for a page.
343
+
344
+ ```sh
345
+ confluence attachments <pageId> [--limit <n>] [--pattern <glob>] [--download] [--dest <directory>]
346
+ ```
347
+
348
+ | Option | Default | Description |
349
+ |---|---|---|
350
+ | `--limit` | all | Maximum number of attachments to fetch |
351
+ | `--pattern` | — | Filter by filename glob (e.g. `*.pdf`) |
352
+ | `--download` | false | Download matching attachments |
353
+ | `--dest` | `.` | Directory to save downloads |
354
+
355
+ ```sh
356
+ confluence attachments 123456789
357
+ confluence attachments 123456789 --pattern "*.pdf" --download --dest ./downloads
358
+ ```
359
+
360
+ ---
361
+
362
+ ### `attachment-upload <pageId>`
363
+
364
+ Upload one or more files to a page. `--file` can be repeated for multiple files.
365
+
366
+ ```sh
367
+ confluence attachment-upload <pageId> --file <path> [--file <path> ...] [--comment <text>] [--replace] [--minor-edit]
368
+ ```
369
+
370
+ | Option | Description |
371
+ |---|---|
372
+ | `--file` | File to upload (required, repeatable) |
373
+ | `--comment` | Comment for the attachment(s) |
374
+ | `--replace` | Replace an existing attachment with the same filename |
375
+ | `--minor-edit` | Mark the upload as a minor edit |
376
+
377
+ ```sh
378
+ confluence attachment-upload 123456789 --file ./report.pdf
379
+ confluence attachment-upload 123456789 --file ./a.png --file ./b.png --replace
380
+ ```
381
+
382
+ ---
383
+
384
+ ### `attachment-delete <pageId> <attachmentId>`
385
+
386
+ Delete an attachment from a page.
387
+
388
+ ```sh
389
+ confluence attachment-delete <pageId> <attachmentId> [--yes]
390
+ ```
391
+
392
+ | Option | Description |
393
+ |---|---|
394
+ | `--yes` | Skip confirmation prompt |
395
+
396
+ ```sh
397
+ confluence attachment-delete 123456789 att-987 --yes
398
+ ```
399
+
400
+ ---
401
+
402
+ ### `comments <pageId>`
403
+
404
+ List comments for a page.
405
+
406
+ ```sh
407
+ confluence comments <pageId> [--format text|markdown|json] [--limit <n>] [--start <n>] [--location inline,footer,resolved] [--depth all] [--all]
408
+ ```
409
+
410
+ | Option | Default | Description |
411
+ |---|---|---|
412
+ | `--format` | `text` | Output format: `text`, `markdown`, or `json` |
413
+ | `--limit` | `25` | Maximum comments per page |
414
+ | `--start` | `0` | Start index for pagination |
415
+ | `--location` | — | Filter by location: `inline`, `footer`, `resolved` (comma-separated) |
416
+ | `--depth` | — | Leave empty for root-only; `all` for all nested replies |
417
+ | `--all` | false | Fetch all comments (ignores pagination) |
418
+
419
+ ```sh
420
+ confluence comments 123456789
421
+ confluence comments 123456789 --format json --all
422
+ confluence comments 123456789 --location footer --depth all
423
+ ```
424
+
425
+ ---
426
+
427
+ ### `comment <pageId>`
428
+
429
+ Create a comment on a page (footer or inline).
430
+
431
+ ```sh
432
+ confluence comment <pageId> [--content <string>] [--file <path>] [--format storage|html|markdown] [--parent <commentId>] [--location footer|inline] [--inline-selection <text>] [--inline-original-selection <text>] [--inline-marker-ref <ref>] [--inline-properties <json>]
433
+ ```
434
+
435
+ | Option | Default | Description |
436
+ |---|---|---|
437
+ | `--content` | — | Inline content string |
438
+ | `--file` | — | Path to content file |
439
+ | `--format` | `storage` | Content format |
440
+ | `--parent` | — | Reply to a comment by ID |
441
+ | `--location` | `footer` | `footer` or `inline` |
442
+ | `--inline-selection` | — | Highlighted selection text (inline only) |
443
+ | `--inline-original-selection` | — | Original selection text (inline only) |
444
+ | `--inline-marker-ref` | — | Marker reference (inline only) |
445
+ | `--inline-properties` | — | Full inline properties as JSON (advanced) |
446
+
447
+ Either `--content` or `--file` is required.
448
+
449
+ ```sh
450
+ confluence comment 123456789 --content "Looks good!" --location footer
451
+ confluence comment 123456789 --content "See note" --parent 456 --location footer
452
+ ```
453
+
454
+ > **Note on inline comments**: Creating a brand-new inline comment requires editor highlight metadata (`matchIndex`, `lastFetchTime`, `serializedHighlights`) that is only available in the Confluence editor. This metadata is not accessible via the REST API, so inline comment creation will typically fail with a 400 error. Use `--location footer` or reply to an existing inline comment with `--parent <commentId>` instead.
455
+
456
+ ---
457
+
458
+ ### `comment-delete <commentId>`
459
+
460
+ Delete a comment by its ID.
461
+
462
+ ```sh
463
+ confluence comment-delete <commentId> [--yes]
464
+ ```
465
+
466
+ | Option | Description |
467
+ |---|---|
468
+ | `--yes` | Skip confirmation prompt |
469
+
470
+ ```sh
471
+ confluence comment-delete 456789 --yes
472
+ ```
473
+
474
+ ---
475
+
476
+ ### `copy-tree <sourcePageId> <targetParentId> [newTitle]`
477
+
478
+ Copy a page and all its children to a new location.
479
+
480
+ ```sh
481
+ confluence copy-tree <sourcePageId> <targetParentId> [newTitle] [--max-depth <depth>] [--exclude <patterns>] [--delay-ms <ms>] [--copy-suffix <suffix>] [--dry-run] [--fail-on-error] [--quiet]
482
+ ```
483
+
484
+ | Option | Default | Description |
485
+ |---|---|---|
486
+ | `--max-depth` | `10` | Maximum depth to copy |
487
+ | `--exclude` | — | Comma-separated title patterns to exclude (supports wildcards) |
488
+ | `--delay-ms` | `100` | Delay between sibling creations in ms |
489
+ | `--copy-suffix` | `" (Copy)"` | Suffix appended to the root page title |
490
+ | `--dry-run` | false | Preview operations without creating pages |
491
+ | `--fail-on-error` | false | Exit with non-zero code if any page fails |
492
+ | `--quiet` | false | Suppress progress output |
493
+
494
+ ```sh
495
+ # Preview first
496
+ confluence copy-tree 123456789 987654321 --dry-run
497
+
498
+ # Copy with a custom title
499
+ confluence copy-tree 123456789 987654321 "Backup Copy"
500
+
501
+ # Copy excluding certain pages
502
+ confluence copy-tree 123456789 987654321 --exclude "Draft*,Archive*"
503
+ ```
504
+
505
+ ---
506
+
507
+ ### `stats`
508
+
509
+ Show local usage statistics.
510
+
511
+ ```sh
512
+ confluence stats
513
+ ```
514
+
515
+ ---
516
+
517
+ ### `install-skill`
518
+
519
+ Copy the Claude Code skill documentation into your project's `.claude/skills/` directory so Claude Code can learn confluence-cli automatically.
520
+
521
+ ```sh
522
+ confluence install-skill [--dest <directory>] [--yes]
523
+ ```
524
+
525
+ | Option | Default | Description |
526
+ |---|---|---|
527
+ | `--dest` | `./.claude/skills/confluence` | Target directory |
528
+ | `--yes` | false | Skip overwrite confirmation |
529
+
530
+ ```sh
531
+ confluence install-skill
532
+ ```
533
+
534
+ ---
535
+
536
+ ## Common Agent Workflows
537
+
538
+ ### Read → Edit → Update (round-trip)
539
+
540
+ ```sh
541
+ # 1. Fetch raw storage XML
542
+ confluence edit 123456789 --output ./page.xml
543
+
544
+ # 2. Modify page.xml with your tool of choice
545
+
546
+ # 3. Push the updated content
547
+ confluence update 123456789 --file ./page.xml --format storage
548
+ ```
549
+
550
+ ### Build a documentation hierarchy
551
+
552
+ ```sh
553
+ # Create root page, note the returned ID (e.g. 111222333)
554
+ confluence create "Project Overview" MYSPACE --content "# Overview" --format markdown
555
+
556
+ # Add children under it
557
+ confluence create-child "Architecture" 111222333 --content "# Architecture" --format markdown
558
+ confluence create-child "API Reference" 111222333 --file ./api.md --format markdown
559
+ confluence create-child "Runbooks" 111222333 --content "# Runbooks" --format markdown
560
+ ```
561
+
562
+ ### Copy a full page tree
563
+
564
+ ```sh
565
+ # Preview first
566
+ confluence copy-tree 123456789 987654321 --dry-run
567
+
568
+ # Execute the copy
569
+ confluence copy-tree 123456789 987654321 "Backup Copy"
570
+ ```
571
+
572
+ ### Export a page for local editing
573
+
574
+ ```sh
575
+ confluence export 123456789 --format markdown --dest ./local-docs
576
+ # => ./local-docs/<page-title>/page.md + ./local-docs/<page-title>/attachments/
577
+ ```
578
+
579
+ ### Process children as JSON
580
+
581
+ ```sh
582
+ confluence children 123456789 --recursive --format json | jq '.[].id'
583
+ ```
584
+
585
+ ### Search and process results
586
+
587
+ ```sh
588
+ confluence search "release notes" --limit 20
589
+ ```
590
+
591
+ ---
592
+
593
+ ## Agent Tips
594
+
595
+ - **Always use `--yes`** on destructive commands (`delete`, `comment-delete`, `attachment-delete`) to avoid interactive prompts blocking the agent.
596
+ - **Prefer `--format markdown`** when creating or updating content from agent-generated text — it's the most natural format and the API converts it automatically.
597
+ - **Use `--format json`** on `children` and `comments` for machine-parseable output.
598
+ - **ANSI color codes**: stdout may contain ANSI escape sequences. Pipe through `| cat` or use `NO_COLOR=1` if your downstream tool doesn't handle them.
599
+ - **Page ID vs URL**: when you have a Confluence URL, extract `?pageId=<number>` and pass the number. Do not pass pretty/display URLs — they are not supported.
600
+ - **Cross-space moves**: `confluence move` only works within the same space. Moving across spaces is not supported.
601
+
602
+ ## Error Patterns
603
+
604
+ | Error | Cause | Fix |
605
+ |---|---|---|
606
+ | `No configuration found` | No config file and no env vars set | Set env vars or run `confluence init` |
607
+ | `Cross-space moves are not supported` | `move` used across spaces | Copy with `copy-tree` instead |
608
+ | 400 on inline comment creation | Editor metadata required | Use `--location footer` or reply to existing inline comment with `--parent` |
609
+ | `File not found: <path>` | `--file` path doesn't exist | Check the path before calling the command |
610
+ | `At least one of --title, --file, or --content must be provided` | `update` called with no content options | Provide at least one of the required options |
package/README.md CHANGED
@@ -29,6 +29,18 @@ Or run directly with npx:
29
29
  npx confluence-cli
30
30
  ```
31
31
 
32
+ ## Claude Code AI Skills
33
+
34
+ If you use [Claude Code](https://claude.ai/code) or any AI agent that reads `.claude/skills/`, install the skill documentation so the agent understands all confluence-cli commands automatically.
35
+
36
+ Run this from your project root after installing confluence-cli:
37
+
38
+ ```bash
39
+ confluence install-skill
40
+ ```
41
+
42
+ This creates `.claude/skills/confluence/SKILL.md` in your current directory. Claude Code picks it up automatically and can help you with any confluence-cli command.
43
+
32
44
  ## Quick Start
33
45
 
34
46
  1. **Initialize configuration:**
@@ -68,7 +80,7 @@ npx confluence-cli
68
80
  confluence init
69
81
  ```
70
82
 
71
- The wizard helps you choose the right API endpoint and authentication method. It recommends `/wiki/rest/api` for Atlassian Cloud domains (e.g., `*.atlassian.net`) and `/rest/api` for self-hosted/Data Center instances, then prompts for Basic (email + token) or Bearer authentication.
83
+ The wizard helps you choose the right API endpoint and authentication method. It recommends `/wiki/rest/api` for Atlassian Cloud domains (e.g., `*.atlassian.net`) and `/rest/api` for self-hosted/Data Center instances, then prompts for Basic (email/username + token/password) or Bearer authentication.
72
84
 
73
85
  ### Option 2: Non-interactive Setup (CLI Flags)
74
86
 
@@ -97,16 +109,16 @@ confluence init --email "user@example.com" --token "your-api-token"
97
109
  - `-d, --domain <domain>` - Confluence domain (e.g., `company.atlassian.net`)
98
110
  - `-p, --api-path <path>` - REST API path (e.g., `/wiki/rest/api`)
99
111
  - `-a, --auth-type <type>` - Authentication type: `basic` or `bearer`
100
- - `-e, --email <email>` - Email for basic authentication
101
- - `-t, --token <token>` - API token
112
+ - `-e, --email <email>` - Email or username for basic authentication
113
+ - `-t, --token <token>` - API token or password
102
114
 
103
115
  ⚠️ **Security note:** While flags work, storing tokens in shell history is risky. Prefer environment variables (Option 3) for production environments.
104
116
 
105
117
  ### Option 3: Environment Variables
106
118
  ```bash
107
119
  export CONFLUENCE_DOMAIN="your-domain.atlassian.net"
108
- export CONFLUENCE_API_TOKEN="your-api-token"
109
- export CONFLUENCE_EMAIL="your.email@example.com" # required when using basic auth
120
+ export CONFLUENCE_API_TOKEN="your-api-token" # or password for on-premise (alias: CONFLUENCE_PASSWORD)
121
+ export CONFLUENCE_EMAIL="your.email@example.com" # required for basic auth (alias: CONFLUENCE_USERNAME for on-premise)
110
122
  export CONFLUENCE_API_PATH="/wiki/rest/api" # Cloud default; use /rest/api for Server/DC
111
123
  # Optional: set to 'bearer' for self-hosted/Data Center instances
112
124
  export CONFLUENCE_AUTH_TYPE="basic"
@@ -116,11 +128,14 @@ export CONFLUENCE_AUTH_TYPE="basic"
116
128
 
117
129
  ### Getting Your API Token
118
130
 
131
+ **Atlassian Cloud:**
119
132
  1. Go to [Atlassian Account Settings](https://id.atlassian.com/manage-profile/security/api-tokens)
120
133
  2. Click "Create API token"
121
134
  3. Give it a label (e.g., "confluence-cli")
122
135
  4. Copy the generated token
123
136
 
137
+ **On-premise / Data Center:** Use your Confluence username and password for basic authentication.
138
+
124
139
  ## Usage
125
140
 
126
141
  ### Read a Page