Go to file
Hongming Wang 3a6a7eb495 feat(connect): M1.1 — Backend interface + connect skeleton + mock backend
First step toward `molecule connect <id>` — the out-of-box external-
runtime workspace connector specified in RFC #10.

What's in this PR (foundational, ~300 LOC of code + matching tests):

- `internal/backends.Backend` — the seam every concrete handler
  implements: HandleA2A(ctx, Request) → Response, Close(). Two methods,
  no inheritance, no surprise side effects. Concurrency-safe by
  contract (poll dispatch may parallelise).
- Request/Response/Part/Config types — lossless JSON-RPC mirror so
  backends can re-issue downstream without re-parsing.
- Compile-time registry — `Register("name", factory)` from each
  backend's init(); `Build(name, cfg)` selects at runtime. Panics
  on duplicate registration so drift fails loudly at startup, not
  on first message.
- `mock` backend — single-template echo for CI smoke + tests + demos.
  `--backend-opt reply="<template>"` with `%s` for inbound text.
- `molecule connect <workspace-id>` cobra command — flag surface,
  validation, --dry-run for smoke. Loops (heartbeat, activity poll,
  dispatch) land in M1.2 in internal/connect/.

Coverage:
- Registry: duplicate-name panic, empty-name panic, nil-factory panic,
  Build unknown-name error includes registered list.
- Mock: default template, custom template, text-part concatenation,
  Final=true on terminal response.
- Connect: --backend-opt KEY=VALUE parser (incl. value with =),
  flag validation (missing token, bad mode, bad opt, unknown
  backend), --dry-run happy path.

All tests pass under -race.

Out of scope (subsequent M1 PRs):
- M1.2: heartbeat + activity poll loops in internal/connect/
- M1.3: claude-code backend (wraps molecule-mcp-claude-channel)
- M1.4: GoReleaser tag-triggered release.yml workflow

RFC: https://github.com/Molecule-AI/molecule-cli/issues/10

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 02:05:12 -07:00
.claude docs: add CLAUDE.md, known-issues.md, and .claude/settings.json (#2) 2026-04-20 23:10:40 +00:00
.github/workflows fix(ci): sync auto-promote workflow (ff-only, no-gates mode) 2026-04-24 08:35:20 -07:00
bin fix(cli): align rootCmd.Use to goreleaser binary name 2026-04-22 05:36:07 +00:00
cmd/molecule feat(cli): add --force flag to molecule init 2026-04-23 21:17:36 +00:00
internal feat(connect): M1.1 — Backend interface + connect skeleton + mock backend 2026-04-30 02:05:12 -07:00
.gitignore chore: gitignore credentials for molecule-cli 2026-04-16 09:18:55 -07:00
.goreleaser.yaml chore(cli): add .goreleaser.yaml and resolve KI-004 2026-04-21 10:33:08 +00:00
CLAUDE.md feat: implement full CLI command tree 2026-04-23 18:44:24 +00:00
go.mod feat(connect): M1.1 — Backend interface + connect skeleton + mock backend 2026-04-30 02:05:12 -07:00
go.sum feat: implement full CLI command tree 2026-04-21 01:18:24 +00:00
known-issues.md feat: implement full CLI command tree 2026-04-23 18:44:24 +00:00
pr-description-draft-cli-full.md fix(cli): align rootCmd.Use to goreleaser binary name 2026-04-22 05:36:07 +00:00
README.md feat: initial CLI (extracted from molecule-monorepo/platform/cmd/cli) 2026-04-16 03:15:58 -07:00

molecule-cli (molecli)

Go TUI dashboard for Molecule AI — real-time workspace monitoring, event log, health overview, delete/filter operations.

Install

go install github.com/Molecule-AI/molecule-cli/cmd/molecli@latest

Or download a binary from Releases.

Usage

export MOLECLI_URL=http://localhost:8080  # or your platform URL
molecli

Features

  • Real-time workspace status (online/offline/degraded/paused)
  • Event log with filtering
  • Workspace CRUD operations
  • Agent session management
  • Memory/skill inspection
  • A2A chat interface

License

Business Source License 1.1 — © Molecule AI.