alice

package module
v0.6.95 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 5, 2026 License: MIT Imports: 2 Imported by: 0

README

Alice

Dev CI Main Release Release On Tag

A Feishu long-connection connector for CLI-based LLM agents such as Codex, Claude, Gemini, Kimi, and OpenCode.

Alice runs as a local multi-bot runtime:

  • receives Feishu messages over WebSocket
  • routes messages into chat or work scenes
  • calls the configured LLM CLI backend
  • sends progress, replies, files, and images back to Feishu
  • exposes a local runtime API used by bundled skills
  • provides an alice delegate subcommand so OpenCode agents (including DeepSeek) can delegate subtasks to Codex, Claude, and other backends

For Chinese documentation, see README.zh-CN.md.

Features

  • Multi-bot runtime from a single config.yaml
  • Per-bot isolated workspace, SOUL.md (in alice_home), and prompts, with shared CODEX_HOME by default
  • Scene-aware routing for casual chat and explicit work threads
  • Runtime HTTP API for bundled skills and automation
  • Long-running LLM status cards with backend-activity and aggregated file-change signals
  • Automation watchdog alerts for overdue or stuck scheduled tasks
  • Bundled skills are materialized under ${ALICE_HOME:-~/.alice}/skills, linked into ~/.agents/skills, and exposed to Claude via ~/.claude/skills
  • Embedded prompts, skills, config example, SOUL.md example, and OpenCode delegate plugin
  • alice setup one-command init: config + skills + systemd unit + OpenCode plugin

Requirements

  • Go 1.25+ for source builds
  • One installed and authenticated backend CLI:
    • codex
    • claude
    • gemini
    • kimi
    • opencode
  • A Feishu app with:
    • bot capability
    • im.message.receive_v1 subscription
    • required message permissions
    • long connection mode enabled

Quick Start

Install From Release

Via npm (recommended):

npm install -g @alice_space/alice
alice setup

Via installer script:

curl -fsSL https://cdn.jsdelivr.net/gh/Alice-space/alice@main/scripts/alice-installer.sh | bash -s -- install

Then:

  1. Edit ${ALICE_HOME:-~/.alice}/config.yaml
  2. Set bots.*.feishu_app_id and bots.*.feishu_app_secret
  3. Start the service:
systemctl --user start alice.service   # Linux (alice setup writes the unit)
alice --feishu-websocket               # macOS / manual start
Run From Source
cp config.example.yaml ~/.alice/config.yaml
# edit ~/.alice/config.yaml

go mod tidy
go test ./...
go run ./cmd/connector --feishu-websocket

Configuration

Alice uses a pure multi-bot config model.

Important concepts:

  • bots.<id>: one runtime bot
  • llm_profiles: named model presets
  • group_scenes.chat: conversational scene for group chats
  • group_scenes.work: explicit task scene for work threads
  • trigger_mode: legacy fallback when both scenes are disabled
  • workspace_dir / prompt_dir: per-bot runtime directories
  • codex_home: optional per-bot override for the shared CODEX_HOME (default: ~/.codex) Start from config.example.yaml.

Usage

Alice's operating model and chat / work scene behavior are documented in:

Delegating tasks to other LLM backends

The alice delegate subcommand runs a one-shot prompt against any configured LLM CLI:

alice delegate --provider codex --prompt "Refactor the auth module"
alice delegate --provider claude --prompt "Review this PR diff" < diff.patch
OpenCode plugin

alice setup writes the file ~/.config/opencode/plugins/alice-delegate.js. Once present, OpenCode agents (including DeepSeek) gain two tools — codex and claude — that delegate subtasks through the alice delegate command. No additional config is needed; OpenCode loads plugins from that directory automatically.

Additional docs:

Connector startup mode is now explicit: use --feishu-websocket for the real Feishu connector, or --runtime-only for local runtime/API-only execution. For isolated debug or temporary rerun runtimes, use alice-headless --runtime-only; headless binaries no longer allow Feishu websocket startup.

The LLM backend abstraction lives in internal/llm/ (the former agentbridge library is now co-located in this repository).

SOUL.md

Each bot can define persona and machine-readable metadata in its configured soul_path. The default is <alice_home>/SOUL.md; a relative soul_path is resolved relative to <alice_home>.

Current frontmatter keys accepted by Alice:

  • image_refs
  • output_contract

The embedded example is prompts/SOUL.md.example.

Installer

The installer script lives at scripts/alice-installer.sh.

Common commands:

# install or update the latest stable release
curl -fsSL https://cdn.jsdelivr.net/gh/Alice-space/alice@main/scripts/alice-installer.sh | bash -s -- install

# uninstall
curl -fsSL https://cdn.jsdelivr.net/gh/Alice-space/alice@main/scripts/alice-installer.sh | bash -s -- uninstall

When installing via npm, use alice setup after npm install -g @alice_space/alice to create the ALICE_HOME directory structure, write the initial config, sync bundled skills, register the systemd user unit (Linux), and install the OpenCode delegate plugin. The installer script is still available for users who prefer a single-curl workflow or need the release download / checksum verification path.

Development

make check
make build
make run

make check includes formatting, vet, unit tests, and connector race tests.

Contribution guidelines are in CONTRIBUTING.md.

Release Process

  • Day-to-day work happens on dev
  • dev -> main drives the normal release path
  • Tagged releases are published through GitHub Actions

Workflow files:

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigExampleYAML = mustReadFile(embeddedFiles, "config.example.yaml")
View Source
var OpenCodePluginJS = mustReadFile(embeddedFiles, "opencode-plugin/delegate.js")
View Source
var PromptFS = mustSub(embeddedFiles, "prompts")
View Source
var SkillsFS = mustSub(embeddedFiles, "skills")
View Source
var SoulExampleMarkdown = mustReadFile(embeddedFiles, "prompts/SOUL.md.example")
View Source
var SystemdUnitTmpl = mustReadFile(embeddedFiles, "opencode-plugin/alice.service.tmpl")

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
connector command
internal
llm
Package llm provides a unified interface for running LLM agent CLIs (claude, codex, gemini, kimi, etc.) as subprocess backends.
Package llm provides a unified interface for running LLM agent CLIs (claude, codex, gemini, kimi, etc.) as subprocess backends.
llm/providers/claude
Package claude drives the claude CLI as a subprocess and parses its stream-json output into a plain text reply.
Package claude drives the claude CLI as a subprocess and parses its stream-json output into a plain text reply.
llm/providers/codex
Package codex drives the codex CLI as a subprocess and parses its JSON-lines output into a plain text reply with optional file-change events.
Package codex drives the codex CLI as a subprocess and parses its JSON-lines output into a plain text reply with optional file-change events.
llm/providers/gemini
Package gemini drives the gemini CLI as a subprocess and parses its JSON output into a plain text reply.
Package gemini drives the gemini CLI as a subprocess and parses its JSON output into a plain text reply.
llm/providers/kimi
Package kimi drives the kimi CLI as a subprocess and parses its stream-json output into a plain text reply.
Package kimi drives the kimi CLI as a subprocess and parses its stream-json output into a plain text reply.
llm/providers/opencode
Package opencode drives the opencode CLI as a subprocess and parses its JSON-lines output into a plain text reply, session ID, and token usage.
Package opencode drives the opencode CLI as a subprocess and parses its JSON-lines output into a plain text reply, session ID, and token usage.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL