Skip to content

Storage & Sync Database

atlcli uses SQLite to store sync state, enabling advanced features like link tracking, contributor analysis, and content auditing.

When you sync pages with Confluence, atlcli stores metadata in a local SQLite database (.atlcli/sync.db). This enables:

  • Fast queries - Instant lookups without parsing JSON
  • Link graph - Track internal and external links between pages
  • Contributor tracking - Know who edited each page
  • User status - Track active/inactive Confluence users
  • Audit capabilities - Analyze content health efficiently

If you’re upgrading from a previous version of atlcli that used state.json, your data is automatically migrated to SQLite.

  1. On first sync operation after upgrade, atlcli detects state.json
  2. Creates a backup at state.json.bak
  3. Migrates all data to sync.db
  4. Removes the original state.json
Data Source Destination
Page metadata state.json pages pages table
Attachments state.json attachments attachments table
Sync state state.json syncState Preserved per page
Last sync time state.json lastSync sync_meta table

You don’t need to do anything - migration happens automatically during normal operations. After migration:

.atlcli/
├── sync.db # New SQLite database
├── state.json.bak # Backup of original (safe to delete after verifying)
└── config.json # Unchanged

Before migration, atlcli creates state.json.bak. Keep this until you’ve verified everything works.

Back up the SQLite database:

Terminal window
cp .atlcli/sync.db .atlcli/sync.db.backup

If you need to revert to the old JSON format:

Terminal window
# Remove SQLite database
rm .atlcli/sync.db
# Restore JSON state
cp .atlcli/state.json.bak .atlcli/state.json

Then use an older version of atlcli, or wait for a fix if there’s an issue.

Core page metadata synced from Confluence:

Field Description
pageId Confluence page ID
path Local file path
title Page title
spaceKey Confluence space
version Confluence version number
syncState synced, local-modified, remote-modified, conflict
lastModified When page was last edited in Confluence
createdBy User ID who created the page
lastModifiedBy User ID who last edited
contentStatus current, draft, archived
isRestricted Has view/edit restrictions

Internal and external links extracted from pages:

Field Description
sourcePageId Page containing the link
targetPageId Linked page (if internal)
targetPath Link URL or path
linkType internal, external, attachment
isBroken Whether target exists
lineNumber Line number in markdown

Confluence user information:

Field Description
userId Confluence account ID
displayName User’s display name
email User’s email (if available)
isActive Whether user account is active
lastCheckedAt When status was last verified

Page authorship tracking:

Field Description
pageId Page ID
userId Contributor’s user ID
contributionType creator, editor

Configure storage in ~/.atlcli/config.json:

{
"storage": {
"adapter": "sqlite",
"sqlite": {
"enableVectors": false
}
}
}
Option Description Default
adapter Storage backend: sqlite, json sqlite
sqlite.enableVectors Enable vector search (experimental) false

Configure sync-related settings:

{
"sync": {
"userStatusTtlDays": 7,
"skipUserStatusCheck": false,
"postPullAuditSummary": false
}
}
Option Description Default
userStatusTtlDays Days before re-checking user status 7
skipUserStatusCheck Skip user status updates during pull false
postPullAuditSummary Show audit summary after pull false

atlcli stores the sync database at:

<project>/.atlcli/sync.db

This file should be:

  • Not committed to git (add .atlcli/ to .gitignore)
  • Backed up if you have local-only changes
  • Recreatable by running atlcli wiki docs pull

You can query the database directly with SQLite tools:

Terminal window
sqlite3 .atlcli/sync.db "SELECT title, syncState FROM pages"

If the database becomes corrupted:

Terminal window
# Remove database
rm .atlcli/sync.db
# Re-sync from Confluence
atlcli wiki docs pull

Re-extract links from local markdown files:

Terminal window
atlcli audit wiki --rebuild-graph

For team environments, PostgreSQL support is planned:

{
"storage": {
"adapter": "postgres",
"postgres": {
"connectionString": "postgresql://user:pass@host/db",
"schema": "atlcli"
}
}
}

This will enable:

  • Shared sync state across team members
  • Centralized audit dashboards
  • Server-side link validation
Jira and Confluence are trademarks of Atlassian Corporation Plc. atlcli is not affiliated with, endorsed by, or sponsored by Atlassian.