Installation
Prerequisites
- Node.js 18+ or Bun 1.0+
- npm, pnpm, or bun package manager
Install from npm
bash
npm install -g optimal-cliThis installs the optimal binary globally.
Verify Installation
bash
optimal --version
# 4.0.0
optimal doctorThe doctor command validates your setup: checks credentials, verifies Supabase connectivity, and reports any missing configuration.
Environment Variables
Create a .env file in your working directory or set these globally:
bash
# OptimalOS Supabase (board, agents, content, config)
OPTIMAL_SUPABASE_URL=https://your-project.supabase.co
OPTIMAL_SUPABASE_SERVICE_KEY=eyJ...
# ReturnPro Supabase (financial data)
RETURNPRO_SUPABASE_URL=https://your-returnpro.supabase.co
RETURNPRO_SUPABASE_SERVICE_KEY=eyJ...
# AI Content Generation
GROQ_API_KEY=gsk_...
GROQ_MODEL=llama-3.3-70b-versatile
# Strapi CMS
STRAPI_URL=https://strapi.example.com
STRAPI_API_TOKEN=...
# News
NEWSAPI_KEY=...
# Discord Bot
DISCORD_BOT_TOKEN=...
DISCORD_GUILD_ID=...
# Optional: Meta/Instagram publishing
META_ACCESS_TOKEN=...
META_IG_ACCOUNT_ID=...TIP
Run optimal doctor to check which variables are set and which are missing.
Configuration
Initialize your local configuration:
bash
optimal config init --owner carlos --brand CRE-11TRUSTThis creates ~/.optimal/optimal.config.json with your profile and preferences.
Auto-Fix
If you're setting up for the first time:
bash
optimal doctor --fixThis registers your agent profile and sets up any required cron jobs automatically.