Skip to content

Sync Commands

The sync command group manages cross-platform synchronization: Discord integration, config profile management, bot registration, and npm version watching.

Discord Sync

The Discord sync commands keep your Kanban board in sync with Discord channels. Tasks map to Discord threads, and updates flow in both directions.

sync discord:init

Initialize Discord channels for task sync. Sets up the required channels and permissions in your Discord server.

bash
optimal sync discord:init
optimal sync discord:init --dry-run
FlagDescription
--dry-runPreview without creating channels

TIP

Run this once when setting up Discord integration for the first time. Requires DISCORD_BOT_TOKEN in your environment.


sync discord:push

Push tasks from Supabase to Discord. Creates or updates Discord threads to match the current board state.

bash
optimal sync discord:push
optimal sync discord:push --dry-run
FlagDescription
--dry-runPreview without creating threads

sync discord:pull

Pull messages and updates from Discord back into Supabase. Captures comments, status changes, and new tasks created in Discord.

bash
optimal sync discord:pull
optimal sync discord:pull --dry-run
FlagDescription
--dry-runPreview without making changes

sync discord:status

Show the diff between Discord and Supabase. Identifies tasks that are out of sync, missing on one side, or have conflicting data.

bash
optimal sync discord:status

sync discord:sync

Bidirectional sync: push Supabase tasks to Discord, then pull Discord state back to Supabase.

bash
optimal sync discord:sync
optimal sync discord:sync --dry-run
FlagDescription
--dry-runPreview without making changes

sync discord:watch

Watch Discord for real-time changes and sync them to Supabase automatically. This is a long-running process, typically run as a service.

bash
optimal sync discord:watch
optimal sync discord:watch --role Optimal
FlagDescription
--roleRequired Discord role name for access (default: Optimal)

TIP

On the Oracle Pi, this runs as a systemd service (optimal-discord.service) for persistent monitoring. Use systemctl status optimal-discord to check its state.

Config Profile Commands

The config profile system lives under sync config and manages local CLI configuration profiles with remote registry sync.

sync config init

Initialize a local config scaffold.

bash
optimal sync config init --owner optimal-tech --brand CRE-11TRUST
FlagDescription
--ownerConfig owner (defaults to $OPTIMAL_CONFIG_OWNER or $USER)
--profileProfile name (default: default)
--brandDefault brand (default: CRE-11TRUST)
--timezoneDefault timezone (default: America/New_York)
--forceOverwrite existing config

sync config doctor

Validate the local config file and print health details.

bash
optimal sync config doctor

Reports the config path, profile name, owner, version, and hash.


sync config show

Display the current local config in full.

bash
optimal sync config show
optimal sync config show --json
FlagDescription
--jsonOutput as JSON

sync config export

Backup your current configuration to a file.

bash
optimal sync config export --out ./optimal-config-backup.json
FlagDescription
--outOutput file path for the backup (required)

WARNING

The exported file may contain sensitive configuration values. Store it securely and do not commit it to version control.


sync config import

Restore configuration from a backup file.

bash
optimal sync config import --in ./optimal-config-backup.json
FlagDescription
--inPath to the configuration backup file (required)

sync config list

List all profiles in the shared registry.

bash
optimal sync config list
optimal sync config list --owner oracle
FlagDescription
--ownerFilter by owner

sync config sync pull

Pull a config profile from the shared registry into local config.

bash
optimal sync config sync pull --profile default
FlagDescription
--profileRegistry profile name (default: default)
--ownerConfig owner

sync config sync push

Push local config profile to the shared registry.

bash
optimal sync config sync push --profile default
FlagDescription
--agentAgent/owner name
--profileRegistry profile name (default: default)
--forceForce write even on conflict

Bot Registration

sync register

Register a bot with admin config and sync credentials.

bash
optimal sync register --agent bot1 --email you@example.com
optimal sync register --agent oracle --email you@example.com --admin
FlagDescription
--agentAgent/bot name
--emailOwner email
--adminRegister as admin (publishes config for other bots)

sync bots

List all registered bots.

bash
optimal sync bots

sync npm:watch

Check npm registry for new version of optimal-cli.

bash
optimal sync npm:watch
optimal sync npm:watch --package optimal-cli
FlagDescription
--packagePackage name to check (default: optimal-cli)

Shared Environment Sync

These commands live under the top-level config group (not sync config).

config seed-shared

Push local .env variables to the shared environment store.

bash
optimal config seed-shared
optimal config seed-shared --env-file .env.production
FlagDescription
--env-filePath to .env file (default: .env)

config pull-shared

Pull shared variables from the registry into your local .env file.

bash
optimal config pull-shared
optimal config pull-shared --email clenis@optimaltech.ai
FlagDescription
--emailOwner email to pull from (defaults to OPTIMAL_OWNER_EMAIL or cached auth)
--env-filePath to .env file to write (default: .env)

TIP

Use config seed-shared and config pull-shared to keep environment variables consistent across multiple machines (e.g., syncing between a development laptop and the Oracle Pi).

Built by Carlos Lenis in Miami