confluence-cli 1.12.0 → 1.12.1
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.
- package/CHANGELOG.md +7 -0
- package/README.md +3 -0
- package/bin/confluence.js +17 -7
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.12.1](https://github.com/pchuri/confluence-cli/compare/v1.12.0...v1.12.1) (2025-12-31)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* align README with CLI behavior ([#26](https://github.com/pchuri/confluence-cli/issues/26)) ([b24c7cf](https://github.com/pchuri/confluence-cli/commit/b24c7cf4a645383812a1cb7239b1db41ded77f8d))
|
|
7
|
+
|
|
1
8
|
# [1.12.0](https://github.com/pchuri/confluence-cli/compare/v1.11.1...v1.12.0) (2025-12-31)
|
|
2
9
|
|
|
3
10
|
|
package/README.md
CHANGED
|
@@ -254,7 +254,10 @@ confluence stats
|
|
|
254
254
|
| `create-child <title> <parentId>` | Create a child page | `--content <string>`, `--file <path>`, `--format <storage\|html\|markdown>` |
|
|
255
255
|
| `copy-tree <sourcePageId> <targetParentId> [newTitle]` | Copy page tree with all children | `--max-depth <number>`, `--exclude <patterns>`, `--delay-ms <ms>`, `--copy-suffix <text>`, `--dry-run`, `--fail-on-error`, `--quiet` |
|
|
256
256
|
| `update <pageId>` | Update a page's title or content | `--title <string>`, `--content <string>`, `--file <path>`, `--format <storage\|html\|markdown>` |
|
|
257
|
+
| `delete <pageId_or_url>` | Delete a page by ID or URL | `--yes` |
|
|
257
258
|
| `edit <pageId>` | Export page content for editing | `--output <file>` |
|
|
259
|
+
| `attachments <pageId_or_url>` | List or download attachments for a page | `--limit <number>`, `--pattern <glob>`, `--download`, `--dest <directory>` |
|
|
260
|
+
| `export <pageId_or_url>` | Export a page to a directory with its attachments | `--format <html\|text\|markdown>`, `--dest <directory>`, `--file <filename>`, `--attachments-dir <name>`, `--pattern <glob>`, `--referenced-only`, `--skip-attachments` |
|
|
258
261
|
| `stats` | View your usage statistics | |
|
|
259
262
|
|
|
260
263
|
## Examples
|
package/bin/confluence.js
CHANGED
|
@@ -475,6 +475,7 @@ program
|
|
|
475
475
|
.option('--file <filename>', 'Content filename (default: page.<ext>)')
|
|
476
476
|
.option('--attachments-dir <name>', 'Subdirectory for attachments', 'attachments')
|
|
477
477
|
.option('--pattern <glob>', 'Filter attachments by filename (e.g., "*.png")')
|
|
478
|
+
.option('--referenced-only', 'Download only attachments referenced in the page content')
|
|
478
479
|
.option('--skip-attachments', 'Do not download attachments')
|
|
479
480
|
.action(async (pageId, options) => {
|
|
480
481
|
const analytics = new Analytics();
|
|
@@ -489,9 +490,14 @@ program
|
|
|
489
490
|
const contentExt = formatExt[format] || 'txt';
|
|
490
491
|
|
|
491
492
|
const pageInfo = await client.getPageInfo(pageId);
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
493
|
+
const content = await client.readPage(
|
|
494
|
+
pageId,
|
|
495
|
+
format,
|
|
496
|
+
options.referencedOnly ? { extractReferencedAttachments: true } : {}
|
|
497
|
+
);
|
|
498
|
+
const referencedAttachments = options.referencedOnly
|
|
499
|
+
? (client._referencedAttachments || new Set())
|
|
500
|
+
: null;
|
|
495
501
|
|
|
496
502
|
const baseDir = path.resolve(options.dest || '.');
|
|
497
503
|
const folderName = sanitizeTitle(pageInfo.title || 'page');
|
|
@@ -510,13 +516,13 @@ program
|
|
|
510
516
|
const pattern = options.pattern ? options.pattern.trim() : null;
|
|
511
517
|
const allAttachments = await client.getAllAttachments(pageId);
|
|
512
518
|
|
|
513
|
-
// Filter: only referenced attachments (unless pattern is specified, then use pattern)
|
|
514
519
|
let filtered;
|
|
515
520
|
if (pattern) {
|
|
516
521
|
filtered = allAttachments.filter(att => client.matchesPattern(att.title, pattern));
|
|
522
|
+
} else if (options.referencedOnly) {
|
|
523
|
+
filtered = allAttachments.filter(att => referencedAttachments?.has(att.title));
|
|
517
524
|
} else {
|
|
518
|
-
|
|
519
|
-
filtered = allAttachments.filter(att => referencedAttachments.has(att.title));
|
|
525
|
+
filtered = allAttachments;
|
|
520
526
|
}
|
|
521
527
|
|
|
522
528
|
if (filtered.length === 0) {
|
|
@@ -700,4 +706,8 @@ program
|
|
|
700
706
|
}
|
|
701
707
|
});
|
|
702
708
|
|
|
703
|
-
|
|
709
|
+
if (process.argv.length <= 2) {
|
|
710
|
+
program.help({ error: false });
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
program.parse(process.argv);
|
package/package.json
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "confluence-cli",
|
|
3
|
-
"version": "1.12.
|
|
3
|
+
"version": "1.12.1",
|
|
4
4
|
"description": "A command-line interface for Atlassian Confluence with page creation and editing capabilities",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"confluence": "bin/index.js"
|
|
7
|
+
"confluence": "bin/index.js",
|
|
8
|
+
"confluence-cli": "bin/index.js"
|
|
8
9
|
},
|
|
9
10
|
"scripts": {
|
|
10
11
|
"start": "node bin/confluence.js",
|