confluence-cli 1.20.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.
package/CONTRIBUTING.md DELETED
@@ -1,246 +0,0 @@
1
- # Contributing to Confluence CLI
2
-
3
- Thank you for your interest in contributing to Confluence CLI! This document provides guidelines and information about contributing to this project.
4
-
5
- ## Table of Contents
6
-
7
- - [Code of Conduct](#code-of-conduct)
8
- - [Getting Started](#getting-started)
9
- - [Development Setup](#development-setup)
10
- - [Making Changes](#making-changes)
11
- - [Testing](#testing)
12
- - [Submitting Changes](#submitting-changes)
13
- - [Coding Standards](#coding-standards)
14
-
15
- ## Code of Conduct
16
-
17
- This project adheres to a code of conduct. By participating, you are expected to uphold this code. Please be respectful and considerate in all interactions.
18
-
19
- ## Getting Started
20
-
21
- 1. Fork the repository on GitHub
22
- 2. Clone your fork locally
23
- 3. Create a branch for your changes
24
- 4. Make your changes
25
- 5. Test your changes
26
- 6. Submit a pull request
27
-
28
- ## Development Setup
29
-
30
- ```bash
31
- # Clone your fork
32
- git clone https://github.com/your-username/confluence-cli.git
33
- cd confluence-cli
34
-
35
- # Install dependencies
36
- npm install
37
-
38
- # Set up your test environment
39
- export CONFLUENCE_DOMAIN="your-test-domain.atlassian.net"
40
- export CONFLUENCE_API_TOKEN="your-test-token"
41
-
42
- # Test the CLI locally
43
- node bin/confluence.js --help
44
- ```
45
-
46
- ## Making Changes
47
-
48
- ### Branch Naming
49
-
50
- Use descriptive branch names:
51
- - `feature/add-page-creation` - for new features
52
- - `fix/search-pagination` - for bug fixes
53
- - `docs/update-readme` - for documentation updates
54
- - `refactor/client-architecture` - for refactoring
55
-
56
- ### Commit Messages
57
-
58
- Write clear, descriptive commit messages:
59
- ```
60
- feat: add page creation functionality
61
-
62
- - Add create command to CLI
63
- - Implement createPage method in client
64
- - Add tests for page creation
65
- - Update README with new command
66
- ```
67
-
68
- Use conventional commit format:
69
- - `feat:` - new features
70
- - `fix:` - bug fixes
71
- - `docs:` - documentation changes
72
- - `style:` - formatting changes
73
- - `refactor:` - code refactoring
74
- - `test:` - adding tests
75
- - `chore:` - maintenance tasks
76
-
77
- ## Testing
78
-
79
- ```bash
80
- # Run all tests
81
- npm test
82
-
83
- # Run tests in watch mode
84
- npm run test:watch
85
-
86
- # Check test coverage
87
- npm run test:coverage
88
-
89
- # Manual testing
90
- node bin/confluence.js read 123456789
91
- ```
92
-
93
- ### Test Guidelines
94
-
95
- - Write tests for new functionality
96
- - Ensure existing tests pass
97
- - Aim for good test coverage
98
- - Use descriptive test names
99
- - Mock external API calls
100
-
101
- ## Submitting Changes
102
-
103
- 1. **Push your changes** to your fork
104
- 2. **Create a pull request** against the main branch
105
- 3. **Fill out the PR template** with:
106
- - Description of changes
107
- - Type of change (bug fix, feature, etc.)
108
- - Testing performed
109
- - Screenshots (if applicable)
110
-
111
- ### Pull Request Guidelines
112
-
113
- - Keep PRs focused and atomic
114
- - Include tests for new functionality
115
- - Update documentation as needed
116
- - Ensure CI passes
117
- - Request review from maintainers
118
-
119
- ## Coding Standards
120
-
121
- ### JavaScript Style
122
-
123
- - Use ES6+ features when appropriate
124
- - Follow existing code style
125
- - Use meaningful variable names
126
- - Add comments for complex logic
127
- - Keep functions small and focused
128
-
129
- ### Markdown Support
130
-
131
- The CLI includes enhanced markdown support with:
132
-
133
- - **Native Confluence Storage Format**: Converts markdown to native Confluence elements instead of HTML macros
134
- - **Confluence Extensions**: Support for admonitions (`[!info]`, `[!warning]`, `[!note]`)
135
- - **Bidirectional Conversion**: Convert from markdown to storage format and back
136
- - **Rich Elements**: Tables, code blocks, lists, links, and formatting
137
-
138
- Example markdown with Confluence extensions:
139
- ```markdown
140
- # My Page
141
-
142
- [!info]
143
- This is an info admonition that will render as a Confluence info macro.
144
-
145
- ```javascript
146
- console.log("Code blocks preserve syntax highlighting");
147
- ```
148
-
149
- | Feature | Status |
150
- |---------|--------|
151
- | Tables | ✅ |
152
- | Lists | ✅ |
153
- ```
154
-
155
- ### File Structure
156
-
157
- ```
158
- bin/ # CLI entry points
159
- lib/ # Core library code
160
- ├── confluence-client.js
161
- ├── config.js
162
- └── utils.js
163
- tests/ # Test files
164
- docs/ # Additional documentation
165
- ```
166
-
167
- ### Error Handling
168
-
169
- - Always handle errors gracefully
170
- - Provide helpful error messages
171
- - Use appropriate exit codes
172
- - Log errors appropriately
173
-
174
- ### Documentation
175
-
176
- - Update README for new features
177
- - Add JSDoc comments for functions
178
- - Update CHANGELOG for releases
179
- - Include usage examples
180
-
181
- ## Feature Requests
182
-
183
- Before implementing major features:
184
-
185
- 1. **Check existing issues** to avoid duplication
186
- 2. **Create an issue** to discuss the feature
187
- 3. **Get maintainer feedback** before starting work
188
- 4. **Follow the agreed approach** in implementation
189
-
190
- ## Bug Reports
191
-
192
- When reporting bugs:
193
-
194
- 1. **Check existing issues** first
195
- 2. **Provide reproduction steps**
196
- 3. **Include environment details**:
197
- - Node.js version
198
- - OS and version
199
- - CLI version
200
- 4. **Share error messages** and logs
201
-
202
- ## Development Tips
203
-
204
- ### Local Testing
205
-
206
- ```bash
207
- # Test against your Confluence instance
208
- export CONFLUENCE_DOMAIN="your-domain.atlassian.net"
209
- export CONFLUENCE_API_TOKEN="your-token"
210
-
211
- # Test commands
212
- node bin/confluence.js spaces
213
- node bin/confluence.js search "test"
214
- node bin/confluence.js read 123456789
215
- ```
216
-
217
- ### Debugging
218
-
219
- ```bash
220
- # Enable debug mode
221
- DEBUG=confluence-cli node bin/confluence.js read 123456789
222
-
223
- # Use Node.js debugger
224
- node --inspect-brk bin/confluence.js read 123456789
225
- ```
226
-
227
- ## Release Process
228
-
229
- For maintainers:
230
-
231
- 1. Update version in `package.json`
232
- 2. Update `CHANGELOG.md`
233
- 3. Create git tag
234
- 4. Push to npm
235
- 5. Create GitHub release
236
-
237
- ## Questions?
238
-
239
- If you have questions about contributing:
240
-
241
- 1. Check existing documentation
242
- 2. Search closed issues
243
- 3. Ask in a new issue
244
- 4. Contact maintainers
245
-
246
- Thank you for contributing to Confluence CLI! 🚀
package/docs/PROMOTION.md DELETED
@@ -1,63 +0,0 @@
1
- # GitHub Repository Topics
2
-
3
- When setting up your GitHub repository, add these topics for better discoverability:
4
-
5
- ## Suggested Topics:
6
- - `confluence`
7
- - `atlassian`
8
- - `cli`
9
- - `command-line`
10
- - `wiki`
11
- - `documentation`
12
- - `nodejs`
13
- - `javascript`
14
- - `api-client`
15
- - `automation`
16
- - `developer-tools`
17
- - `productivity`
18
-
19
- ## How to add topics:
20
- 1. Go to https://github.com/pchuri/confluence-cli
21
- 2. Click the âš™ī¸ gear icon next to "About"
22
- 3. Add the topics above in the "Topics" field
23
- 4. Add a description: "A powerful command-line interface for Atlassian Confluence"
24
- 5. Add website: https://www.npmjs.com/package/confluence-cli
25
-
26
- ## Social Media Promotion Ideas:
27
-
28
- ### Twitter/X Posts:
29
- ```
30
- 🚀 Just released confluence-cli v1.0!
31
-
32
- A powerful CLI tool for @Atlassian Confluence:
33
- ✅ Read pages from terminal
34
- ✅ Search documentation
35
- ✅ List spaces
36
- ✅ Works with environment variables
37
-
38
- Perfect for automation & DevOps workflows!
39
-
40
- #CLI #Confluence #DevTools #OpenSource
41
- https://github.com/pchuri/confluence-cli
42
- ```
43
-
44
- ### LinkedIn Post:
45
- ```
46
- Excited to share my latest open-source project: confluence-cli! 🎉
47
-
48
- As someone who works with Confluence daily, I built this CLI tool to streamline documentation workflows. Now you can:
49
-
50
- â€ĸ Read Confluence pages from your terminal
51
- â€ĸ Search across your wiki content
52
- â€ĸ Integrate with CI/CD pipelines
53
- â€ĸ Automate documentation tasks
54
-
55
- Available on NPM and fully open-source. Would love your feedback!
56
-
57
- #OpenSource #CLI #Confluence #DevTools #Automation
58
- ```
59
-
60
- ### Dev.to Article Ideas:
61
- 1. "Building a CLI Tool for Confluence: From Bash Functions to NPM Package"
62
- 2. "How to Automate Your Documentation Workflow with Confluence CLI"
63
- 3. "Open Source Journey: Lessons Learned Building confluence-cli"
package/eslint.config.js DELETED
@@ -1,33 +0,0 @@
1
- const util = require('util');
2
- const js = require('@eslint/js');
3
- const globals = require('globals');
4
-
5
- if (typeof global.structuredClone !== 'function') {
6
- global.structuredClone = typeof util.structuredClone === 'function'
7
- ? util.structuredClone
8
- : (value) => JSON.parse(JSON.stringify(value));
9
- }
10
-
11
- module.exports = [
12
- js.configs.recommended,
13
- {
14
- files: ['**/*.js'],
15
- languageOptions: {
16
- ecmaVersion: 2021,
17
- sourceType: 'module',
18
- globals: {
19
- ...globals.node,
20
- ...globals.jest
21
- }
22
- },
23
- rules: {
24
- indent: ['error', 2],
25
- 'linebreak-style': ['error', 'unix'],
26
- quotes: ['error', 'single'],
27
- semi: ['error', 'always'],
28
- 'no-unused-vars': ['error', { argsIgnorePattern: '^_', caughtErrors: 'none' }],
29
- 'no-console': 'off',
30
- 'no-process-exit': 'off'
31
- }
32
- }
33
- ];
@@ -1,117 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Confluence CLI - Copy Page Tree Example
4
- # This script shows how to copy a page and all its descendants to a new location.
5
-
6
- echo "📋 Confluence CLI - Copy Page Tree Example"
7
- echo "=================================================="
8
-
9
- # Prerequisites
10
- echo ""
11
- echo "📝 Prerequisites:"
12
- echo "- confluence CLI is set up (confluence init)"
13
- echo "- You have access to source and target locations"
14
- echo "- You have permissions to create pages"
15
- echo ""
16
-
17
- # Step 1: Find the source page
18
- echo "1ī¸âƒŖ Find the source page"
19
- echo "=============================="
20
- echo ""
21
- echo "Method 1: Find by title"
22
- echo "confluence find \"Project Docs\" --space MYTEAM"
23
- echo ""
24
- echo "Method 2: Search"
25
- echo "confluence search \"Project\""
26
- echo ""
27
- echo "📝 Note the source page ID from the output (e.g., 123456789)"
28
- echo ""
29
-
30
- # Step 2: Find the target parent page
31
- echo "2ī¸âƒŖ Find the target parent page"
32
- echo "========================="
33
- echo ""
34
- echo "confluence find \"Backup\" --space BACKUP"
35
- echo "or"
36
- echo "confluence find \"Archive\" --space ARCHIVE"
37
- echo ""
38
- echo "📝 Note the target parent page ID (e.g., 987654321)"
39
- echo ""
40
-
41
- # Step 3: Run the copy
42
- echo "3ī¸âƒŖ Run copy"
43
- echo "========================"
44
- echo ""
45
-
46
- echo "📄 Basic: copy with all children"
47
- echo 'confluence copy-tree 123456789 987654321 "Project Docs (Backup)"'
48
- echo ""
49
-
50
- echo "📄 Depth-limited (3 levels)"
51
- echo 'confluence copy-tree 123456789 987654321 "Project Docs (Summary)" --max-depth 3'
52
- echo ""
53
-
54
- echo "📄 Exclude patterns"
55
- echo 'confluence copy-tree 123456789 987654321 "Project Docs (Clean)" --exclude "temp*,test*,*draft*"'
56
- echo ""
57
-
58
- echo "📄 Quiet mode"
59
- echo 'confluence copy-tree 123456789 987654321 --quiet'
60
- echo ""
61
-
62
- echo "📄 Control pacing and naming"
63
- echo 'confluence copy-tree 123456789 987654321 --delay-ms 150 --copy-suffix " (Backup)"'
64
- echo ""
65
-
66
- # Practical example
67
- echo "💡 Practical example"
68
- echo "================="
69
- echo ""
70
- echo "# 1. Capture source page ID"
71
- echo 'SOURCE_ID=$(confluence find "Project Docs" --space MYTEAM | grep "ID:" | awk "{print \$2}")'
72
- echo ""
73
- echo "# 2. Capture target parent ID"
74
- echo 'TARGET_ID=$(confluence find "Backup Folder" --space BACKUP | grep "ID:" | awk "{print \$2}")'
75
- echo ""
76
- echo "# 3. Run backup with date suffix"
77
- echo 'confluence copy-tree $SOURCE_ID $TARGET_ID "Project Docs Backup - $(date +%Y%m%d)"'
78
- echo ""
79
-
80
- # Advanced usage
81
- echo "🚀 Advanced"
82
- echo "============="
83
- echo ""
84
- echo "1. Large trees with progress"
85
- echo " confluence copy-tree 123456789 987654321 | tee copy-log.txt"
86
- echo ""
87
- echo "2. Multiple exclude patterns"
88
- echo " confluence copy-tree 123456789 987654321 --exclude \"temp*,test*,*draft*,*temp*\""
89
- echo ""
90
- echo "3. Shallow copy (only direct children)"
91
- echo " confluence copy-tree 123456789 987654321 --max-depth 1"
92
- echo ""
93
-
94
- # Notes and tips
95
- echo "âš ī¸ Notes and tips"
96
- echo "=================="
97
- echo "- Large trees may take time to copy"
98
- echo "- A short delay between siblings helps avoid rate limits (tune with --delay-ms)"
99
- echo "- Partial copies can remain if errors occur"
100
- echo "- Pages without permission are skipped; run with --fail-on-error to fail the run"
101
- echo "- Validate links and references after copying"
102
- echo "- Try with a small tree first"
103
- echo ""
104
-
105
- echo "📊 Verify results"
106
- echo "================"
107
- echo "After completion, you can check the results:"
108
- echo ""
109
- echo "# Root page info"
110
- echo "confluence info [NEW_PAGE_ID]"
111
- echo ""
112
- echo "# Find copied pages"
113
- echo "confluence search \"Copy\" --limit 20"
114
- echo ""
115
-
116
- echo "✅ Example complete!"
117
- echo "Replace example IDs with real ones when running."
@@ -1,67 +0,0 @@
1
- #!/bin/bash
2
-
3
- #!/bin/bash
4
-
5
- # Create a test page under the Project Documentation page
6
- # This script demonstrates typical Confluence CLI usage.
7
-
8
- echo "🔍 Create a test page under Project Documentation"
9
- echo "================================================"
10
-
11
- # Step 1: Find the parent page
12
- echo ""
13
- echo "1ī¸âƒŖ Find the parent page..."
14
- echo "Run: confluence find \"Project Documentation\" --space MYTEAM"
15
- echo ""
16
-
17
- # For real execution, uncomment below
18
- # confluence find "Project Documentation" --space MYTEAM
19
-
20
- echo "📝 Note the page ID from the output (e.g., 123456789)"
21
- echo ""
22
-
23
- # Step 2: Inspect page info
24
- echo "2ī¸âƒŖ Inspect page info..."
25
- echo "Run: confluence info [PAGE_ID]"
26
- echo "Example: confluence info 123456789"
27
- echo ""
28
-
29
- # Step 3: Read page content (optional)
30
- echo "3ī¸âƒŖ Read content (optional)..."
31
- echo "Run: confluence read [PAGE_ID] | head -20"
32
- echo "Example: confluence read 123456789 | head -20"
33
- echo ""
34
-
35
- # Step 4: Create a child test page
36
- echo "4ī¸âƒŖ Create child test page..."
37
- echo ""
38
-
39
- # Simple text content
40
- echo "📄 Option 1: Simple text content"
41
- echo 'confluence create-child "Test Page - $(date +%Y%m%d)" [PARENT_PAGE_ID] --content "This is a test page created via CLI. Created at: $(date)"'
42
- echo ""
43
-
44
- # From Markdown file
45
- echo "📄 Option 2: From Markdown file"
46
- echo "confluence create-child \"Test Documentation - $(date +%Y%m%d)\" [PARENT_PAGE_ID] --file ./sample-page.md --format markdown"
47
- echo ""
48
-
49
- # From HTML content
50
- echo "📄 Option 3: From HTML content"
51
- echo 'confluence create-child "Test HTML Page" [PARENT_PAGE_ID] --content "<h1>Test Page</h1><p>This is a <strong>HTML</strong> example page.</p>" --format html'
52
- echo ""
53
-
54
- echo "💡 Practical example:"
55
- echo "=============================="
56
- echo "# 1. Get parent page ID"
57
- echo 'PARENT_ID=$(confluence find "Project Documentation" --space MYTEAM | grep "ID:" | cut -d" " -f2)'
58
- echo ""
59
- echo "# 2. Create test page"
60
- echo 'confluence create-child "Test Page - $(date +%Y%m%d_%H%M)" $PARENT_ID --content "Page for CLI testing."'
61
- echo ""
62
-
63
- echo "âš ī¸ Notes:"
64
- echo "- confluence CLI must be set up (confluence init)"
65
- echo "- You need appropriate permissions on the Confluence instance"
66
- echo "- Ensure you have page creation permission"
67
- echo "- Clean up test pages afterward"
@@ -1,68 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Confluence CLI Demo Script
4
- # This script demonstrates the new page creation and update features
5
-
6
- echo "🚀 Confluence CLI - Page Creation Demo"
7
- echo "======================================"
8
-
9
- # Note: Replace with your actual space key and ensure you have confluence-cli configured
10
- SPACE_KEY="MYTEAM" # Change this to your space key
11
-
12
- echo ""
13
- echo "1. Creating a page from Markdown file..."
14
- echo "confluence create \"Sample Page from CLI\" $SPACE_KEY --file ./sample-page.md --format markdown"
15
-
16
- echo ""
17
- echo "2. Creating a page with inline content..."
18
- echo "confluence create \"Quick Note\" $SPACE_KEY --content \"This is a quick note created from the CLI\" --format storage"
19
-
20
- echo ""
21
- echo "3. Updating a page (replace 123456789 with actual page ID)..."
22
- echo "confluence update 123456789 --content \"This page has been updated via CLI\""
23
-
24
- echo ""
25
- echo "4. Getting page content for editing..."
26
- echo "confluence edit 123456789 --output ./page-backup.xml"
27
-
28
- echo ""
29
- echo "5. Searching for pages..."
30
- echo "confluence search \"CLI\""
31
-
32
- echo ""
33
- echo "6. Listing all spaces..."
34
- echo "confluence spaces"
35
-
36
- echo ""
37
- echo "7. Finding a page by title..."
38
- echo "confluence find \"Project Documentation\" --space MYTEAM"
39
-
40
- echo ""
41
- echo "8. Creating a child page under a parent page..."
42
- echo "confluence create-child \"Test Page\" 123456789 --content \"This is a test page created as a child\""
43
-
44
- echo ""
45
- echo "9. Creating a child page from Markdown file..."
46
- echo "confluence create-child \"Test Documentation\" 123456789 --file ./sample-page.md --format markdown"
47
-
48
- echo ""
49
- echo "💡 Tips:"
50
- echo "- Use --format markdown to create pages from Markdown files"
51
- echo "- Use --format html for HTML content"
52
- echo "- Use --format storage for Confluence native format"
53
- echo "- Always backup important pages before updating"
54
- echo "- Use 'confluence find' to get page IDs by title"
55
- echo "- Child pages inherit permissions from their parent"
56
-
57
- echo ""
58
- echo "📝 Edit workflow:"
59
- echo "1. confluence edit [pageId] --output page.xml"
60
- echo "2. Edit the file with your preferred editor"
61
- echo "3. confluence update [pageId] --file page.xml --format storage"
62
-
63
- echo ""
64
- echo "🔍 Finding and creating child pages workflow:"
65
- echo "1. confluence find \"Project Documentation\" --space MYTEAM"
66
- echo "2. Note the page ID from the result"
67
- echo "3. confluence create-child \"Meeting Notes\" [parentId] --content \"Child content\""
68
- echo "4. Or use: confluence create-child \"Technical Docs\" [parentId] --file ./content.md --format markdown"
package/examples/demo.sh DELETED
@@ -1,43 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Example script showing how to use confluence-cli
4
-
5
- echo "🚀 Confluence CLI Examples"
6
- echo "========================="
7
-
8
- # Check if confluence command is available
9
- if ! command -v confluence &> /dev/null; then
10
- echo "❌ confluence command not found. Please install confluence-cli first:"
11
- echo " npm install -g confluence-cli"
12
- exit 1
13
- fi
14
-
15
- echo ""
16
- echo "📋 Listing all spaces..."
17
- confluence spaces
18
-
19
- echo ""
20
- echo "🔍 Searching for 'API' documentation..."
21
- confluence search "API" --limit 5
22
-
23
- echo ""
24
- echo "â„šī¸ Getting information about a specific page..."
25
- # Replace this with an actual page ID from your Confluence
26
- read -p "Enter a page ID to get info: " PAGE_ID
27
- if [ ! -z "$PAGE_ID" ]; then
28
- confluence info "$PAGE_ID"
29
-
30
- echo ""
31
- read -p "Do you want to read this page? (y/N): " READ_PAGE
32
- if [ "$READ_PAGE" = "y" ] || [ "$READ_PAGE" = "Y" ]; then
33
- echo ""
34
- echo "📖 Reading page content..."
35
- confluence read "$PAGE_ID" | head -20
36
- echo ""
37
- echo "(Showing first 20 lines only)"
38
- fi
39
- fi
40
-
41
- echo ""
42
- echo "✅ Examples completed!"
43
- echo "💡 Run 'confluence --help' for more commands"
@@ -1,30 +0,0 @@
1
- # Welcome to Confluence CLI
2
-
3
- This is a sample page created using the **Confluence CLI** tool.
4
-
5
- ## Features
6
-
7
- - Easy page creation from Markdown files
8
- - Support for multiple content formats
9
- - Command-line interface for automation
10
-
11
- ## Code Example
12
-
13
- ```javascript
14
- const client = new ConfluenceClient(config);
15
- await client.createPage('My Page', 'SPACE', content, 'markdown');
16
- ```
17
-
18
- ## Lists
19
-
20
- 1. First item
21
- 2. Second item
22
- 3. Third item
23
-
24
- - Bullet point one
25
- - Bullet point two
26
- - Bullet point three
27
-
28
- ---
29
-
30
- *Created with â¤ī¸ using confluence-cli*
package/jest.config.js DELETED
@@ -1,13 +0,0 @@
1
- module.exports = {
2
- testEnvironment: 'node',
3
- collectCoverageFrom: [
4
- 'lib/**/*.js',
5
- 'bin/**/*.js',
6
- '!node_modules/**'
7
- ],
8
- coverageDirectory: 'coverage',
9
- coverageReporters: ['text', 'lcov', 'html'],
10
- testMatch: [
11
- '**/tests/**/*.test.js'
12
- ]
13
- };