012 - Tools (CLI Scripts)
The tools are CLI scripts for project creation and maintenance.
Overview
| Script |
Function |
create-cc-project.mjs |
Create new Artwork |
exhibition-package-builder.mjs |
Build Exhibition Package |
validate-sketch-pattern.mjs |
Validate Code Patterns |
create-cc-project.mjs
Creates a new artwork with all necessary files.
Usage
node shell-scripts/create-cc-project.mjs
node shell-scripts/create-cc-project.mjs \
--name "My Artwork" \
--template "particle-system" \
--output "./projects/"
Options
| Option |
Short |
Description |
--name |
-n |
Project Name |
--template |
-t |
Template |
--output |
-o |
Output Directory |
--force |
-f |
Overwrite Existing |
Templates
| Template |
Description |
basic |
Minimal Setup |
with-agents |
With Background, Brush |
particle-system |
Particle System |
physics |
Physics/Verlet |
plotter |
SVG Export |
exhibition |
Exhibition-Ready |
Generated Structure
my-artwork/
├── src/
│ ├── index.ts # Entry Point
│ ├── artwork.ts # Main Artwork Class
│ └── config.ts # Tweakpane Config
├── assets/
│ └── .gitkeep
├── snapshots/
│ └── .gitkeep
├── package.json
├── tsconfig.json
├── webpack.config.js
└── README.md
exhibition-package-builder.mjs
Builds standalone exhibition packages.
Usage
node shell-scripts/exhibition-package-builder.mjs \
--config exhibition.json \
--output ./dist/
Configuration File
{
"name": "My Exhibition",
"artworks": [
{ "path": "./projects/artwork-1", "duration": 600 },
{ "path": "./projects/artwork-2", "duration": 300 }
],
"options": {
"resolution": { "width": 1920, "height": 1080 },
"minimized": true,
"autostart": true
}
}
Options
| Option |
Description |
--config |
Configuration File |
--output |
Output Directory |
--platform |
Target Platform (win/mac/linux) |
--sign |
Sign Package (macOS) |
validate-sketch-pattern.mjs
Validates artworks against best practices.
Usage
node shell-scripts/validate-sketch-pattern.mjs ./projects/my-artwork/
Checks
| Check |
Description |
structure |
Correct File Structure? |
exports |
Required Exports Present? |
types |
TypeScript Types Correct? |
tweakpane |
ensureParameterSet() Present? |
scenegraph |
Agents Correctly Registered? |
performance |
Obvious Performance Issues? |
Output
✓ Structure OK
✓ Exports OK
⚠ Tweakpane: Missing ensureParameterSet() in Background
✓ SceneGraph OK
✓ Performance OK
1 Warning, 0 Errors
npm Scripts
The package.json contains useful scripts:
Development
| Script |
Description |
npm run dev |
Start Dev Server |
npm run build |
Build for Production |
npm run watch |
Build with Watch |
Quality
| Script |
Description |
npm run lint |
ESLint Check |
npm run typecheck |
TypeScript Check |
npm run validate |
Run validate-sketch-pattern |
Export
| Script |
Description |
npm run snapshot |
Create Snapshot |
npm run export:svg |
Export as SVG |
npm run build:exhibition |
Build Exhibition Package |
Extension
Scripts can be extended:
const customTemplates = {
'my-template': {
files: [
{ path: 'src/index.ts', content: `...` },
],
dependencies: ['three'],
devDependencies: ['@types/three'],
},
};