### Development Setup for Confluence CLI
Source: https://github.com/pchuri/confluence-cli/blob/main/CONTRIBUTING.md
Installs dependencies, sets up environment variables for testing, and runs a help command to verify the CLI setup.
```bash
git clone https://github.com/your-username/confluence-cli.git
cd confluence-cli
npm install
export CONFLUENCE_DOMAIN="your-test-domain.atlassian.net"
export CONFLUENCE_API_TOKEN="your-test-token"
node bin/confluence.js --help
```
--------------------------------
### Initialize Confluence CLI Configuration
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/cli-reference.md
Run the init command to start an interactive setup for configuring the confluence-cli. This process prompts for necessary details to create a new profile.
```bash
confluence init
```
--------------------------------
### Install and Initialize Confluence CLI
Source: https://github.com/pchuri/confluence-cli/blob/main/plugins/confluence/README.md
Install the confluence-cli globally and initialize its configuration. Ensure this is done before using the plugin.
```bash
npm install -g confluence-cli
confluence init
```
--------------------------------
### Install Claude Code Skill Documentation
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/cli-reference.md
Installs the Claude Code skill documentation, creating a specific file in the .claude/skills/confluence directory. No setup is required.
```bash
confluence install-skill
```
--------------------------------
### Example Configuration Precedence
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/configuration.md
Demonstrates how command-line flags, environment variables, and profile configurations interact to determine the final settings. This example overrides the domain using an environment variable while specifying a profile.
```bash
# Uses 'staging' profile, overrides domain with env var
CONFLUENCE_DOMAIN=staging2.atlassian.net confluence read 123 --profile staging
```
--------------------------------
### Install and Run Confluence CLI Locally
Source: https://github.com/pchuri/confluence-cli/blob/main/README.md
Clone the repository, install dependencies, and run the CLI locally. Use the `--help` flag to see available commands.
```bash
git clone https://github.com/pchuri/confluence-cli.git
cd confluence-cli
npm install
npm start -- --help
```
```bash
npm test
```
```bash
npm run lint
```
--------------------------------
### Markdown to Storage Conversion Example
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/api-reference/utility-modules.md
Example demonstrating markdownToStorage conversion, including a warning admonition.
```javascript
const storage = converter.markdownToStorage(`
# Project
[!warning]
This is a warning
`);
```
--------------------------------
### Install and Verify Confluence CLI
Source: https://github.com/pchuri/confluence-cli/blob/main/plugins/confluence/skills/confluence/SKILL.md
Install the confluence-cli globally using npm and verify the installation by checking the version.
```sh
npm install -g confluence-cli
confluence --version # verify install
```
--------------------------------
### Local Testing Setup
Source: https://github.com/pchuri/confluence-cli/blob/main/CONTRIBUTING.md
Environment variables and commands for testing the CLI against a live Confluence instance.
```bash
# Test against your Confluence instance
export CONFLUENCE_DOMAIN="your-domain.atlassian.net"
export CONFLUENCE_API_TOKEN="your-token"
# Test commands
node bin/confluence.js spaces
node bin/confluence.js search "test"
node bin/confluence.js read 123456789
```
--------------------------------
### Install Confluence CLI via npm
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/README.md
Install the package globally using npm.
```bash
# Via npm
npm install -g confluence-cli
```
--------------------------------
### confluence install-skill
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/cli-reference.md
Install Claude Code skill documentation.
```APIDOC
## confluence install-skill
### Description
Install Claude Code skill documentation. This command creates `.claude/skills/confluence/SKILL.md` with skill documentation.
### Command
```bash
confluence install-skill
```
```
--------------------------------
### Full HTML to Confluence Storage Conversion Example
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/api-reference/format-converters.md
Provides a comprehensive example of converting a multi-element HTML string, including headings, paragraphs, emphasis, lists, and links, to Confluence storage format using the 'wiki' link style.
```javascript
const html = `
Title
This is bold and italic.
Item 1
Item 2
`;
const storage = htmlToStorage(html, { linkStyle: 'wiki' });
```
--------------------------------
### Install Confluence CLI via Homebrew
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/README.md
Install the package using Homebrew for macOS and Linux systems.
```bash
# Via Homebrew (macOS/Linux)
brew install pchuri/tap/confluence-cli
```
--------------------------------
### Show CLI Usage Statistics
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/cli-reference.md
Use this command to display statistics about the CLI usage. No setup is required.
```bash
confluence stats
```
--------------------------------
### Reverse-Proxy / No-Auth Profile Setup
Source: https://github.com/pchuri/confluence-cli/blob/main/README.md
Configure the CLI for environments where authentication is handled by a reverse proxy. The `--auth-type` is set to `none`.
```bash
confluence --profile proxy init \
--domain "confluence.internal" \
--api-path "/rest/api" \
--auth-type "none"
```
--------------------------------
### Install Confluence CLI Plugin in Claude Code
Source: https://github.com/pchuri/confluence-cli/blob/main/README.md
Install the confluence-cli plugin from the marketplace within Claude Code.
```bash
/plugin install confluence@pchuri-confluence-cli
```
--------------------------------
### Complete Non-interactive Setup with CLI Flags
Source: https://github.com/pchuri/confluence-cli/blob/main/README.md
Use this command to provide all required configuration via command-line flags. This is ideal for CI/CD pipelines, Docker builds, and AI coding agents.
```bash
confluence init \
--domain "company.atlassian.net" \
--api-path "/wiki/rest/api" \
--auth-type "basic" \
--email "user@example.com" \
--token "your-api-token"
```
--------------------------------
### Install Confluence CLI Plugin
Source: https://github.com/pchuri/confluence-cli/blob/main/plugins/confluence/README.md
Install the Confluence CLI plugin from the marketplace. This command adds the plugin to your Claude Code environment.
```bash
/plugin marketplace add pchuri/confluence-cli
/plugin install confluence@pchuri-confluence-cli
```
--------------------------------
### Named Profile Setup
Source: https://github.com/pchuri/confluence-cli/blob/main/README.md
Save configurations to a specific named profile for easy management of different environments or settings.
```bash
confluence --profile staging init \
--domain "staging.example.com" \
--api-path "/rest/api" \
--auth-type "bearer" \
--token "your-personal-access-token"
```
--------------------------------
### profile add
Source: https://github.com/pchuri/confluence-cli/blob/main/plugins/confluence/skills/confluence/SKILL.md
Adds a new configuration profile. It supports the same options as the `init` command for interactive, non-interactive, or hybrid setup.
```APIDOC
## `profile add `
Add a new configuration profile. Supports the same options as `init` (interactive, non-interactive, or hybrid).
```sh
confluence profile add [--domain ] [--api-path ] [--auth-type basic|bearer] [--email ] [--token ] [--protocol http|https] [--read-only]
```
Profile names may contain letters, numbers, hyphens, and underscores only.
### Example
```sh
confluence profile add staging --domain "staging.example.com" --auth-type bearer --token "xyz"
```
```
--------------------------------
### Confluence CLI Configuration File Example
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/api-reference/config.md
A JSON configuration file with profile objects keyed by name. The 'default' profile includes domain, email, token, authType, and protocol.
```json
{
"default": {
"domain": "company.atlassian.net",
"email": "user@company.com",
"token": "ATATT...",
"authType": "basic",
"protocol": "https"
},
"staging": {
"domain": "staging.confluence.internal",
"token": "TOKEN...",
"authType": "bearer"
}
}
```
--------------------------------
### Example: Basic Storage to Markdown Conversion
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/api-reference/format-converters.md
Demonstrates a simple conversion of Confluence storage format XML containing bold, italic, and a list into Markdown. The output is logged to the console.
```javascript
const storageXml = `
Bold and italic
Item 1
Item 2
`;
const walker = new StorageWalker();
const markdown = walker.walk(storageXml);
console.log(markdown);
// Output: **Bold** and *italic*
//
// - Item 1
// - Item 2
```
--------------------------------
### Search Pages
Source: https://github.com/pchuri/confluence-cli/blob/main/README.md
Perform a basic search for pages. Use --limit and --start options for pagination.
```bash
# Basic search
confluence search "search term"
# Limit results
confluence search "search term" --limit 5
# Paginate results
confluence search "search term" --limit 5 --start 5
```
--------------------------------
### Example Commit Message for Confluence CLI
Source: https://github.com/pchuri/confluence-cli/blob/main/CONTRIBUTING.md
Demonstrates the conventional commit format for describing changes, including a summary and detailed bullet points.
```git
feat: add page creation functionality
- Add create command to CLI
- Implement createPage method in client
- Add tests for page creation
- Update README with new command
```
--------------------------------
### Twitter/X Post Example for confluence-cli
Source: https://github.com/pchuri/confluence-cli/blob/main/docs/PROMOTION.md
Use this template for a concise announcement on Twitter/X, highlighting key features and relevant hashtags. Includes a link to the GitHub repository.
```text
🚀 Just released confluence-cli v1.0!
A powerful CLI tool for @Atlassian Confluence:
✅ Read pages from terminal
✅ Search documentation
✅ List spaces
✅ Works with environment variables
Perfect for automation & DevOps workflows!
#CLI #Confluence #DevTools #OpenSource
https://github.com/pchuri/confluence-cli
```
--------------------------------
### Hybrid Mode Setup (Partial Flags)
Source: https://github.com/pchuri/confluence-cli/blob/main/README.md
Utilize hybrid mode by providing some fields via flags and allowing the CLI to prompt for the remaining required information.
```bash
# Domain and token provided, will prompt for auth method and email
confluence init --domain "company.atlassian.net" --token "your-api-token"
```
```bash
# Email indicates basic auth, will prompt for domain and token
confluence init --email "user@example.com" --token "your-api-token"
```
--------------------------------
### Install Confluence CLI Skill
Source: https://github.com/pchuri/confluence-cli/blob/main/plugins/confluence/skills/confluence/SKILL.md
Copies the Claude Code skill documentation into the project's .claude/skills/confluence directory to enable automatic learning of the Confluence CLI.
```sh
confluence install-skill [--dest ] [--yes]
```
```sh
confluence install-skill
```
--------------------------------
### Run Confluence CLI with npx
Source: https://github.com/pchuri/confluence-cli/blob/main/README.md
Execute confluence-cli commands directly without a global installation using npx.
```bash
npx confluence-cli
```
--------------------------------
### Get Default Profile Configuration
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/api-reference/config.md
Load the default profile configuration. Returns an object with Confluence connection settings.
```javascript
const defaultConfig = config.getDefaultProfile();
```
--------------------------------
### Scoped API Token Setup for Agents
Source: https://github.com/pchuri/confluence-cli/blob/main/README.md
Configure the CLI with a scoped API token for enhanced security, following the principle of least privilege. Replace with your actual Cloud ID.
```bash
# Replace with your actual Cloud ID
confluence init \
--domain "api.atlassian.com" \
--api-path "/ex/confluence//wiki/rest/api" \
--auth-type "basic" \
--email "user@example.com" \
--token "your-scoped-token"
```
--------------------------------
### LinkedIn Post Example for confluence-cli
Source: https://github.com/pchuri/confluence-cli/blob/main/docs/PROMOTION.md
Adapt this LinkedIn post to share the project with a professional network, emphasizing its utility for documentation workflows and CI/CD integration. Encourages feedback.
```text
Excited to share my latest open-source project: confluence-cli! 🎉
As someone who works with Confluence daily, I built this CLI tool to streamline documentation workflows. Now you can:
• Read Confluence pages from your terminal
• Search across your wiki content
• Integrate with CI/CD pipelines
• Automate documentation tasks
Available on NPM and fully open-source. Would love your feedback!
#OpenSource #CLI #Confluence #DevTools #Automation
```
--------------------------------
### Batch Create Confluence Pages
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/cli-reference.md
Automate the creation of multiple pages by reading titles from a file and using a loop. This example creates pages with a timestamped content.
```bash
while IFS= read -r title;
do
confluence create "$title" DOCS --content "Created: $(date)"
done < titles.txt
```
--------------------------------
### Markdown with Confluence Extensions
Source: https://github.com/pchuri/confluence-cli/blob/main/CONTRIBUTING.md
Example of markdown syntax supporting Confluence-specific extensions like admonitions and native storage format conversion.
```markdown
# My Page
[!info]
This is an info admonition that will render as a Confluence info macro.
```javascript
console.log("Code blocks preserve syntax highlighting");
```
| Feature | Status |
|---------|--------|
| Tables | ✅ |
| Lists | ✅ |
```
--------------------------------
### Chain Confluence CLI Commands
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/cli-reference.md
Combine CLI commands to perform multi-step operations. This example finds a page ID by title and then reads the page content.
```bash
PAGE_ID=$(confluence find "Home" --json | jq -r '.[0].id')
confluence read "$PAGE_ID" --format markdown
```
--------------------------------
### Build Documentation Hierarchy
Source: https://github.com/pchuri/confluence-cli/blob/main/plugins/confluence/skills/confluence/SKILL.md
Create a root page and then add child pages under it, either with inline content or from a file. The returned ID of the root page is used for creating children.
```sh
# Create root page, note the returned ID (e.g. 111222333)
confluence create "Project Overview" MYSPACE --content "# Overview" --format markdown
# Add children under it
confluence create-child "Architecture" 111222333 --content "# Architecture" --format markdown
confluence create-child "API Reference" 111222333 --file ./api.md --format markdown
confluence create-child "Runbooks" 111222333 --content "# Runbooks" --format markdown
```
--------------------------------
### install-skill
Source: https://github.com/pchuri/confluence-cli/blob/main/plugins/confluence/skills/confluence/SKILL.md
Copies the Claude Code skill documentation into your project's `.claude/skills/` directory, enabling Claude Code to automatically learn the confluence-cli.
```APIDOC
## `install-skill`
Copy the Claude Code skill documentation into your project's `.claude/skills/` directory so Claude Code can learn confluence-cli automatically.
```sh
confluence install-skill [--dest ] [--yes]
```
### Options
| Option | Default | Description |
|---|---|---|
| `--dest` | `./.claude/skills/confluence` | Target directory |
| `--yes` | false | Skip overwrite confirmation |
### Example
```sh
confluence install-skill
```
```
--------------------------------
### Get Page Information
Source: https://github.com/pchuri/confluence-cli/blob/main/README.md
Retrieve metadata for a page using its ID. Use --json to get machine-readable output.
```bash
confluence info 123456789
# Emit machine-readable metadata
confluence info 123456789 --json
```
--------------------------------
### init
Source: https://github.com/pchuri/confluence-cli/blob/main/README.md
Initializes the CLI configuration. Supports a read-only mode.
```APIDOC
## init
### Description
Initialize CLI configuration.
### Options
- `--read-only` - Initialize in read-only mode.
```
--------------------------------
### Initialize Confluence CLI Configuration
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/README.md
Run this command to initialize the configuration for the Confluence CLI.
```bash
# Initialize configuration
confluence init
```
--------------------------------
### Initialize Default Profile
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/configuration.md
Run this command to set up the initial 'default' profile. It will prompt for your Confluence domain, email, API token, and authentication type.
```bash
confluence init
# Prompts: domain, email, token, auth type
# Saves to 'default' profile
```
--------------------------------
### Analytics.getStats
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/api-reference/utility-modules.md
Get aggregated usage statistics for command executions.
```APIDOC
## Analytics.getStats
### Description
Get aggregated usage statistics.
### Method
analytics.getStats()
### Response
#### Success Response
- **object** - Object with command counts and success rates
### Response Example
```javascript
const stats = analytics.getStats();
console.log(stats); // {read: {total: 42, success: 40}, ...}
```
```
--------------------------------
### Initialize MacroConverter
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/api-reference/format-converters.md
Instantiates the `MacroConverter` with configuration options. Use this to set up the converter for Cloud or Server instances, specify URL prefixes, and define how links should be built.
```javascript
const MacroConverter = require('./lib/macro-converter');
const converter = new MacroConverter({
isCloud: true,
webUrlPrefix: '/wiki',
buildUrl: (path) => `https://example.com${path}`,
linkStyle: 'smart'
});
```
--------------------------------
### Markdown with Triple Backticks
Source: https://github.com/pchuri/confluence-cli/blob/main/tests/fixtures/storage-samples/04-code-and-mermaid.expected.md
An example of text containing triple backticks, often used for code blocks in Markdown.
```markdown
Some text with ```triple backticks``` inside.
```
--------------------------------
### Import and Basic Usage of htmlToStorage
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/api-reference/format-converters.md
Demonstrates how to import and use the `htmlToStorage` function with a basic HTML input and a 'smart' link style option.
```javascript
const { htmlToStorage } = require('./lib/html-to-storage');
const storage = htmlToStorage(html, { linkStyle: 'smart' });
```
--------------------------------
### View Confluence CLI Help
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/cli-reference.md
Access help documentation for the Confluence CLI. Use '--help' for global commands, specific commands, or subcommands.
```bash
confluence --help # Global help
```
```bash
confluence read --help # Command help
```
```bash
confluence comment --help # Subcommand help
```
--------------------------------
### Markdown Same-Page Anchor Link
Source: https://github.com/pchuri/confluence-cli/blob/main/README.md
Markdown links with hrefs starting with '#' become Confluence in-page anchor links.
```markdown
See [the anchor](#my-section) above.
```
--------------------------------
### Initialize Confluence Client in Node.js
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/README.md
Initialize a Confluence client instance with your domain, email, and token for authentication.
```javascript
const ConfluenceClient = require('confluence-cli/lib/confluence-client');
const client = new ConfluenceClient({
domain: 'mycompany.atlassian.net',
email: 'user@mycompany.com',
token: 'ATATT3...',
authType: 'basic'
});
```
--------------------------------
### initializeProfile
Source: https://github.com/pchuri/confluence-cli/blob/main/_autodocs/api-reference/config.md
Initializes or updates a Confluence CLI profile. This function can be used for interactive setup or to pre-fill answers, skipping prompts.
```APIDOC
## initializeProfile
### Description
Interactive setup wizard for creating or updating a profile.
### Method
```javascript
async function initializeProfile(profileName = 'default', answers = null)
```
### Parameters
#### Path Parameters
- **profileName** (string) - Required - Profile to create/update
- **answers** (object) - Optional - Pre-filled answers (skips prompts)
### Returns
Promise