IN PROGRESS
Technical summary
NEXUS plugin for centralized management of accounts, credentials, tokens and authentication for AI providers, with usage monitoring (CHEIA/FINAL/ESGOTADA), automatic monthly cycle refresh, email and browser alerts and MCP sync with smart account switching in the IDE.
Executed scope
plugin.json: v1.0.0, slugnexus-ia-control(nolegacy_slugs), name "NEXUS IA Control", "Integrations" category,is_core: false, public author_url and website (perciocastelo.com.br).- Schema: preexisting MySQL table
ai_accounts(the plugin creates no DDL — requires the core schema withid,email,provider,plan_type,ai_type,token_limit,token_used,status,refresh_date,special_notes,last_notified,last_notified_browser,origin,is_active,updated_at). - Plugin (
plugin.php): "Controle de IA" tab (brain-circuiticon), "Controle de IAs" doc (cpuicon), 3 modals (ia-account,ia-engines,ia-chat-test),assets/ia-control-v2.jsJS and 10 actions (ia_list,ia_save,ia_delete,ia_alerts,ia_accounts_list,ia_accounts_save,ia_accounts_delete,ia_sync_account,ia_engines_list,ia_engines_save). - Dashboard (
ia_accounts_counts) —total,used_tokens,total_limit, status counts (cheia/final/esgotada) andenergy_percent(rounded viaMath_roundhelper). - CRUD (
ia_account_save) — UPSERT byid(UPDATE) or INSERT +lastInsertId: email, provider, plan_type, ai_type, token_limit, token_used, status, refresh_date, special_notes. - Automatic +1 day refresh (
ia_check_refresh_alerts) — accounts withrefresh_date <= todayandlast_notified != refresh_dateare reset (token_used = 0,status = CHEIA, next cycle = same day next month) firing styled HTML email (violet#7c3aedtheme, "CHEIA (Resetado)" badge, next refresh and "Abrir Controle de IA →" CTA withSITE_URL). - Browser alerts (
ia_check_browser_alerts) — renewable accounts returned for native browser notification via silent polling (ia_alertsaction). - MCP sync (
ia_account_sync) — email-based upsert withorigin='mcp',is_active=1and note "[Sincronizada automaticamente via MCP Server]"; new accounts getrefresh_date+30 days; existing accounts preserve protected statuses (CHEIA/ESGOTADA/FINAL — MCP always sends 'ATIVO' from the provider API, but NEXUS keeps the manual state) and smart account switch: automatically deactivates other MCP accounts (is_active = 0), detecting IDE account switching. - No cron —
cronjob.jsonv1 withjobs: []and note "Plugin sob demanda; nenhuma rotina periódica segura ou necessária." (refresh is triggered by polling/usage). - Fastr —
/ia-controlcommand (arg_required: false,pass_task_id: false) running theia_listaction (AI accounts summary). - UI (
tab.php, 241 lines, violet#7c3aed+ slate theme) — Stats Grid v4.1 with 6 clickable/filterable high-density cards (Total violet/users, Usados pink/zap, CHEIA emerald/battery-low, FINAL amber/alert-circle, ESGOTADA rose/battery-warning, Eficiência indigo/activity) with animated progress line and active-filter overlay; Ultra-Rounded toolbar (rounded-[2.5rem], Glassmorphismbackdrop-blur-xl) with violet-600 "Nova Conta", Provider/IA/Show (10/50/100/all) filters and search; premium table (Provider Email, Type/Intelligence, Token Usage with semantic bar — emerald <70%, amber 70–90%, rose >90% or terminal status —, State badges, Origin with pulsing emerald "ATIVA NA IDE" badge for active MCP, Cycle End with relative dates "Hoje"/"em X dias" and "(NOTIFICAÇÃO +1 DIA)" note, Manage with edit/delete); contextual empty state (onboarding "Comece agora!" vs filters "Ambiente Silencioso"); icons via Lucide sprite (icons.svg#) withlucide.createIcons()watchers on AJAX mutations. - Modals —
ia-account(unified CRUD "Gerenciar IA"/"Nova IA" with "Configurar provedores" link),ia-engines(custom AI engines — name, lucide icon, delete/add; persisted in theai_enginessetting),ia-chat-test(chat test withcurrentChatURL, test message and "Refinar Prompt (IA Magic)"). - i18n via
$t('ia.*')/__()keys with PT fallbacks. - No install.sql and no migrations in the plugin.
Stack and tools
- PHP 8 (no framework)
- MySQL 8 (preexisting
ai_accounts) - Alpine.js + Tailwind CSS (premium light, violet/slate) + Lucide (sprite)
- MCP Server (automatic account sync)
- NEXUS plugin system (PluginManager: tabs, docs, modals, API actions, Fastr)
Operational tags
- Inteligência Artificial
- Tokens
- Credenciais
- MCP
- Autenticação
- Gestão de Contas
- Alertas
- Plugin NEXUS
Operational result
- Centralized view: all AI accounts (Google, OpenAI, Anthropic etc.) in one panel with aggregated and per-account usage.
- Usage posture: CHEIA/FINAL/ESGOTADA status with semantic bars (<70% green, 70–90% amber, >90% rose) and aggregated efficiency %.
- Automatic renewal: monthly cycle reset at maturity with styled HTML confirmation email and native browser notification (+1 day).
- MCP sync: accounts auto-detected and synced by the IDE; IDE account switching is detected (smart account switch).
- Manual state preserved: manually marked CHEIA/ESGOTADA/FINAL accounts are not overwritten by the provider API.
- Zero periodic routines: on-demand plugin (cronjob.json with empty jobs).
/ia-controlchat command (accounts summary).
GitHub progress (issues)
Real-time panel with latest repository issues.
live feed
open issues on GitHubcarregando andamento...
não foi possivel carregar as issues agora. abra no github pelo link acima.
Real results
Centralized management hub for accounts, API keys, and quotas across multiple AI providers. Enables real-time model switching, automated limit renewal tracking, and IDE agent health monitoring.
Architecture and organization
- PHP 8
- MySQL 8
- Alpine.js
- Tailwind CSS
- Lucide
- MCP Server
- Plugin NEXUS
Execution and operations
The project follows reproducible execution flow with technical validation in production-like environments.
Screenshots
Talk about this project
Apply this implementation pattern in your environment and accelerate delivery with technical consistency.