feat: move shader submissions from web to CLI + MCP#37
Conversation
Extract submission logic (resolve-source, ai-parse, github-pr, build-manifest) from the web app into packages/cli/src/lib/ as pure functions. Add `submit` command to CLI and `submit_shader` tool to MCP server. Remove /submit route and nav link from web app. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
devallibus
left a comment
There was a problem hiding this comment.
I went through the diff locally and ran the current validation entrypoints (bun run test, bun run typecheck, bun run build:web) plus the new package-local suites in packages/cli and packages/mcp.
Two things look worth fixing before merge:
-
The root
checkscript does not actually exercise the new submit-path tests.package.json:15-17still limitstest:clitoregistry-types,search, andadd, so the new coverage inpackages/cli/src/lib/build-manifest.test.ts,packages/cli/src/lib/github-pr.test.ts,packages/cli/src/lib/resolve-source.test.ts, andpackages/cli/src/commands/submit.test.tsis skipped bybun run check. That means the PR description currently overstates what CI is proving, and regressions in the newly extracted submission flow can slip through unless those tests are wired into the root test script. -
The repo docs still advertise the removed web submission flow.
README.md:16,README.md:74, andREADME.md:81-83still say the web app provides AI submit via/submit, but this PR deletesapps/web/src/routes/submit.tsxand removes the nav entry. After this lands, contributors following the README will be sent to a route that no longer exists. The README should be updated to point people atshaderbase submit/submit_shaderinstead.
Other than that, the extracted CLI/MCP path looks coherent, and the web app still builds cleanly after the route removal.
Address PR review feedback: - Add resolve-source, build-manifest, github-pr, and submit tests to root test:cli script so bun run check exercises them - Update README to replace /submit web references with CLI/MCP submit commands Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
devallibus
left a comment
There was a problem hiding this comment.
Re-reviewed after the follow-up commit.
The two issues I called out are addressed:
package.jsonnow wires the new CLI submit-path tests into the roottest:cliscript, sobun run checkexercises the extracted submission flow.README.mdno longer points contributors at the removed/submitweb route and now documents the CLI / MCP submission paths instead.
I do not see any additional findings in the updated PR.
Summary
packages/cli/src/lib/as pure, testable functionssubmitcommand to CLI with--repo,--jsonflags and stdin supportsubmit_shadertool to MCP server (both JSON-RPC and legacy HTTP endpoint)/submitroute,AiSubmitWizard,LibraryList, and nav link from web appTest plan
bun run checkpasses (test + typecheck + validate + build)shaderbaseCLI showssubmitin help texttools/listreturns 3 tools includingsubmit_shader/submitroute or nav linkshaderbase submit <shadertoy-url>with real API keys creates a PRsubmit_shadertool call with real Worker secrets creates a PR🤖 Generated with Claude Code