Page History¶
View version history, compare changes, and restore previous versions.
Overview¶
Confluence tracks every edit as a version. atlcli provides:
- Version history listing
- Content comparison (diff)
- Version restoration
View History¶
List all versions of a page:
Output:
VERSION AUTHOR DATE MESSAGE
5 Alice 2025-01-14 10:30 Updated API examples
4 Bob 2025-01-13 15:45 Fixed typos
3 Alice 2025-01-12 09:00 Added authentication section
2 Alice 2025-01-10 14:20 Initial draft
1 Alice 2025-01-10 14:00 Created page
Options:
| Flag | Description |
|---|---|
--limit | Number of versions to show |
--format | Output: table, json |
View Specific Version¶
Get content at a specific version:
# View version 3
atlcli wiki page get 12345 --version 3
# Save to file
atlcli wiki page get 12345 --version 3 > old-version.md
Compare Versions (Diff)¶
Compare with Current¶
Output:
--- Version 3 (2025-01-12)
+++ Current (Version 5)
@@ -10,6 +10,10 @@
## Authentication
Use API tokens for authentication.
+
+### Token Scopes
+
+Tokens can have limited scopes for security.
Compare Two Versions¶
Diff Options¶
| Flag | Description |
|---|---|
--version | Compare this version with current |
--from | Start version for comparison |
--to | End version for comparison |
--context | Lines of context (default: 3) |
--no-color | Disable colored output |
Restore Version¶
Restore a page to a previous version:
Options:
| Flag | Description |
|---|---|
--version | Version number to restore |
--message | Restore commit message |
--confirm | Skip confirmation prompt |
Restoration Creates New Version
Restoring creates a new version (e.g., v6) with the content from the old version. The history is preserved.
Restore with Message¶
JSON Output¶
{
"schemaVersion": "1",
"pageId": "12345",
"title": "API Reference",
"versions": [
{
"number": 5,
"author": {
"displayName": "Alice",
"email": "alice@company.com"
},
"created": "2025-01-14T10:30:00Z",
"message": "Updated API examples",
"minorEdit": false
},
{
"number": 4,
"author": {
"displayName": "Bob",
"email": "bob@company.com"
},
"created": "2025-01-13T15:45:00Z",
"message": "Fixed typos",
"minorEdit": true
}
],
"total": 5
}
Sync Integration¶
Pull Specific Version¶
Version in Frontmatter¶
The current version is tracked in frontmatter:
Use Cases¶
Audit Trail¶
# See who changed what
atlcli wiki page history 12345 --json | \
jq '.versions[] | "\(.created): \(.author.displayName) - \(.message)"'
Recover Deleted Content¶
# Find when content was removed
atlcli wiki page diff 12345 --from 1 --to 5 | grep "^-"
# Restore if needed
atlcli wiki page restore 12345 --version 3
Review Changes Before Merge¶
# See what changed in latest version
atlcli wiki page diff 12345 --version $(atlcli wiki page history 12345 --json | jq '.versions[1].number')