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/.claude/skills/confluence/SKILL.md +610 -0
- package/README.md +12 -0
- package/bin/confluence.js +44 -0
- package/package.json +7 -2
- package/.eslintrc.js +0 -23
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -34
- package/.github/ISSUE_TEMPLATE/feature_request.md +0 -26
- package/.github/ISSUE_TEMPLATE/feedback.md +0 -37
- package/.github/pull_request_template.md +0 -31
- package/.github/workflows/ci.yml +0 -68
- package/.releaserc +0 -17
- package/CHANGELOG.md +0 -274
- package/CONTRIBUTING.md +0 -246
- package/docs/PROMOTION.md +0 -63
- package/eslint.config.js +0 -33
- package/examples/copy-tree-example.sh +0 -117
- package/examples/create-child-page-example.sh +0 -67
- package/examples/demo-page-management.sh +0 -68
- package/examples/demo.sh +0 -43
- package/examples/sample-page.md +0 -30
- package/jest.config.js +0 -13
- package/llms.txt +0 -46
- package/tests/config.test.js +0 -79
- package/tests/confluence-client.test.js +0 -1063
package/llms.txt
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# Confluence CLI
|
|
2
|
-
|
|
3
|
-
> A powerful command-line interface for Atlassian Confluence that allows you to read, search, and manage your Confluence content from the terminal.
|
|
4
|
-
|
|
5
|
-
This CLI tool provides a comprehensive set of commands for interacting with Confluence. Key features include creating, reading, updating, and searching for pages. It supports various content formats like markdown and HTML.
|
|
6
|
-
|
|
7
|
-
To get started, install the tool via npm and initialize the configuration:
|
|
8
|
-
```sh
|
|
9
|
-
npm install -g confluence-cli
|
|
10
|
-
confluence init
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Documentation
|
|
14
|
-
|
|
15
|
-
- [README.md](./README.md): Main documentation with installation, usage, and command reference.
|
|
16
|
-
|
|
17
|
-
## Core Source Code
|
|
18
|
-
|
|
19
|
-
- [bin/confluence.js](./bin/confluence.js): The main entry point for the CLI, defines commands and argument parsing.
|
|
20
|
-
- [lib/confluence-client.js](./lib/confluence-client.js): The client library for interacting with the Confluence REST API.
|
|
21
|
-
- [package.json](./package.json): Project metadata, dependencies, and scripts.
|
|
22
|
-
|
|
23
|
-
## Recent Changes & Fixes
|
|
24
|
-
|
|
25
|
-
This section summarizes recent improvements to align the codebase with its documentation and fix bugs.
|
|
26
|
-
|
|
27
|
-
### `update` Command Logic and Documentation:
|
|
28
|
-
- **Inconsistency:** The `README.md` suggested that updating a page's title without changing its content was possible. However, the implementation in `bin/confluence.js` incorrectly threw an error if the `--content` or `--file` flags were not provided, making title-only updates impossible.
|
|
29
|
-
- **Fix:**
|
|
30
|
-
- Modified `updatePage` in `lib/confluence-client.js` to fetch and re-use existing page content if no new content is provided.
|
|
31
|
-
- Adjusted validation in `bin/confluence.js` for the `update` command to only require one of `--title`, `--content`, or `--file`.
|
|
32
|
-
- Updated `README.md` with an example of a title-only update.
|
|
33
|
-
|
|
34
|
-
### Incomplete `README.md` Command Reference:
|
|
35
|
-
- **Inconsistency:** The main command table in `README.md` was missing several commands (`create`, `create-child`, `update`, `edit`, `find`).
|
|
36
|
-
- **Fix:** Expanded the command table in `README.md` to include all available commands.
|
|
37
|
-
|
|
38
|
-
### Misleading `read` Command URL Examples:
|
|
39
|
-
- **Inconsistency:** The documentation for the `read` command used "display" or "pretty" URLs, which are not supported by the `extractPageId` function.
|
|
40
|
-
- **Fix:** Removed incorrect URL examples and clarified that only URLs with a `pageId` query parameter are supported.
|
|
41
|
-
|
|
42
|
-
## Next Steps
|
|
43
|
-
|
|
44
|
-
- Refer to [README.md](./README.md) for detailed usage instructions and advanced configuration.
|
|
45
|
-
- For troubleshooting or to contribute, visit the project's GitHub repository at https://github.com/pchuri/confluence-cli.
|
|
46
|
-
- If you encounter issues, open an issue or check the FAQ section in the documentation.
|
package/tests/config.test.js
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
const { getConfig } = require('../lib/config');
|
|
2
|
-
|
|
3
|
-
// Save and restore all relevant env vars around each test
|
|
4
|
-
const ENV_KEYS = [
|
|
5
|
-
'CONFLUENCE_DOMAIN', 'CONFLUENCE_HOST',
|
|
6
|
-
'CONFLUENCE_API_TOKEN', 'CONFLUENCE_PASSWORD',
|
|
7
|
-
'CONFLUENCE_EMAIL', 'CONFLUENCE_USERNAME',
|
|
8
|
-
'CONFLUENCE_AUTH_TYPE', 'CONFLUENCE_API_PATH'
|
|
9
|
-
];
|
|
10
|
-
|
|
11
|
-
describe('getConfig env var aliases', () => {
|
|
12
|
-
const saved = {};
|
|
13
|
-
|
|
14
|
-
beforeEach(() => {
|
|
15
|
-
for (const key of ENV_KEYS) {
|
|
16
|
-
saved[key] = process.env[key];
|
|
17
|
-
delete process.env[key];
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
afterEach(() => {
|
|
22
|
-
for (const key of ENV_KEYS) {
|
|
23
|
-
if (saved[key] !== undefined) {
|
|
24
|
-
process.env[key] = saved[key];
|
|
25
|
-
} else {
|
|
26
|
-
delete process.env[key];
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
test('CONFLUENCE_USERNAME is used when CONFLUENCE_EMAIL is not set', () => {
|
|
32
|
-
process.env.CONFLUENCE_DOMAIN = 'on-prem.example.com';
|
|
33
|
-
process.env.CONFLUENCE_PASSWORD = 'secret';
|
|
34
|
-
process.env.CONFLUENCE_USERNAME = 'admin';
|
|
35
|
-
process.env.CONFLUENCE_AUTH_TYPE = 'basic';
|
|
36
|
-
|
|
37
|
-
const config = getConfig();
|
|
38
|
-
expect(config.email).toBe('admin');
|
|
39
|
-
expect(config.token).toBe('secret');
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
test('CONFLUENCE_EMAIL takes priority over CONFLUENCE_USERNAME', () => {
|
|
43
|
-
process.env.CONFLUENCE_DOMAIN = 'cloud.atlassian.net';
|
|
44
|
-
process.env.CONFLUENCE_API_TOKEN = 'api-token';
|
|
45
|
-
process.env.CONFLUENCE_EMAIL = 'user@example.com';
|
|
46
|
-
process.env.CONFLUENCE_USERNAME = 'admin';
|
|
47
|
-
process.env.CONFLUENCE_AUTH_TYPE = 'basic';
|
|
48
|
-
|
|
49
|
-
const config = getConfig();
|
|
50
|
-
expect(config.email).toBe('user@example.com');
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
test('CONFLUENCE_PASSWORD is used when CONFLUENCE_API_TOKEN is not set', () => {
|
|
54
|
-
process.env.CONFLUENCE_DOMAIN = 'on-prem.example.com';
|
|
55
|
-
process.env.CONFLUENCE_PASSWORD = 'my-password';
|
|
56
|
-
process.env.CONFLUENCE_USERNAME = 'admin';
|
|
57
|
-
process.env.CONFLUENCE_AUTH_TYPE = 'basic';
|
|
58
|
-
|
|
59
|
-
const config = getConfig();
|
|
60
|
-
expect(config.token).toBe('my-password');
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
test('CONFLUENCE_API_TOKEN takes priority over CONFLUENCE_PASSWORD', () => {
|
|
64
|
-
process.env.CONFLUENCE_DOMAIN = 'cloud.atlassian.net';
|
|
65
|
-
process.env.CONFLUENCE_API_TOKEN = 'api-token';
|
|
66
|
-
process.env.CONFLUENCE_PASSWORD = 'password';
|
|
67
|
-
|
|
68
|
-
const config = getConfig();
|
|
69
|
-
expect(config.token).toBe('api-token');
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
test('CONFLUENCE_HOST alias still works for domain', () => {
|
|
73
|
-
process.env.CONFLUENCE_HOST = 'host.example.com';
|
|
74
|
-
process.env.CONFLUENCE_API_TOKEN = 'token';
|
|
75
|
-
|
|
76
|
-
const config = getConfig();
|
|
77
|
-
expect(config.domain).toBe('host.example.com');
|
|
78
|
-
});
|
|
79
|
-
});
|