Skip to content
Kear07Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Shadow

AI chat desktop app — Next.js 15 + Go 1.26, cyberpunk aesthetic, runs locally. Personal fork of PicPay's HubAI Nitro, stripped of corporate SSO and of the Google Drive backup, rebranded, with GitHub Copilot baked in for zero-config setup.


Quick Start

Windows

One click, from nothing: double-click install.cmd in the repo root. It downloads the repo if it is not there, installs Go and Node with winget, refreshes the session PATH, creates the Desktop shortcut and starts Shadow. It prints numbered steps, a progress bar and the elapsed time, so the window never sits silent.

irm https://raw.githubusercontent.com/Kear07/Shadow/main/scripts/install.ps1 | iex

Same installer without downloading the ZIP first.

The first run builds the native launcher (Go), installs web/ deps, starts both servers, and opens your browser at http://localhost:3001. After that, open Shadow from the Desktop shortcut, which points to install.cmd. start.ps1 and start.cmd still exist, but only as internals the installer calls: do not use them directly.

macOS / Linux

git clone git@github.com:Kear07/shadow.git
cd shadow
./scripts/launch.sh

Or manually:

make install   # install frontend deps
make dev       # start backend + frontend

Ports

Service Port
Frontend (Next.js) 3001
Backend (ghost-server) 4080

Authentication

The API is not open. On every start the launcher generates a random bootstrap token (32 bytes, hex) and hands it to both processes as GHOST_AUTH_TOKEN:

  1. The frontend exchanges the bootstrap at POST /auth/token (same-origin, no cache) for a rotating token: HMAC-signed, valid for a 30-second window, with the previous window still accepted so a request in flight never fails.
  2. Every other request carries it as Authorization: Bearer <token>.
  3. GET /event (the SSE stream) also accepts ?token=<token>, because a native EventSource cannot send headers. The web client streams with fetch, so it uses the header.

Only two routes stay open: POST /auth/token and GET /healthz. Everything else, /event included, needs the token.

Variable Default What it does
GHOST_AUTH_TOKEN generated by the launcher Bootstrap token shared by server and frontend
SHADOW_BOOTSTRAP_TTL 12h How long the bootstrap stays valid before the frontend must have exchanged it

make dev generates its own random token. ghost-server refuses to start without GHOST_AUTH_TOKEN; for local debugging without auth, pass --insecure-no-auth (the API is then open to any local process).


Architecture

shadow/
├── web/                        Next.js 15 · React 19 · TS · Tailwind v4
├── server/                     ghost-server (Go 1.26 · SQLite · MCP)
├── cmd/shadow-launcher/        Native Go launcher → shadow.exe / shadow
├── scripts/
│   ├── install.ps1                The installer itself (steps, progress, logo)
│   ├── launch.sh               Mac/Linux entrypoint
│   ├── launch.bat                 Alias for install.cmd (kept for old shortcuts)
│   └── install-shortcut.ps1    Creates Desktop shortcut on Windows
├── install.cmd                    Windows: the only entry point (double-click)
├── .github/workflows/ci.yml    Go tests · Web lint + test + build · launcher (3 OS)
├── start.ps1                      Windows internal (builds + runs the launcher)
└── start.cmd                      Windows internal (wrapper around start.ps1)

Frontend — Chat interface with streaming markdown (Streamdown), plugin sidebar, customizable agents, 10 color themes (dark/light variants).

Backend — ghost-server in Go. Sessions, AI providers, MCP plugins, tools (filesystem, terminal, grep, web fetch), persistent memory, skills, workflows.

Launcher — Native Go binary that starts both servers, manages ports, installs the web/ npm deps when node_modules is missing, opens the browser, and cleans up on exit.

Built locally on first run — never committed to the repo.


