Skip to content

Latest commit

 

History

History
104 lines (85 loc) · 3.91 KB

File metadata and controls

104 lines (85 loc) · 3.91 KB

shell

Claude Code CLI orchestration layer. Telegram bridge, scheduling, planning, memory, and browser automation.

Part of the Ghost in the Shell ecosystem.

Setup

  1. Create a Telegram bot via @BotFather
  2. Initialize config:
    shell init
  3. Set your bot token:
    export TELEGRAM_BOT_TOKEN="your-token-here"
  4. Edit ~/.shell/config.json — add your Telegram user ID to allowed_users:
    {
      "telegram": {
        "token_env": "TELEGRAM_BOT_TOKEN",
        "allowed_users": [123456789]
      }
    }
    (Find your user ID by messaging @userinfobot)
  5. Start the daemon:
    shell daemon

Features

  • Telegram bridge — Each chat gets its own persistent Claude Code session
  • Memory — Semantic memory via ghost with per-chat profiles and context injection
  • Scheduling — Cron and one-shot schedules with quiet hours and heartbeat check-ins
  • Planning — Execute-test-review loop with git worktree isolation
  • Browser — Headless Chrome automation via shell-browser
  • Image generation — AI image creation via shell-imagen
  • Web search — Built-in Brave/Tavily/DuckDuckGo search
  • Tunnels — Expose local ports via shell-tunnel
  • Secrets — Encrypted secret store via shell-secrets
  • Streaming — Live message edits as Claude responds
  • Albums — Multi-photo support with 500ms debounce
  • Reactions — Emoji-triggered actions (go, stop, cancel, status, retry)

Commands

CLI

  • shell init — Create config directory and default config
  • shell daemon [--watch] — Start the Telegram bot daemon
  • shell send "message" — One-shot test without Telegram
  • shell status — Show active sessions
  • shell session list|kill <chat-id> — Session management
  • shell restart — Send SIGHUP to running daemon
  • shell stop — Send SIGTERM to running daemon
  • shell search "query" — Web search from CLI

Telegram Bot

  • /start — Initialize and show welcome message
  • /new — Reset session, start fresh conversation
  • /status — Show current session info
  • /help — Show available commands
  • /plan — Start a plan execution
  • /schedule add|list|delete|enable|pause — Manage schedules
  • /heartbeat <interval> <message> — Set up periodic check-ins
  • /imagine <prompt> — Generate an image

Build

make build    # Build binary
make test     # Run tests
make vet      # Run go vet
make watch    # Build and run with --watch for live reload

How It Works

Each Telegram chat gets its own Claude Code session. Messages are forwarded to:

claude -p "message" --resume <session-id> --output-format stream-json

Claude's responses are parsed for artifact markers and [noop] directives. Bridge operations (pm, tunnel, schedule, relay, browser) use MCP tools or skill scripts invoked via Bash.

Sessions persist across restarts via SQLite. Memory context is injected via --append-system-prompt.

Ecosystem

Repo Role
ghost Persistent agent memory (the "ghost" — consciousness/personality)
shell Main orchestration app (the "shell" — vessel/runtime)
shell-browser Headless Chrome automation
shell-imagen Image generation via Gemini
shell-search Web search CLI
shell-secrets Encrypted secret store
shell-tunnel HTTP tunnels via cloudflared

License

MIT