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.
optimal sync discord:init
optimal sync discord:init --dry-run| Flag | Description |
|---|---|
--dry-run | Preview 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.
optimal sync discord:push
optimal sync discord:push --dry-run| Flag | Description |
|---|---|
--dry-run | Preview 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.
optimal sync discord:pull
optimal sync discord:pull --dry-run| Flag | Description |
|---|---|
--dry-run | Preview 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.
optimal sync discord:statussync discord:sync
Bidirectional sync: push Supabase tasks to Discord, then pull Discord state back to Supabase.
optimal sync discord:sync
optimal sync discord:sync --dry-run| Flag | Description |
|---|---|
--dry-run | Preview 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.
optimal sync discord:watch
optimal sync discord:watch --role Optimal| Flag | Description |
|---|---|
--role | Required 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.
optimal sync config init --owner optimal-tech --brand CRE-11TRUST| Flag | Description |
|---|---|
--owner | Config owner (defaults to $OPTIMAL_CONFIG_OWNER or $USER) |
--profile | Profile name (default: default) |
--brand | Default brand (default: CRE-11TRUST) |
--timezone | Default timezone (default: America/New_York) |
--force | Overwrite existing config |
sync config doctor
Validate the local config file and print health details.
optimal sync config doctorReports the config path, profile name, owner, version, and hash.
sync config show
Display the current local config in full.
optimal sync config show
optimal sync config show --json| Flag | Description |
|---|---|
--json | Output as JSON |
sync config export
Backup your current configuration to a file.
optimal sync config export --out ./optimal-config-backup.json| Flag | Description |
|---|---|
--out | Output 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.
optimal sync config import --in ./optimal-config-backup.json| Flag | Description |
|---|---|
--in | Path to the configuration backup file (required) |
sync config list
List all profiles in the shared registry.
optimal sync config list
optimal sync config list --owner oracle| Flag | Description |
|---|---|
--owner | Filter by owner |
sync config sync pull
Pull a config profile from the shared registry into local config.
optimal sync config sync pull --profile default| Flag | Description |
|---|---|
--profile | Registry profile name (default: default) |
--owner | Config owner |
sync config sync push
Push local config profile to the shared registry.
optimal sync config sync push --profile default| Flag | Description |
|---|---|
--agent | Agent/owner name |
--profile | Registry profile name (default: default) |
--force | Force write even on conflict |
Bot Registration
sync register
Register a bot with admin config and sync credentials.
optimal sync register --agent bot1 --email you@example.com
optimal sync register --agent oracle --email you@example.com --admin| Flag | Description |
|---|---|
--agent | Agent/bot name |
--email | Owner email |
--admin | Register as admin (publishes config for other bots) |
sync bots
List all registered bots.
optimal sync botssync npm:watch
Check npm registry for new version of optimal-cli.
optimal sync npm:watch
optimal sync npm:watch --package optimal-cli| Flag | Description |
|---|---|
--package | Package 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.
optimal config seed-shared
optimal config seed-shared --env-file .env.production| Flag | Description |
|---|---|
--env-file | Path to .env file (default: .env) |
config pull-shared
Pull shared variables from the registry into your local .env file.
optimal config pull-shared
optimal config pull-shared --email clenis@optimaltech.ai| Flag | Description |
|---|---|
--email | Owner email to pull from (defaults to OPTIMAL_OWNER_EMAIL or cached auth) |
--env-file | Path 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).