Skip to content

feat: make Confluence API path configurable#14

Merged
pchuri merged 2 commits into
mainfrom
feature/configurable-api-path
Sep 28, 2025
Merged

feat: make Confluence API path configurable#14
pchuri merged 2 commits into
mainfrom
feature/configurable-api-path

Conversation

@pchuri

@pchuri pchuri commented Sep 28, 2025

Copy link
Copy Markdown
Owner

Summary

Adds first-class support for both /rest/api and /wiki/rest/api so the CLI works out of the box with Confluence Server/Data Center and Cloud.

Changes

  • Extend confluence init to capture the REST API path, defaulting to /wiki/rest/api for *.atlassian.net domains and /rest/api otherwise.
  • Allow overrides through a new CONFLUENCE_API_PATH environment variable.
  • Update ConfluenceClient to normalize the base path before constructing the axios client.
  • Refresh README/CHANGELOG and add unit tests covering defaulting and normalization logic.

Testing

  • npm run lint
  • npm test -- --runInBand

@pchuri
pchuri requested a review from Copilot September 28, 2025 10:44
@pchuri pchuri self-assigned this Sep 28, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds configurable REST API path support to make the CLI compatible with both Confluence Cloud (/wiki/rest/api) and Server/Data Center (/rest/api) installations out of the box.

  • Added automatic API path detection based on domain pattern (*.atlassian.net uses /wiki/rest/api, others use /rest/api)
  • Introduced CONFLUENCE_API_PATH environment variable for manual overrides
  • Updated configuration wizard to prompt for and validate API paths with smart defaults

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
lib/confluence-client.js Updated constructor to use configurable API path with sanitization
lib/config.js Added API path inference, validation, and configuration prompts
tests/confluence-client.test.js Added unit tests for API path handling and normalization
README.md Updated documentation to explain API path configuration
CHANGELOG.md Added changelog entry for the new feature

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread lib/config.js
@pchuri
pchuri requested a review from Copilot September 28, 2025 11:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread lib/config.js
Comment thread lib/confluence-client.js
@pchuri
pchuri marked this pull request as ready for review September 28, 2025 11:57
@pchuri
pchuri merged commit be000e0 into main Sep 28, 2025
5 checks passed
github-actions Bot pushed a commit that referenced this pull request Sep 28, 2025
# [1.8.0](v1.7.0...v1.8.0) (2025-09-28)

### Features

* make Confluence API path configurable ([#14](#14)) ([be000e0](be000e0)), closes [#13](#13)
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.8.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

bestend pushed a commit to bestend/confluence-cli that referenced this pull request Feb 9, 2026
* feat(config): allow configuring Confluence API path

* fix(config): allow blank api path to use default

Fixes pchuri#13
bestend pushed a commit to bestend/confluence-cli that referenced this pull request Feb 9, 2026
# [1.8.0](pchuri/confluence-cli@v1.7.0...v1.8.0) (2025-09-28)

### Features

* make Confluence API path configurable ([pchuri#14](pchuri#14)) ([447d253](pchuri@447d253)), closes [pchuri#13](pchuri#13)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants