Skip to content

API Reference

Abijith Balaji edited this page Jun 28, 2025 · 1 revision

API Reference

Command Line Usage

Run Ogresync from the command line:

python Ogresync.py [options]

Options

  • --config-dir PATH - Use custom config directory
  • --vault-path PATH - Set vault path directly
  • --no-gui - Run without GUI (background only)
  • --debug - Enable debug logging

Configuration File

Location:

  • Windows: %APPDATA%\Ogresync\config.json
  • Linux: ~/.config/ogresync/config.json

Config Options

{
  "vault_path": "/path/to/your/vault",
  "repo_url": "https://github.com/user/repo.git",
  "github_token": "your_token_here",
  "auto_sync": true,
  "sync_interval": 300,
  "backup_enabled": true,
  "max_backups": 10
}

Settings Explained

  • vault_path - Folder to sync
  • repo_url - Git repository URL
  • github_token - Your GitHub personal access token
  • auto_sync - Enable automatic syncing (true/false)
  • sync_interval - Seconds between sync checks (default: 300)
  • backup_enabled - Create backups before changes (true/false)
  • max_backups - Maximum number of backups to keep

Exit Codes

  • 0 - Success
  • 1 - General error
  • 2 - Configuration error
  • 3 - Git error
  • 4 - Network error

Environment Variables

  • OGRESYNC_CONFIG_DIR - Override config directory
  • OGRESYNC_DEBUG - Enable debug mode (set to "1")

Integration

Running as a Service

Use your system's service manager to run Ogresync automatically:

Windows (using Task Scheduler):

schtasks /create /tn "Ogresync" /tr "python C:\path\to\Ogresync.py --no-gui" /sc onstart

Linux (using systemd): Create /etc/systemd/system/ogresync.service:

[Unit]
Description=Ogresync File Sync
After=network.target

[Service]
ExecStart=python /path/to/Ogresync.py --no-gui
Restart=always
User=your-username

[Install]
WantedBy=multi-user.target

That's all the technical details you need!

Clone this wiki locally