bobby the bot
  • JavaScript 98.7%
  • Shell 1.3%
Find a file
2026-06-02 07:10:27 +00:00
scripts Add conversational mode project starter and service management 2026-06-02 07:10:27 +00:00
.env.example Initial BobbyRoborto Discord bot 2026-05-29 23:51:39 +00:00
.gitignore Initial BobbyRoborto Discord bot 2026-05-29 23:51:39 +00:00
index.js Add conversational mode project starter and service management 2026-06-02 07:10:27 +00:00
networkRegistry.js Add network registry and AI Brain uptime check 2026-06-02 05:38:52 +00:00
package-lock.json Initial BobbyRoborto Discord bot 2026-05-29 23:51:39 +00:00
package.json Initial BobbyRoborto Discord bot 2026-05-29 23:51:39 +00:00
projectStarter.js Add conversational mode project starter and service management 2026-06-02 07:10:27 +00:00
README.md Add conversational mode project starter and service management 2026-06-02 07:10:27 +00:00
serviceRegistry.js Add conversational mode project starter and service management 2026-06-02 07:10:27 +00:00

BobbyRoborto

BobbyRoborto is a private Discord bot for Brock's personal homelab/network. It checks known services, answers basic infrastructure questions, takes local notes, and can provide short AI-assisted answers.

Install

Install dependencies:

npm install

Create your local environment file:

cp .env.example .env

Open .env and replace the placeholder values with your real secrets and settings:

DISCORD_TOKEN=your_real_discord_bot_token
BOT_PREFIX=!
AI_PROVIDER=deepseek
AI_BASE_URL=https://api.deepseek.com
AI_API_KEY=your_real_ai_api_key
AI_MODEL=deepseek-chat

DeepSeek, MiMo, or other OpenAI-compatible API keys go in .env, never in Discord messages.

The bot needs the Discord Message Content Intent enabled in the Discord Developer Portal because this version uses normal text commands. BobbyRoborto also responds to direct messages with the same command prefix.

Start

Start BobbyRoborto:

npm start

Direct Messages

BobbyRoborto can respond in server channels and in Discord DMs. Use the same commands in either place, such as !ping, !note remember this, or !ask what does DNS do?.

Commands

  • !ping replies with BobbyRoborto is awake.
  • !status replies with BobbyRoborto is online. Network checks coming next.
  • !network lists known systems and roles from networkRegistry.js
  • !where <name> shows a known system's IP, role, and services
  • !check <name> checks listed HTTP services for one known system
  • !checkall checks all registered HTTP services
  • !uptime <server> runs an allowlisted read-only uptime check
  • !disk <server> runs an allowlisted read-only df -h / check
  • !memory <server> runs an allowlisted read-only free -h check
  • !load <server> runs an allowlisted read-only uptime/load check
  • !health <server> shows a short VM uptime, disk, and memory summary. For BobbyRoborto, it also shows bot service uptime.
  • !restart bobby starts a 60-second confirmation flow to restart BobbyRoborto only
  • !confirm restart bobby <code> confirms the pending BobbyRoborto restart
  • !services lists allowlisted services Bobby can check
  • !service <server> <service> shows status for one allowlisted service
  • !logs <server> <service> shows recent logs for one allowlisted service
  • !start-service <server> <service> starts an allowlisted service with confirmation
  • !restart-service <server> <service> restarts an allowlisted service with confirmation
  • !confirm start-service <server> <service> <code> confirms a pending service start
  • !confirm restart-service <server> <service> <code> confirms a pending service restart
  • !project idea <idea> drafts an AI Brain starter project plan and asks for confirmation
  • !projects lists Bobby-created projects on AI Brain
  • !project info <slug> shows one Bobby-created project
  • !project note <slug> <note> appends a timestamped note to NOTES.md
  • !project abandon <slug> starts a deletion confirmation for one Bobby-created project
  • !confirm project <slug> <code> creates a confirmed starter project
  • !confirm abandon <slug> <code> deletes a confirmed Bobby-created project
  • !note <text> saves a note to bobby.sqlite
  • !notes shows the 5 most recent notes, newest first
  • !ask <question> asks the configured AI provider for a short answer
  • !help shows the available commands

Examples:

