CLI & registry
Vendor a shader into your repository with npx shadertown add.
The SDK keeps the shader inside node_modules. Sometimes you want it in your
repository instead: to edit the WGSL, to review it, or to stop depending on us.
npx shadertown add auroraThe CLI ships inside the shadertown package, so npx shadertown resolves
without a second install, and if the package is already a dependency, the
binary is on your path.
That writes a directory per shader:
src/shaders/aurora/aurora.wgsl the complete, self-contained WGSL
src/shaders/aurora/aurora.ts the typed preset, with your tuned parameters
src/shaders/aurora/example.tsx a ready-to-paste ShaderCanvas usage
src/shaders/aurora/README.md every control the shader exposes
src/shaders/aurora/LICENSE the licence the files were issued underThe WGSL has no imports. The shared prelude is already inlined, so the file
compiles on its own with vgpu check or any other WGSL toolchain.
Commands
| Command | What it does |
|---|---|
shadertown add <slug…> | Vendor one or more shaders |
shadertown list | Print the catalogue, marking the free shaders |
shadertown init | Write a shadertown.config.ts |
shadertown login | Connect this terminal to your account |
shadertown logout | Forget the stored token |
shadertown whoami | Show who this terminal is signed in as |
shadertown mcp | Serve the catalogue to a coding agent over MCP — see MCP server |
login opens a browser, and stores the token it gets back in
~/.shadertown/credentials.json. That is what lifts the 402 on a
Professional shader. See below.
| Flag | Default | Notes |
|---|---|---|
--out <dir> | src/shaders | Where files are written |
--params <query> | none | speed=0.4&colorA=5b8cff, the query string from a detail page URL |
--registry <url> | https://www.shadertown.com | Point at a fork to serve your own catalogue |
--licensee <name> | your account | Name to issue the vendored LICENSE to |
--force | off | Overwrite existing files |
Sharing a tuned shader
Every detail page keeps its slider state in the URL. Copy the link, hand the query string to the CLI, and the vendored preset comes out with those exact values:
npx shadertown add aurora --params "speed=0.42&exposure=1.6&colorC=a78bfa"The registry endpoint
add is a thin client over one read-only JSON route:
curl https://www.shadertown.com/r/aurora.json{
"slug": "aurora",
"name": "Aurora",
"tagline": "Layered curtains of light over a night sky",
"family": "organic",
"tags": ["ambient", "hero", "dark"],
"cost": "medium",
"tier": "free",
"files": [
{ "path": "aurora/aurora.wgsl", "type": "wgsl", "content": "…" },
{ "path": "aurora/aurora.ts", "type": "preset", "content": "…" },
{ "path": "aurora/example.tsx", "type": "example", "content": "…" },
{ "path": "aurora/README.md", "type": "readme", "content": "…" },
{ "path": "aurora/LICENSE", "type": "license", "content": "…" }
]
}path is relative to --out, which is why add produces a directory per
shader rather than loose files.
tier is "free" or "professional", and it is the whole access model. A
free shader hands over its files to anyone. A professional one will need a
licence: the endpoint answers 402 with a reason, and the CLI reads
SHADERTOWN_KEY from the environment or the token that shadertown login
stored. Browsing and tuning stay free on both.
shadertown list marks the free shaders; everything unmarked needs a licence
for its source. Tuning is free on all of them, on the site.
The paywall is on: of the 77 shaders, 16 are free and the other
61 answer 402 without a licence.