chrnx 2f9b656692 fix(add): merge imports into existing brace + capability idempotency; fmt
- wire::add_import now merges a new symbol into an already-present
  `import { ... } from '<from>';` brace instead of appending a second,
  colliding import line for the same module (a duplicate ESM binding
  is a hard SyntaxError/TS2300, not a harmless dupe as previously
  assumed). Falls back to appending a new line when the module isn't
  imported yet, or if the brace-merge edit fails the parses_clean
  guard.
- cmd_add::run gains a capability-level idempotency guard, keyed on
  each capability's unique route-path literal, so `matcha add <cap>`
  run twice no longer appends a duplicate handler + route.
- cargo fmt --all across the crate; drop the stale #[allow(dead_code)]
  on wire::parses_clean now that it's demonstrably live.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
2026-07-11 13:52:21 -05:00

matcha

The green-tea CLI — scaffold, run, and generate green-tea apps from a single native binary. No JS runtime required to install or operate.

Install

cargo install matcha        # or: brew install matcha (once published)

Usage

matcha new my-api                          # scaffold from the official starter
matcha new my-api --template-url gh:owner/repo   # scaffold from any git template
matcha run                                 # detect node/deno/bun and run in watch
matcha create controller Users             # generate + auto-wire into @Module
matcha add sse                             # add a capability (sse|stream|buffer) to your controller

The starter

matcha new <name> (no flags) scaffolds a live app: it serves an index.html with the green-tea logo and streams a rotating zen message over @Sse('/zen'). Open the browser and it's already alive — matcha run boots it.

create / add auto-wiring

create and add edit your TypeScript with tree-sitter: they insert imports and wire pieces into the right @Module array or controller. Edits are idempotent and revert themselves if they would break the file's syntax. Pass --check to create to type-check with your project's runtime afterward.

Runtime detection

matcha run picks the runtime by precedence, first match wins:

  1. matcha.toml — runtime = "node" | "deno" | "bun"
  2. deno.json / deno.jsonc → deno
  3. bun.lockb / bun.lock → bun
  4. package.json → node

Edge is a deploy target, not a matcha run target.

License

MIT — same as the green-tea framework. Contributions require a DCO sign-off (git commit -s).

S
Description
The green-tea CLI: scaffold a project, generate controllers, steps and providers already wired into their module, and run with your runtime detected. One native binary, no JS runtime needed to install it.
Readme MIT
760 KiB
0 Stars 3 Watchers 0 Forks
2026-08-07 22:13:19 +00:00
Languages
Rust 92.5%
Shell 5.8%
TypeScript 1.4%
HTML 0.3%