!where ai brain
!where mock trader
!where bobby
!check ai brain
!checkall
!uptime ai brain
!disk bobby
!memory ai brain
!load bobbyroborto
!health ai brain
!services
!service ai brain mock trader
!logs ai brain mock trader
!start-service ai brain mock trader
!confirm start-service ai-brain caf-mock-trader 1234
!restart-service ai brain mock trader
!confirm restart-service ai-brain caf-mock-trader 1234
!project idea I want a Farm Sim helper that tracks crops and reminds me when fields need harvesting
!projects
!project info farm-sim-helper
!project note farm-sim-helper Reviewed the starter plan
!project abandon farm-sim-helper
!confirm project farm-sim-helper 1234
!confirm abandon farm-sim-helper 1234
!restart bobby
!confirm restart bobby 1234

Allowlisted Service Management

BobbyRoborto can check a small allowlisted set of services and can start/restart only the services explicitly wired for that action.

Allowlisted services:

  • AI Brain / CAF Mock Trader
  • BobbyRoborto / BobbyRoborto

Examples:

!services
!service ai brain mock trader
!logs ai brain mock trader
!service bobby bobby
!logs bobby bobby
!start-service ai brain mock trader
!confirm start-service ai-brain caf-mock-trader 1234
!restart-service ai brain mock trader
!confirm restart-service ai-brain caf-mock-trader 1234

Service management safety limits:

  • Bobby never accepts arbitrary service names or arbitrary hosts.
  • Bobby never runs arbitrary shell commands from Discord.
  • Status and log checks use fixed command arguments from serviceRegistry.js.
  • AI Brain service start/restart is currently limited to the caf-mock-trader user service.
  • AI Brain service start/restart uses systemctl --user and does not use sudo.
  • Start/restart requires a random 4-digit confirmation code that expires after 60 seconds.
  • BobbyRoborto service restart remains separate as !restart bobby with its own confirmation flow.
  • Logs are trimmed for Discord and lines that look like secrets are redacted.

Proxmox VM/LXC start support is future work. It must be implemented separately with an allowlisted Proxmox registry, exact VMIDs/CTIDs, exact commands, and confirmation. This version does not add Proxmox control.

Conversational Mode

BobbyRoborto can also be used like a short, practical AI assistant.

In DMs, normal messages go to Bobby's conversational AI layer. In server channels, address Bobby by name or mention him, such as:

Bobby, what can you do right now?
Bobby, are you awake?
Bobby, I'm thinking about a Farm Sim helper.
Bobby, remind me what project starter rules we set.
Bobby, should this be a project or just a note?

Conversational replies use the configured DeepSeek/OpenAI-compatible API. Bobby should keep replies short, practical, and friendly. He may explain current abilities, including known-system checks, health/disk/memory/load checks, allowlisted service status/log/start/restart actions, notes, AI answers, confirmed project seeds on AI Brain, Bobby-created project lists, and project notes.

Commands remain available for direct control. Natural conversation does not run arbitrary shell commands, create project files, delete projects, or restart services. If a message sounds like a possible project idea, Bobby asks whether to start a project seed or keep talking/planning before DeepSeek drafts the project plan.

Project Starter

BobbyRoborto can turn a messy Discord idea into a starter planning folder on AI Brain. DeepSeek is used as the project-intake and planning brain: it may interpret the idea, choose a sensible title and safe slug, summarize the concept, suggest a starter structure, write specific planning content, and prepare a Codex/OpenClaw handoff prompt. AI Brain is the only project-starter hub, and projects are limited to:

/home/brock/projects/<project-slug>

The preferred project flow is conversational and consent-gated:

  1. Brock sends a normal message such as Bobby, I have an idea for a Farm Sim crop helper.
  2. Bobby treats that as conversation/planning first and asks whether Brock wants to start a project seed on AI Brain or keep brainstorming.
  3. Only after a clear affirmative such as start it, make the project, create the project seed, or put it on AI Brain, Bobby uses the configured AI provider to draft the starter plan.
  4. Bobby replies conversationally with the proposed title, slug, path, initial feature ideas, files, and a 4-digit confirmation code.
  5. Bobby creates files on AI Brain only after !confirm project <slug> <code> is sent before the 10-minute expiry.

The command form !project idea <idea> remains available as a deliberate fallback that starts the draft-and-confirm flow directly.

Created starter projects include:

  • README.md
  • PROJECT_BRIEF.md
  • TODO.md
  • NOTES.md
  • DECISIONS.md
  • prompts/codex-start.md
  • .bobby-created.json

