Skip to content

feat(cli)!: rewrite the CLI with AcidCat and add an MCP server - #99

Open
Hebilicious wants to merge 3 commits into
build/latest-moon-protofrom
feat/acidcat-cli
Open

Hebilicious wants to merge 3 commits into
build/latest-moon-protofrom
feat/acidcat-cli

Conversation

@Hebilicious

@Hebilicious Hebilicious commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Rewrites the cssforge CLI on AcidCat. One declaration serves the command line, an MCP server, and typed calls from code.

What changes

  • packages/cssforge/src/capabilities.ts declares the capabilities tokens.build, tokens.generate (read only) and config.check (read only), and the event tokens.built (watch). Targets: cli, mcp, and library (the TypeScript binding).
  • packages/cssforge/src/forge.ts holds the operations: load, check, generate, build and watch. They return reports and throw a typed ForgeError (ConfigLoadFailed, InvalidConfig, WriteFailed). They never log.
  • packages/cssforge/src/schema.ts makes Standard Schemas from JSON Schema documents, with a small validator for the subset the catalog uses. One document gives both the catalog and the runtime check.
  • packages/cssforge/src/cli.ts is only the entry point and the mcp command: cssforge tokens build | tokens generate | config check | watch tokens.built | list | mcp.
  • @hebilicious/cssforge/capabilities (npm and JSR) exports the application, createSession, CallFailureError and toJsonSchema for the library target.
  • cssforge.acidcat.json is the committed catalog. moon run cssforge:catalog-write writes it, tests/acidcat.test.ts fails when it is stale, and moon run cssforge:catalog-check runs acid-cat check --strict (@acid-cat/cli is a dev dependency). It ships in the npm package.
  • The example projects, the docs project, both smoke tests, the README, skills/cssforge, packages/docs/agents.md and the changeset use the new commands.
  • citty is removed, and @acid-cat/core-ts@0.11.1 is added.

Breaking

  • cssforge [flags] without a command no longer builds: run cssforge tokens build [flags]. -w, -m and --prefix are removed (use cssforge watch tokens.built, --mode and --root). --color-formats takes one format per flag or a JSON array.
  • The output is JSON. Build warnings are the diagnostics of the result. An invalid flag exits with 3, and an interrupted watch exits with 130.
  • build(), watch(), parseColorFormats(), writeFileRecursive() and the citty default export of @hebilicious/cssforge/cli are removed. Use tokens.build through @hebilicious/cssforge/capabilities.

Checks

moon run cssforge:typecheck cssforge:format cssforge:test cssforge:catalog-check cssforge:readme-check unplugin:typecheck unplugin:test cssforge:smoke-test cssforge:jsr-dry-run cssforge:jsr-smoke passes: 233 cssforge tests and 8 unplugin tests. vanilla-vue-css:cssforge-generate and docs:generate run with the new command.

Stacked on #98 (moon 2.6.5, and the browser e2e runner fix).

@changeset-bot

changeset-bot Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2f02abf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@hebilicious/cssforge Minor
@hebilicious/cssforge-unplugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
cssforge 2f02abf Commit Preview URL

Branch Preview URL
Nov 16 2026, 11:59 AM

One AcidCat application (src/app.ts) declares the capabilities tokens.build,
tokens.generate and config.check, and the event tokens.built. The command
line, the MCP server (`cssforge mcp`, stdio) and typed handles for a future
user interface (`@hebilicious/cssforge/app`) all come from it. The catalog is
committed as cssforge.acidcat.json and checked against the application.

The operations live in src/forge.ts and return reports instead of logging,
so every surface and the kept build()/watch() API share them. The schemas
are JSON Schema documents validated by a small local validator, so the
catalog and the runtime check cannot disagree.

`cssforge [flags]` with no command still builds, and -w, -m, --prefix and
comma separated --color-formats keep working. citty is removed.
@Hebilicious
Hebilicious changed the base branch from main to build/latest-moon-proto November 16, 2026 10:25
@Hebilicious
Hebilicious added this pull request to stack #101 November 16, 2026 10:25
…t docs

- Remove the app target and the ./app export: nothing uses them yet.
- Add @acid-cat/cli as a dev dependency, so catalog-check runs a locked
  version instead of fetching it with npx.
- The README no longer names the implementation, and says that agents can
  use the CLI as well as the MCP server.
- Remove the flags-only command line (`cssforge [flags]`, -w, -m,
  --prefix, comma separated --color-formats) and its translation layer.
- Remove build(), watch(), parseColorFormats() and writeFileRecursive()
  from the ./cli export, with the tests that only covered them.
- Rename src/app.ts to src/capabilities.ts, add the `library` target
  (TypeScript binding), and export it as @hebilicious/cssforge/capabilities
  with createSession and CallFailureError.
- Drop a leading `--`, which `pnpm run cssforge -- <args>` passes on.
- Move the examples, the docs project, the smoke tests and the docs to
  `cssforge tokens build`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant