// começar · 01
O que é o OKAMI OS? What is OKAMI OS?
OKAMI OS é um painel open source para acompanhar agentes de IA em uma interface só. Ele roda local com dados mock, mostra como o estado do agente deve chegar à UI e pode receber dados reais por API, SSE ou uma bridge opcional. OKAMI OS is an open source panel for monitoring AI agents in one interface. It runs locally with mock data, shows how agent state should reach the UI, and can receive real data through API, SSE or an optional bridge.
01quick start
Rode primeiro em modo mock. Conecte depois. Run mock mode first. Connect later.
O projeto não exige runtime real para abrir a interface. Se nenhuma API estiver configurada, o hook useMissionControl usa src/data/mockMissionControl.js. Isso permite testar layout, navegação, Pixel Office, docs e gráficos antes de plugar dados reais.
The project does not require a real runtime to open the UI. If no API is configured, useMissionControl uses src/data/mockMissionControl.js. This lets you test layout, navigation, Pixel Office, docs and charts before plugging in real data.
git clone https://github.com/OkamiOps/Okami-Monitor.git okami-os
cd okami-os
npm install
cp .env.example .env.local
npm run dev:all
Vite sobe em http://localhost:5173.Vite runs at http://localhost:5173.
Express escuta em 127.0.0.1:3001.Express listens on 127.0.0.1:3001.
Sem API configurada, a UI usa dados locais.Without an API, the UI uses local data.
Depois configure API, SSE ou SSH bridge.Then configure API, SSE or SSH bridge.
02environment
Variáveis que mudam o modo de execução. Variables that change runtime behavior.
O arquivo .env.example define o contrato mínimo. Em desenvolvimento, vite.config.js encaminha /api para http://127.0.0.1:3001. Em produção, same-origin assume que existe uma função/proxy atendendo o caminho /api.
The .env.example file defines the minimum contract. In development, vite.config.js proxies /api to http://127.0.0.1:3001. In production, same-origin assumes a function/proxy is serving the /api path.
same-origin ou URL da API. Sem valor em dev, usa mock.same-origin or API URL. Empty in dev falls back to mock.3001.Express backend port. Default: 3001.8000.SSE stream collection interval. Default: 8000.03project map
Como o repositório está organizado. How the repository is organized.
src/App.jsxSPA principal: navegação, 15 views, modais, tabelas e ações.Main SPA: navigation, 15 views, modals, tables and actions.src/PixelOfficeCanvas.jsxCanvas Phaser 4 com escritório pixel-art, agentes e mini Kanban.Phaser 4 canvas with pixel-art office, agents and mini Kanban.src/lib/useMissionControl.jsSSE, fallback polling, mock-first e estado da UI.SSE, polling fallback, mock-first and UI state.src/lib/apiClient.jsCliente HTTP para state, config, SSH, Kanban, registries e arquivos.HTTP client for state, config, SSH, Kanban, registries and files.src/data/mockMissionControl.jsDataset local que deixa a UI funcional sem backend.Local dataset that keeps the UI working without a backend.server/index.jsAPI Express, SSE, rotas Hermes, registries e comandos permitidos.Express API, SSE, Hermes routes, registries and allowed commands.server/hermesCollector.jsColeta e normaliza sessões, analytics, docs, skills, jobs e Kanban.Collects and normalizes sessions, analytics, docs, skills, jobs and Kanban.server/sshBridge.jsWrapper ssh2 com key/password, timeout e exec remoto.ssh2 wrapper with key/password, timeout and remote exec.server/store.jsConfig, secrets e registries em server/.data.Config, secrets and registries in server/.data.functions/api/[[path]].jsProxy Cloudflare Pages para encaminhar /api ao backend real.Cloudflare Pages proxy that forwards /api to the real backend.04modules
As 15 telas do cockpit. The 15 cockpit screens.
A navegação é definida em navGroups dentro de src/App.jsx. Cada view recebe o mesmo estado base de useMissionControl e decide quais blocos renderizar.
Navigation is defined in navGroups inside src/App.jsx. Each view receives the same base state from useMissionControl and decides which blocks to render.
Saúde geral, métricas, modelos, atividade recente e estado do runtime.Overall health, metrics, models, recent activity and runtime state.
Tokens, estimativas de custo, forecast e concentração por modelo/provedor.Tokens, cost estimates, forecast and concentration by model/provider.
Quadro operacional com Backlog, Todo, In Progress, Blocked, Triage, Review e Done.Operational board with Backlog, Todo, In Progress, Blocked, Triage, Review and Done.
Comando de agentes, cards, inspetor, subagentes e monitor por agente.Agent command view, cards, inspector, subagents and per-agent monitor.
Escritório interativo com Phaser, sprites, reuniões, falas e mini Kanban.Interactive office with Phaser, sprites, meetings, dialogue and mini Kanban.
Documentos de identidade, memória e contexto por agente/perfil.Identity, memory and context documents per agent/profile.
Sessões recentes, status, duração, tokens, tool calls e origem.Recent sessions, status, duration, tokens, tool calls and source.
Leitura e edição assistida de crontab e timers systemd permitidos.Assisted reading and editing of allowed crontab and systemd timers.
Arquivos do runtime, campos editáveis e salvamento via bridge.Runtime files, editable fields and bridge-based saving.
Uso de skills, docs relacionados e edição de conteúdo quando permitido.Skill usage, related docs and editable content when allowed.
Linhas normalizadas, níveis, mensagens humanas e leitura rápida de falhas.Normalized lines, levels, human messages and quick failure reading.
Configuração do runtime bridge: host, user, key, password, teste SSH e comandos.Runtime bridge configuration: host, user, key, password, SSH test and commands.
Registry editável de apps e endpoints úteis do seu ambiente.Editable registry of apps and useful endpoints in your environment.
Verificação de ferramentas locais/remotas como Node, Python, GitHub CLI e Codex.Checks for local/remote tools such as Node, Python, GitHub CLI and Codex.
Base viva de runbooks, agent briefs, system design e textos editáveis.Living base for runbooks, agent briefs, system design and editable text.
05frontend
Fluxo de dados no frontend. Frontend data flow.
InicializaçãoInitialization
O app lê window.location.hash para escolher a view inicial. Se o hash não existe ou é inválido, abre overview.The app reads window.location.hash to choose the initial view. If the hash is missing or invalid, it opens overview.
SincronizaçãoSynchronization
Com API configurada, a UI abre EventSource em /api/mission-control/stream. Se fechar, cai para polling em /state.With an API configured, the UI opens EventSource at /api/mission-control/stream. If it closes, it falls back to polling /state.
FallbackFallback
Sem backend, ou com erro de API, o app mantém a interface viva com mockMissionControl e exibe a origem como mock.Without a backend, or after an API error, the app keeps the interface alive with mockMissionControl and marks the source as mock.
06state model
Contrato de estado que alimenta a UI. State contract that feeds the UI.
O shape abaixo é o centro do projeto. Você não precisa usar a mesma infraestrutura do autor: qualquer backend pode preencher esse contrato e o painel passa a mostrar seus agentes. The shape below is the center of the project. You do not need to use the author's infrastructure: any backend can fill this contract and the panel will show your agents.
{
"status": { "label": "Runtime online", "healthy": true, "updatedAt": "..." },
"metrics": [{ "label": "tokens hoje", "value": "304.3k", "delta": "+18%" }],
"tokenSeries": { "input": [1200, 1500], "output": [320, 410] },
"overview": { "serviceHealth": [], "queue": [], "incidents": [] },
"models": [{ "name": "gpt-5.4", "share": 10 }],
"activity": [{ "actor": "agent", "message": "...", "status": "OK" }],
"subscriptions": [],
"agents": [],
"liveEvents": [],
"kanban": { "Backlog": [], "Todo": [], "Done": [] },
"apiKeys": [],
"apps": [],
"docs": [],
"hermes": {},
"cliTools": []
}
id, name, role, color, status, currentTask, workspace, tool, logs, workEvents, subagents, taskscolumns keyed by status; cards include title, meta, priority, owner, estimate, boardanalytics, sessions, logLines, profileDocs, skillDocs, configFiles, jobs, routes, commandsid, title, body, updated, coverage, source, content07api
Rotas reais do backend Express. Real Express backend routes.
O backend roda em server/index.js. Em desenvolvimento, sem OKAMI_BACKEND_PROXY_TOKEN, a autenticação é liberada. Em produção ou com token configurado, o backend aceita Authorization: Bearer ou x-okami-proxy-token.
The backend runs in server/index.js. In development, without OKAMI_BACKEND_PROXY_TOKEN, auth is open. In production or with a token configured, the backend accepts Authorization: Bearer or x-okami-proxy-token.
/api/healthHealthcheck simples da API.Simple API healthcheck./api/mission-control/stateSnapshot completo para a UI.Complete snapshot for the UI./api/mission-control/streamSSE com eventos state, heartbeat e error.SSE with state, heartbeat and error events./api/mission-control/appsLista de apps do registry local.List apps from the local registry./api/mission-control/apps/:idCria ou atualiza app no registry.Creates or updates an app in the registry./api/mission-control/apps/:idRemove app do registry.Deletes an app from the registry./api/mission-control/docsLista documentos salvos localmente.Lists locally saved documents./api/mission-control/docs/:idCria ou atualiza documento.Creates or updates a document./api/mission-control/docs/:idRemove documento.Deletes a document./api/mission-control/apis/:idSalva configuração de provedor/API.Saves provider/API configuration./api/mission-control/apis/:id/testValida registro de API no painel.Validates an API registry entry./api/mission-control/apis/:id/rotateSimula/aciona rotação de secret.Simulates/triggers secret rotation./api/hermes/configLê config do runtime bridge.Reads runtime bridge config./api/hermes/configSalva config sem gravar senha crua.Saves config without storing raw password./api/hermes/ssh/keysRecebe private key e guarda em vault local.Receives a private key and stores it in the local vault./api/hermes/ssh/passwordGuarda senha SSH como secret local.Stores SSH password as a local secret./api/hermes/ssh/testTesta conexão SSH com latência.Tests SSH connection with latency./api/hermes/statusExecuta comandos seguros para status básico.Runs safe commands for basic status./api/hermes/logsLê tails de logs do runtime.Reads runtime log tails./api/hermes/kanban/tasksColeta tasks do Kanban real.Collects real Kanban tasks./api/hermes/kanban/tasksCria task no runtime quando o bridge permite.Creates a runtime task when the bridge allows it./api/hermes/commandExecuta somente comandos allowlisted.Runs allowlisted commands only./api/hermes/files/writeEscreve arquivos apenas dentro de escopos Hermes/Codex permitidos.Writes files only within allowed Hermes/Codex scopes./api/hermes/cron/saveAtualiza crontab remoto com linha validada.Updates remote crontab with a validated line./api/hermes/systemd-timer/saveAtualiza override de timer systemd.Updates a systemd timer override.08sse
Como o stream ao vivo funciona. How the live stream works.
event: state
data: {"status":{"healthy":true},"agents":[]}
event: heartbeat
data: {"t":1782130000000}
event: error
data: {"message":"SSH timeout"}
09registries
Store local, registries e secrets. Local store, registries and secrets.
O backend usa server/.data para persistir configuração local. Essa pasta deve permanecer fora do Git. Ela permite salvar preferências, apps, docs, APIs e credenciais sem colocar segredos no repositório.
The backend uses server/.data to persist local configuration. This folder must stay out of Git. It lets you save preferences, apps, docs, APIs and credentials without putting secrets in the repository.
10runtime bridge
Conecte qualquer runtime compatível ao painel. Connect any compatible runtime to the panel.
O código inclui uma bridge chamada Hermes porque esse foi o runtime original. Para a comunidade, ela deve ser lida como exemplo de conector: colete dados do seu ambiente, normalize no contrato de estado e mantenha credenciais isoladas no backend. The code includes a bridge named Hermes because that was the original runtime. For the community, treat it as a connector example: collect data from your environment, normalize it into the state contract, and keep credentials isolated in the backend.
O que o collector tenta lerWhat the collector tries to read
sessions, messages, models, sources, tool calls, token totalsboards, tasks, status, owner, priority, events, logsSOUL.md, MEMORY.md, USER.md, profile docs, identity files.usage.json, SKILL.md, usage counters, profile ownershipcrontab -l, systemctl list-timers, unit namestail from runtime log directory with redactionconfig.yaml, .env redacted, settings.jsondoctor, config, status, insights, sessions stats11pixel office
Pixel Office
O Pixel Office fica em src/PixelOfficeCanvas.jsx. Ele usa Phaser 4 em modo Canvas, carrega sprites de agentes, tiles/objetos do escritório, desenha zonas, mesas, paredes, mini Kanban e movimenta pessoas por rotas ortogonais.
Pixel Office lives in src/PixelOfficeCanvas.jsx. It uses Phaser 4 in Canvas mode, loads agent sprites, office tiles/objects, draws zones, desks, walls, mini Kanban and moves people through orthogonal routes.
12design system
Tokens visuais e convenções de UI. Visual tokens and UI conventions.
--ok-bg-0..3, --ok-fg*, --ok-orange, --ok-magenta, --ok-cyan, --ok-success.--ok-ease; evite animação que esconda informação.Short transitions with --ok-ease; avoid animation that hides information.13deploy
Build, preview e proxy de produção. Build, preview and production proxy.
npm run build
npm run preview
O repositório inclui functions/api/[[path]].js para Cloudflare Pages. A função copia headers seguros, remove hop-by-hop headers, injeta x-okami-proxy-token e encaminha chamadas para OKAMI_BACKEND_URL. Se o proxy não estiver configurado, retorna 503.
The repository includes functions/api/[[path]].js for Cloudflare Pages. The function copies safe headers, removes hop-by-hop headers, injects x-okami-proxy-token and forwards calls to OKAMI_BACKEND_URL. If the proxy is not configured, it returns 503.
14security
Cuidados de segurança ao conectar dados reais. Security notes for real data integrations.
- Não versione
server/.data,.env.local, private keys, senhas ou dumps de sessão.Do not versionserver/.data,.env.local, private keys, passwords or session dumps. - Prefira usuário SSH com permissões mínimas para leitura e comandos específicos.Prefer an SSH user with minimal permissions for reading and specific commands.
- Revise o allowlist de
/api/hermes/commandantes de liberar para outras pessoas.Review the/api/hermes/commandallowlist before exposing it to other people. - Mantenha o backend atrás de token, VPN, Cloudflare Access ou rede privada quando usar dados reais.Keep the backend behind a token, VPN, Cloudflare Access or private network when using real data.
- Redija logs e documentos antes de renderizar conteúdo em ambientes compartilhados.Redact logs and documents before rendering content in shared environments.
15troubleshooting
Problemas comuns. Common issues.
A UI só mostra dados mock.The UI only shows mock data.
Verifique VITE_OKAMI_API_BASE_URL, se o backend está rodando e se /api/mission-control/state responde.Check VITE_OKAMI_API_BASE_URL, whether the backend is running and whether /api/mission-control/state responds.
Stream fecha ou não atualiza.Stream closes or does not update.
Teste /stream, confirme proxy sem buffering e reduza temporariamente OKAMI_STREAM_INTERVAL_MS.Test /stream, confirm proxy without buffering and temporarily reduce OKAMI_STREAM_INTERVAL_MS.
SSH falha no teste.SSH test fails.
Confirme host, porta, user, private key completa, passphrase e se a chave pública correspondente está autorizada no runtime.Confirm host, port, user, full private key, passphrase and whether the matching public key is authorized in the runtime.
Pixel Office em branco.Pixel Office is blank.
Verifique assets em public/, console do navegador e se Phaser conseguiu medir o container.Check assets under public/, browser console and whether Phaser could measure the container.
Arquivo não salva.File does not save.
A rota bloqueia paths fora de .hermes ou .codex. Ajuste o path ou o escopo conscientemente.The route blocks paths outside .hermes or .codex. Adjust the path or the scope intentionally.
Build quebra.Build fails.
Rode npm install, confirme Node >= 18 e execute npm run build antes de abrir PR.Run npm install, confirm Node >= 18 and execute npm run build before opening a PR.
16contribute
Como contribuir sem quebrar o painel. How to contribute without breaking the panel.
Checklist de PRPR checklist
- Preserve o modo mock-first: a UI precisa abrir sem backend real.Preserve mock-first mode: the UI must open without a real backend.
- Não introduza segredos em arquivos versionados.Do not introduce secrets into versioned files.
- Use tokens
--ok-*e mantenha ciano, magenta, laranja e verde em equilíbrio.Use--ok-*tokens and keep cyan, magenta, orange and green balanced. - Para nova view, adicione item em
navGroups, componente emviewComponentse estado mock correspondente.For a new view, add an item innavGroups, a component inviewComponentsand corresponding mock state. - Para nova rota, documente método, path, payload, auth e fallback mock.For a new route, document method, path, payload, auth and mock fallback.
- Rode
npm run builde teste hash navigation, troca PT/EN e Pixel Office.Runnpm run buildand test hash navigation, PT/EN switching and Pixel Office.