Project deletion is also confirmation-gated. !project abandon <slug> only starts the flow. !confirm abandon <slug> <code> deletes only /home/brock/projects/<slug> and only when .bobby-created.json exists.

AI Brain Helper Install

Bobby does not create project folders by running arbitrary SSH commands. It calls a fixed helper script on AI Brain:

/home/brock/.local/share/bobbyroborto/ai-brain-project-helper.js

Install or update that helper from the BobbyRoborto VM with:

./scripts/install-ai-brain-project-helper.sh

If the helper is not installed, Bobby will reply:

AI Brain project helper is not installed yet.

Project Starter Safety

Project starter safety limits:

  • Projects may only be created inside /home/brock/projects/ on AI Brain.
  • Slugs must be lowercase letters, numbers, and hyphens only, with no dots, slashes, spaces, or path traversal.
  • Bobby never writes outside the new Bobby-created project folder.
  • Bobby only lists, reads, notes, or abandons folders that contain .bobby-created.json.
  • Bobby never deletes arbitrary user-provided paths.
  • Casual brainstorming is not consent to create a project seed.
  • Natural-language project ideas trigger a clarification question before DeepSeek drafts the project seed.
  • Natural-language project requests may trigger project planning only after Brock clearly says to start, but not filesystem writes until the final code confirmation.
  • DeepSeek may generate structured project content, but cannot directly control filesystem paths or run commands.
  • Bobby and the AI Brain helper sanitize and validate the slug before any create/delete action.
  • Bobby never runs Discord input or AI output as a shell command.
  • Bobby does not add sudo permissions, restart services, reboot servers, update packages, or modify system files for this feature.

Safe test messages and commands:

Bobby, I've got an idea for a Farm Sim crop tracker
yes, let's get started
Bobby, capture this idea as a project
just planning for now
!project idea I want a Farm Sim helper that tracks crops and reminds me when fields need harvesting
!projects
!project info farm-sim-helper
!project note farm-sim-helper Reviewed this from Discord
!project abandon farm-sim-helper

Do not run !confirm project ... or !confirm abandon ... until you intend to create or delete the project.

Network Registry

Known systems and services live in networkRegistry.js. Network checks are read-only and only use the registered services in that file.

Current systems:

  • Main Server: Primary Proxmox / core infrastructure
  • Reserve Node: Secondary Proxmox / watcher node
  • AI Brain: AI tools / local model services
  • BobbyRoborto: Discord network assistant
  • AMP: CubeCoders AMP game server panel
  • Forgejo: Private Git hosting for Brock and collaborators
  • Reverse Proxy: Nginx Proxy Manager / public web routing

!check and !checkall check HTTP URLs only. Local or manual entries such as BobbyRoborto VM: local are skipped. Server-info commands are allowlisted for AI Brain and BobbyRoborto only. AI Brain checks use SSH with an explicit private key and fixed read-only commands. BobbyRoborto checks use fixed local read-only commands. !health bobby separates VM uptime from BobbyRoborto systemd service uptime.

AI Provider

!ask uses an OpenAI-compatible chat completions API at:

AI_BASE_URL/chat/completions

For DeepSeek, the defaults in .env.example are:

AI_PROVIDER=deepseek
AI_BASE_URL=https://api.deepseek.com
AI_MODEL=deepseek-chat

For MiMo or another compatible provider, change AI_PROVIDER, AI_BASE_URL, and AI_MODEL to match that provider. Keep AI_API_KEY private in .env.

Do not send API keys, .env contents, or secrets to the AI command.

Data

Notes are stored locally in bobby.sqlite. The notes table is created automatically on startup if it does not exist.

This version intentionally does not include arbitrary shell execution, arbitrary restart targets, remote machine restart commands, reboot/update/delete commands, destructive commands, Docker/Proxmox control, or random IP range scanning. SSH checks are fixed read-only commands for AI Brain only. Local server-info checks are fixed read-only commands for BobbyRoborto only. Service management is limited to allowlisted services and fixed action commands from serviceRegistry.js. Project starter writes are delegated to the fixed AI Brain helper, which enforces /home/brock/projects boundaries and marker-file checks. The only sudo command is the confirmation-gated local sudo systemctl restart bobbyroborto; it requires sudoers setup before it will work. Network checks are limited to known hosts and services from the local registry.