confluence-cli 1.27.8 → 1.29.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.
- package/.claude-plugin/marketplace.json +18 -0
- package/README.md +26 -4
- package/bin/confluence.js +88 -1
- package/lib/confluence-client.js +7 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +3 -2
- package/plugins/confluence/.claude-plugin/plugin.json +17 -0
- package/plugins/confluence/README.md +27 -0
- package/{.claude → plugins/confluence}/skills/confluence/SKILL.md +44 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://anthropic.com/claude-code/marketplace.schema.json",
|
|
3
|
+
"name": "pchuri-confluence-cli",
|
|
4
|
+
"owner": {
|
|
5
|
+
"name": "pchuri"
|
|
6
|
+
},
|
|
7
|
+
"metadata": {
|
|
8
|
+
"description": "Claude Code plugins for Atlassian Confluence CLI.",
|
|
9
|
+
"version": "1.0.0"
|
|
10
|
+
},
|
|
11
|
+
"plugins": [
|
|
12
|
+
{
|
|
13
|
+
"name": "confluence",
|
|
14
|
+
"description": "Use confluence-cli to read, search, create, update, move, delete, and convert Confluence pages and attachments from the terminal.",
|
|
15
|
+
"source": "./plugins/confluence"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ A powerful command-line interface for Atlassian Confluence that allows you to re
|
|
|
18
18
|
- 🛠️ **Edit workflow** - Export page content for editing and re-import
|
|
19
19
|
- 🔀 **Profiles** - Manage multiple Confluence instances with named configuration profiles
|
|
20
20
|
- 🔒 **Read-only mode** - Profile-level write protection for safe AI agent usage
|
|
21
|
+
- 🔄 **Format conversion** - Convert between Markdown, HTML, Storage, and text formats locally (no server required)
|
|
21
22
|
- 🔧 **Easy setup** - Simple configuration with environment variables or interactive setup
|
|
22
23
|
|
|
23
24
|
## Installation
|
|
@@ -39,17 +40,28 @@ Or run directly with npx:
|
|
|
39
40
|
npx confluence-cli
|
|
40
41
|
```
|
|
41
42
|
|
|
42
|
-
## Claude Code
|
|
43
|
+
## Claude Code Integration
|
|
43
44
|
|
|
44
|
-
|
|
45
|
+
confluence-cli ships as a [Claude Code plugin](https://docs.anthropic.com/en/docs/claude-code/plugins). Once installed, Claude Code understands all confluence-cli commands automatically and receives updates when the skill is improved.
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
### Option 1: Install as Plugin (recommended)
|
|
48
|
+
|
|
49
|
+
Add the marketplace and install the plugin:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
/plugin marketplace add pchuri/confluence-cli
|
|
53
|
+
/plugin install confluence@pchuri-confluence-cli
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Option 2: Install Skill manually
|
|
57
|
+
|
|
58
|
+
If you prefer not to use the plugin system, copy the skill documentation into your project:
|
|
47
59
|
|
|
48
60
|
```bash
|
|
49
61
|
confluence install-skill
|
|
50
62
|
```
|
|
51
63
|
|
|
52
|
-
This creates `.claude/skills/confluence/SKILL.md` in your current directory. Claude Code picks it up automatically
|
|
64
|
+
This creates `.claude/skills/confluence/SKILL.md` in your current directory. Claude Code picks it up automatically.
|
|
53
65
|
|
|
54
66
|
## Quick Start
|
|
55
67
|
|
|
@@ -555,6 +567,7 @@ confluence stats
|
|
|
555
567
|
| `profile use <name>` | Set the active configuration profile | |
|
|
556
568
|
| `profile add <name>` | Add a new configuration profile | `-d, --domain`, `-p, --api-path`, `-a, --auth-type`, `-e, --email`, `-t, --token`, `--protocol`, `--read-only` |
|
|
557
569
|
| `profile remove <name>` | Remove a configuration profile | |
|
|
570
|
+
| `convert` | Convert between content formats locally (no server required) | `--input-file <path>`, `--output-file <path>`, `--input-format <markdown\|storage\|html>`, `--output-format <markdown\|storage\|html\|text>` |
|
|
558
571
|
| `stats` | View your usage statistics | |
|
|
559
572
|
|
|
560
573
|
**Global option:** `--profile <name>` — Use a specific profile for any command (overrides `CONFLUENCE_PROFILE` env var and active profile).
|
|
@@ -597,6 +610,15 @@ confluence stats
|
|
|
597
610
|
confluence profile list
|
|
598
611
|
confluence profile use staging
|
|
599
612
|
confluence --profile staging spaces
|
|
613
|
+
|
|
614
|
+
# Convert markdown to Confluence storage format (no server required)
|
|
615
|
+
confluence convert --input-file doc.md --input-format markdown --output-format storage
|
|
616
|
+
|
|
617
|
+
# Pipe conversion via stdin/stdout
|
|
618
|
+
echo "# Hello" | confluence convert --input-format markdown --output-format storage
|
|
619
|
+
|
|
620
|
+
# Convert storage format back to markdown
|
|
621
|
+
confluence convert -i page.xml -o page.md --input-format storage --output-format markdown
|
|
600
622
|
```
|
|
601
623
|
|
|
602
624
|
## Development
|
package/bin/confluence.js
CHANGED
|
@@ -167,7 +167,7 @@ program
|
|
|
167
167
|
const fs = require('fs');
|
|
168
168
|
const path = require('path');
|
|
169
169
|
|
|
170
|
-
const skillSrc = path.join(__dirname, '..', '
|
|
170
|
+
const skillSrc = path.join(__dirname, '..', 'plugins', 'confluence', 'skills', 'confluence', 'SKILL.md');
|
|
171
171
|
|
|
172
172
|
if (!fs.existsSync(skillSrc)) {
|
|
173
173
|
console.error(chalk.red('Error: skill file not found in package. Try reinstalling confluence-cli.'));
|
|
@@ -1952,6 +1952,93 @@ profileCmd
|
|
|
1952
1952
|
}
|
|
1953
1953
|
});
|
|
1954
1954
|
|
|
1955
|
+
// Convert command (local format conversion, no server connection required)
|
|
1956
|
+
const VALID_INPUT_FORMATS = ['markdown', 'storage', 'html'];
|
|
1957
|
+
const VALID_OUTPUT_FORMATS = ['markdown', 'storage', 'html', 'text'];
|
|
1958
|
+
|
|
1959
|
+
program
|
|
1960
|
+
.command('convert')
|
|
1961
|
+
.description('Convert between content formats locally (no server connection required)')
|
|
1962
|
+
.option('-i, --input-file <file>', 'Input file path (reads from stdin if omitted)')
|
|
1963
|
+
.option('-o, --output-file <file>', 'Output file path (writes to stdout if omitted)')
|
|
1964
|
+
.option('--input-format <format>', `Input format (${VALID_INPUT_FORMATS.join(', ')})`)
|
|
1965
|
+
.option('--output-format <format>', `Output format (${VALID_OUTPUT_FORMATS.join(', ')})`)
|
|
1966
|
+
.action(async (options) => {
|
|
1967
|
+
const analytics = new Analytics();
|
|
1968
|
+
try {
|
|
1969
|
+
if (!options.inputFormat) {
|
|
1970
|
+
console.error(chalk.red('Error: --input-format is required.'));
|
|
1971
|
+
process.exit(1);
|
|
1972
|
+
}
|
|
1973
|
+
if (!options.outputFormat) {
|
|
1974
|
+
console.error(chalk.red('Error: --output-format is required.'));
|
|
1975
|
+
process.exit(1);
|
|
1976
|
+
}
|
|
1977
|
+
if (!VALID_INPUT_FORMATS.includes(options.inputFormat)) {
|
|
1978
|
+
console.error(chalk.red(`Error: Invalid input format "${options.inputFormat}". Valid: ${VALID_INPUT_FORMATS.join(', ')}`));
|
|
1979
|
+
process.exit(1);
|
|
1980
|
+
}
|
|
1981
|
+
if (!VALID_OUTPUT_FORMATS.includes(options.outputFormat)) {
|
|
1982
|
+
console.error(chalk.red(`Error: Invalid output format "${options.outputFormat}". Valid: ${VALID_OUTPUT_FORMATS.join(', ')}`));
|
|
1983
|
+
process.exit(1);
|
|
1984
|
+
}
|
|
1985
|
+
if (options.inputFormat === options.outputFormat) {
|
|
1986
|
+
console.error(chalk.red('Error: Input and output formats must be different.'));
|
|
1987
|
+
process.exit(1);
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
const fs = require('fs');
|
|
1991
|
+
let input;
|
|
1992
|
+
if (options.inputFile) {
|
|
1993
|
+
input = fs.readFileSync(options.inputFile, 'utf-8');
|
|
1994
|
+
} else {
|
|
1995
|
+
input = fs.readFileSync(process.stdin.fd, 'utf-8');
|
|
1996
|
+
}
|
|
1997
|
+
|
|
1998
|
+
const converter = ConfluenceClient.createLocalConverter();
|
|
1999
|
+
let output;
|
|
2000
|
+
|
|
2001
|
+
if (options.inputFormat === 'markdown' && options.outputFormat === 'storage') {
|
|
2002
|
+
output = converter.markdownToStorage(input);
|
|
2003
|
+
} else if (options.inputFormat === 'markdown' && options.outputFormat === 'html') {
|
|
2004
|
+
output = converter.markdown.render(input);
|
|
2005
|
+
} else if (options.inputFormat === 'html' && options.outputFormat === 'storage') {
|
|
2006
|
+
output = converter.htmlToConfluenceStorage(input);
|
|
2007
|
+
} else if (options.inputFormat === 'storage' && options.outputFormat === 'markdown') {
|
|
2008
|
+
output = converter.storageToMarkdown(input);
|
|
2009
|
+
} else if (options.inputFormat === 'storage' && options.outputFormat === 'text') {
|
|
2010
|
+
const { convert: htmlToText } = require('html-to-text');
|
|
2011
|
+
output = htmlToText(input, { wordwrap: 130 });
|
|
2012
|
+
} else if (options.inputFormat === 'storage' && options.outputFormat === 'html') {
|
|
2013
|
+
output = input; // storage format is already HTML-based
|
|
2014
|
+
} else if (options.inputFormat === 'html' && options.outputFormat === 'text') {
|
|
2015
|
+
const { convert: htmlToText } = require('html-to-text');
|
|
2016
|
+
output = htmlToText(input, { wordwrap: 130 });
|
|
2017
|
+
} else if (options.inputFormat === 'html' && options.outputFormat === 'markdown') {
|
|
2018
|
+
output = converter.storageToMarkdown(input);
|
|
2019
|
+
} else if (options.inputFormat === 'markdown' && options.outputFormat === 'text') {
|
|
2020
|
+
const html = converter.markdown.render(input);
|
|
2021
|
+
const { convert: htmlToText } = require('html-to-text');
|
|
2022
|
+
output = htmlToText(html, { wordwrap: 130 });
|
|
2023
|
+
} else {
|
|
2024
|
+
console.error(chalk.red(`Error: Conversion from "${options.inputFormat}" to "${options.outputFormat}" is not supported.`));
|
|
2025
|
+
process.exit(1);
|
|
2026
|
+
}
|
|
2027
|
+
|
|
2028
|
+
if (options.outputFile) {
|
|
2029
|
+
fs.writeFileSync(options.outputFile, output, 'utf-8');
|
|
2030
|
+
console.error(chalk.green(`Converted ${options.inputFormat} → ${options.outputFormat}: ${options.outputFile}`));
|
|
2031
|
+
} else {
|
|
2032
|
+
process.stdout.write(output);
|
|
2033
|
+
}
|
|
2034
|
+
analytics.track('convert', true);
|
|
2035
|
+
} catch (error) {
|
|
2036
|
+
analytics.track('convert', false);
|
|
2037
|
+
console.error(chalk.red('Error:'), error.message);
|
|
2038
|
+
process.exit(1);
|
|
2039
|
+
}
|
|
2040
|
+
});
|
|
2041
|
+
|
|
1955
2042
|
// Exported for testing
|
|
1956
2043
|
module.exports = {
|
|
1957
2044
|
program,
|
package/lib/confluence-client.js
CHANGED
|
@@ -2104,5 +2104,12 @@ class ConfluenceClient {
|
|
|
2104
2104
|
}
|
|
2105
2105
|
}
|
|
2106
2106
|
|
|
2107
|
+
ConfluenceClient.createLocalConverter = function () {
|
|
2108
|
+
const instance = Object.create(ConfluenceClient.prototype);
|
|
2109
|
+
instance.markdown = new MarkdownIt();
|
|
2110
|
+
instance.setupConfluenceMarkdownExtensions();
|
|
2111
|
+
return instance;
|
|
2112
|
+
};
|
|
2113
|
+
|
|
2107
2114
|
module.exports = ConfluenceClient;
|
|
2108
2115
|
module.exports.NAMED_ENTITIES = NAMED_ENTITIES;
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "confluence-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "confluence-cli",
|
|
9
|
-
"version": "1.
|
|
9
|
+
"version": "1.29.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"axios": "^1.12.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "confluence-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.0",
|
|
4
4
|
"description": "A command-line interface for Atlassian Confluence with page creation and editing capabilities",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -58,7 +58,8 @@
|
|
|
58
58
|
"files": [
|
|
59
59
|
"bin/",
|
|
60
60
|
"lib/",
|
|
61
|
-
"
|
|
61
|
+
"plugins/",
|
|
62
|
+
".claude-plugin/",
|
|
62
63
|
"npm-shrinkwrap.json"
|
|
63
64
|
]
|
|
64
65
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "confluence",
|
|
3
|
+
"description": "Use confluence-cli to read, search, create, update, move, delete, and convert Confluence pages and attachments from the terminal.",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "pchuri"
|
|
6
|
+
},
|
|
7
|
+
"homepage": "https://github.com/pchuri/confluence-cli#readme",
|
|
8
|
+
"repository": "https://github.com/pchuri/confluence-cli",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"confluence",
|
|
12
|
+
"atlassian",
|
|
13
|
+
"wiki",
|
|
14
|
+
"documentation",
|
|
15
|
+
"cli"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# confluence
|
|
2
|
+
|
|
3
|
+
A Claude Code plugin for [confluence-cli](https://github.com/pchuri/confluence-cli). Gives Claude Code full knowledge of all confluence-cli commands so it can read, search, create, update, move, delete, and convert Confluence pages and attachments on your behalf.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
Add the marketplace and install the plugin:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
/plugin marketplace add pchuri/confluence-cli
|
|
11
|
+
/plugin install confluence@pchuri-confluence-cli
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
confluence-cli must be installed and configured:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install -g confluence-cli
|
|
20
|
+
confluence init
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
See the [main README](../../README.md) for full configuration options.
|
|
24
|
+
|
|
25
|
+
## What this plugin provides
|
|
26
|
+
|
|
27
|
+
- **Skill: confluence** (model-invoked) — Claude Code automatically activates this skill when your task involves Confluence. It covers all 30+ CLI commands, configuration, common workflows, and error handling.
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: confluence
|
|
3
|
-
description: Use confluence-cli to read, search, create, update, move, and
|
|
3
|
+
description: Use confluence-cli to read, search, create, update, move, delete, and convert Confluence pages and attachments from the terminal.
|
|
4
|
+
argument-hint: <pageId, URL, search query, or task description>
|
|
5
|
+
allowed-tools: [Bash, Read, Write, Glob, Grep]
|
|
4
6
|
---
|
|
5
7
|
|
|
6
8
|
# confluence-cli Skill
|
|
7
9
|
|
|
8
|
-
A CLI tool for Atlassian Confluence. Lets you read, search, create, update, move, and
|
|
10
|
+
A CLI tool for Atlassian Confluence. Lets you read, search, create, update, move, delete, and convert pages and attachments from the terminal or from an agent.
|
|
9
11
|
|
|
10
12
|
## Installation
|
|
11
13
|
|
|
@@ -627,6 +629,36 @@ confluence stats
|
|
|
627
629
|
|
|
628
630
|
---
|
|
629
631
|
|
|
632
|
+
### `convert`
|
|
633
|
+
|
|
634
|
+
Convert between content formats locally without a Confluence server connection.
|
|
635
|
+
|
|
636
|
+
```sh
|
|
637
|
+
confluence convert [--input-file <path>] [--output-file <path>] --input-format <format> --output-format <format>
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
| Option | Default | Description |
|
|
641
|
+
|---|---|---|
|
|
642
|
+
| `--input-file`, `-i` | stdin | Input file path |
|
|
643
|
+
| `--output-file`, `-o` | stdout | Output file path |
|
|
644
|
+
| `--input-format` | — | Input format: `markdown`, `storage`, `html` (required) |
|
|
645
|
+
| `--output-format` | — | Output format: `markdown`, `storage`, `html`, `text` (required) |
|
|
646
|
+
|
|
647
|
+
Supported conversions: markdown→storage, markdown→html, markdown→text, html→storage, html→text, html→markdown, storage→markdown, storage→html, storage→text.
|
|
648
|
+
|
|
649
|
+
```sh
|
|
650
|
+
# Markdown to Confluence storage format
|
|
651
|
+
confluence convert -i doc.md -o doc.xml --input-format markdown --output-format storage
|
|
652
|
+
|
|
653
|
+
# Pipe via stdin/stdout
|
|
654
|
+
echo "# Hello" | confluence convert --input-format markdown --output-format storage
|
|
655
|
+
|
|
656
|
+
# Storage format back to markdown
|
|
657
|
+
confluence convert -i page.xml --input-format storage --output-format markdown
|
|
658
|
+
```
|
|
659
|
+
|
|
660
|
+
---
|
|
661
|
+
|
|
630
662
|
### `install-skill`
|
|
631
663
|
|
|
632
664
|
Copy the Claude Code skill documentation into your project's `.claude/skills/` directory so Claude Code can learn confluence-cli automatically.
|
|
@@ -682,6 +714,16 @@ confluence copy-tree 123456789 987654321 --dry-run
|
|
|
682
714
|
confluence copy-tree 123456789 987654321 "Backup Copy"
|
|
683
715
|
```
|
|
684
716
|
|
|
717
|
+
### Offline format conversion
|
|
718
|
+
|
|
719
|
+
```sh
|
|
720
|
+
# Convert markdown to Confluence storage format (no server needed)
|
|
721
|
+
confluence convert -i doc.md -o doc.xml --input-format markdown --output-format storage
|
|
722
|
+
|
|
723
|
+
# Convert storage format to markdown for editing
|
|
724
|
+
confluence convert -i page.xml -o page.md --input-format storage --output-format markdown
|
|
725
|
+
```
|
|
726
|
+
|
|
685
727
|
### Export a page for local editing
|
|
686
728
|
|
|
687
729
|
```sh
|