repochan
v0.3.0
Published
RepoChan CLI — a deterministic, agent-driven creative pipeline. Manages .repochan/ protocol entities; no embedded runtime.
Readme
repochan
CLI for RepoChan — turn a git repo into brand assets (persona, art, stickers, landing page) with a deterministic protocol under .repochan/ and bring-your-own agent skills.
No embedded model runtime. The agent (Claude Code, Codex, Pi, …) orchestrates; repochan is the only binding surface.
Install
npm install -g repochan
# requires Node.js >= 20Quick start
cd your-git-repo
# Install skills into your agent + optional image endpoint
repochan setup
# Image generation (OpenAI-compatible base URL + key; mode defaults to auto)
repochan image configure
repochan image status
# Protocol (examples)
repochan analysis run
repochan persona get --json
repochan order list --json
repochan image gen --prompt "a chibi mascot" --out /tmp/t.png
# Landing-page starters
repochan starter list
repochan starter get minimal --json
repochan starter pull # scaffold default → .repochan/web-starter/
repochan starter configure # analysis/persona → repochan/site.json
repochan starter create-order hero-composite --intent "..." --foundation ord-found-001
repochan starter asset-apply hero-composite --order ord-hero-001 --overwrite
repochan starter validate --output-dir .repochan/web-starterrepochan order create-result requires at least one readable, non-empty regular
file in the payload's files array. Missing paths and metadata-only results are
rejected before a version directory is written or the order is marked delivered.
Candidate promotion also re-checks its recorded files before changing the current
version. Result replacement stages a complete version directory, removes stale
omitted files, and restores the previous version and order if publication fails.
Mutations for the same order must be serialized by the caller. If an active
transaction or retained recovery directory is present, Core rejects another
result write or candidate promotion with the directory path; retry after the
first mutation completes, or recover the retained directory before continuing.
Publication uses an order-byte compare-and-swap guard, so a revision/status/current
mutation that completes during staging is preserved and the older transaction
fails with a conflict. A retained transaction contains recovery.json; manage it
only through repochan order recovery list|recover|abort. recover restores the
manifest's original state. abort accepts the current state only after Core
validates it. Never hand-edit or delete recovery directories.
An active publisher holds the order lock, so recovery commands fail with a
retryable conflict. After a crash, Core reclaims a stale same-host lock:
prepared and recovery_required transactions can be recovered, while a
staging_unprepared directory has no recoverable manifest and is therefore
abort-only.
Core anchors every real transaction outside its staging directory with an identity
and nonce, then validates fixed backup mappings plus order/version semantics before
and after recovery. It rejects simple forged transaction directories; it is not a
security boundary against an actor able to rewrite the whole workspace and its
anchors. Protocol state is changed only through schema-validated entity
commands. Published result directories, including meta.json, remain byte-for-byte
immutable after creation. Local pixel derivations belong in a pulled Starter's
public/ through starter asset-apply, not in an order result version.
repochan order recovery list <order-id>
repochan order recovery recover <order-id> <transaction-id>
repochan order recovery abort <order-id> <transaction-id>Image endpoints
Config: ~/.repochan/image.json (credentials stay in image-gen; not in project protocol).
| Mode | Meaning |
|------|---------|
| auto (default) | Classic OpenAI Images API; polls if the relay returns a job id. Host rules (e.g. *.65535.space) may use async headers. |
| openai | Force classic (no X-Async-Mode). |
| openai-async | Force async submit + poll. |
repochan image configure # interactive
repochan image probe
repochan image gen --prompt "…" [--reference path] [--reference path2] [--aspect landscape|square|portrait] [--quality low|medium|high|auto]
# Multiple --reference flags: each gets its own flag (--reference A --reference B)Packages (also published)
@repochan/core— protocol / schema / rules@repochan/image-gen— prompt → PNG@repochan/image-edit— slice / bg-remove / chroma-key / compress / resize / favicon@repochan/skill— agent skill markdown@repochan/templates— asset YAML templates@repochan/starters— landing-page scaffolds (Astro/Tailwind project directories)
Docs
Monorepo: github.com/l1veIn/repochan-mono
License
MIT
