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
DataSourceDestination
Page metadatastate.json pagespages table
Attachmentsstate.json attachmentsattachments table
Sync statestate.json syncStatePreserved per page
Last sync timestate.json lastSyncsync_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:

FieldDescription
pageIdConfluence page ID
pathLocal file path
titlePage title
spaceKeyConfluence space
versionConfluence version number
syncStatesynced, local-modified, remote-modified, conflict
lastModifiedWhen page was last edited in Confluence
createdByUser ID who created the page
lastModifiedByUser ID who last edited
contentStatuscurrent, draft, archived
isRestrictedHas view/edit restrictions

Internal and external links extracted from pages:

FieldDescription
sourcePageIdPage containing the link
targetPageIdLinked page (if internal)
targetPathLink URL or path
linkTypeinternal, external, attachment
isBrokenWhether target exists
lineNumberLine number in markdown

Confluence user information:

FieldDescription
userIdConfluence account ID
displayNameUser’s display name
emailUser’s email (if available)
isActiveWhether user account is active
lastCheckedAtWhen status was last verified

Page authorship tracking:

FieldDescription
pageIdPage ID
userIdContributor’s user ID
contributionTypecreator, editor

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

{
"storage": {
"adapter": "sqlite",
"sqlite": {
"enableVectors": false
}
}
}
OptionDescriptionDefault
adapterStorage backend: sqlite, jsonsqlite
sqlite.enableVectorsEnable vector search (experimental)false

Configure sync-related settings:

{
"sync": {
"userStatusTtlDays": 7,
"skipUserStatusCheck": false,
"postPullAuditSummary": false
}
}
OptionDescriptionDefault
userStatusTtlDaysDays before re-checking user status7
skipUserStatusCheckSkip user status updates during pullfalse
postPullAuditSummaryShow audit summary after pullfalse

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.