Features

  • Two providers — Ollama (local, no key) and OpenRouter (free tier only); Arena compares models side by side
  • Agents — Custom personas with their own skills, tone, and behavior sliders
  • Skills — Modular knowledge packs (lazy-loaded into the prompt)
  • Plans — Persistent plan documents for complex tasks
  • Workflows — Multi-agent pipelines (planner → developer → tester → reviewer)
  • Heartbeat — Proactive agent wake-ups on a schedule
  • MCP Plugins — Extend with custom tools via Model Context Protocol
  • 10 color themes — Each with dark and light variants
  • Requirements tab — Auto-detects and installs missing system deps
  • Ollama lifecycle — Start/stop Ollama from the UI, auto-kill on exit

AI Providers

Provider (id) Setup Default model
Ollama (ollama) Local server at localhost:11434, no key. Only lists models when Ollama is running and has at least one model pulled First model installed locally
OpenRouter (free) (openrouter_free) Key saved in Settings (auth.json), no env var; only :free models are accepted First free model OpenRouter lists

POST /arena/run is not a provider: it runs the same prompt through several models and returns the results side by side.


Requirements

Dependency Min version Purpose
Go 1.26+ Backend + launcher
Node.js 18.18+ Frontend (o CI usa 22)
Git any Version control

On Windows, install.cmd installs Go and Node with winget when they are missing and refreshes the session PATH; scripts/launch.bat is a thin alias for it. On macOS and Linux, scripts/launch.sh tries brew install for whatever is missing and exits if Homebrew is not there. The launcher itself only installs the web/ npm deps.


Commands

make dev       # Start frontend + backend
make install   # Install frontend deps
make stop      # Kill all processes
make test      # Run Go tests
make lint      # TypeScript + Go vet
make clean     # Clean build artifacts
make launcher  # Build the native launcher (shadow.exe / shadow)

Color Themes

10 schemes, each with dark and light variants:

Theme Vibe
Shadow Vermelho sangue e negro profundo (padrão)
Midnight Azul noturno, calmo e profundo
Obsidian Negro vulcânico, elegância mínima
Slate Cinza azulado, pedra polida
Amethyst Ametista suave, violeta contemplativo
Sand Arenito, neutralidade acolhedora
Mist Névoa lilás, serenidade difusa
Neon Elétrico e vibrante, setup gamer
Matrix Verde terminal, estética hacker
Zen Suave e neutro, zero fadiga visual

Filesystem access

The file API (web/src/app/api/files/) is sandboxed. SHADOW_FS_ROOTS lists the extra roots it may read, separated by the OS path delimiter (: on macOS/Linux, ; on Windows). The default root is ~/Shadow. Dangerous roots — the whole home directory, the disk root, system folders — are discarded even when listed. The rules live in web/src/app/api/files/_lib/fs-safety.ts, with tests in fs-roots.test.ts and fs-safety.test.ts.


Stack

  • Frontend: Next.js 15 · React 19 · TypeScript · Tailwind CSS v4 · Streamdown · Vitest
  • Backend: Go 1.26 · net/http · SQLite · MCP (Model Context Protocol)
  • Launcher: Go (cross-platform, zero runtime deps)

Troubleshooting

Terminal looks broken after a while (boxes/borders garbled)

You're using cmd.exe, which has poor Unicode/ANSI support. Run via install.cmd — it prefers Windows Terminal automatically. If you don't have it, install from the Microsoft Store (free).

shadow.exe is locked / can't rebuild

Shadow is still running. Close it first (Ctrl+C in the launcher window or make stop), then rebuild with make launcher.

Ports 3001 or 4080 already in use

The launcher kills stale processes on those ports automatically. If something else is using them, change serverPort / webPort in cmd/shadow-launcher/main.go and rebuild.

go: command not found / node: command not found

install.cmd installs Go and Node with winget; when it cannot, it points to the download page. On macOS/Linux, scripts/launch.sh tries Homebrew first. Install manually:

auth: refusing to start with an unauthenticated API

ghost-server was started without GHOST_AUTH_TOKEN. Use the launcher, or pass --insecure-no-auth for local development.


License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages