This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
create-tres - CLI wizard for scaffolding TresJS projects (Vue.js + Three.js). Interactive tool that generates project templates with configurable ecosystem packages.
# Build
pnpm build # Compile TypeScript (tsdown)
pnpm build:watch # Watch mode
# Development
pnpm dev # Build and run CLI locally
# Test locally (after build)
node bin/index.js [project-name]
# Testing
pnpm test # Run vitest
# Linting
pnpm lint # ESLint check
pnpm lint:fix # Auto-fix
# Release
pnpm release # release-it (runs lint + build)bin/index.js → Entry point, dynamically imports dist/index.js
src/index.ts → Main CLI logic (commander + prompts)
templates/
vue/ → Vue + Vite template
nuxt/ → Nuxt template with @tresjs/nuxt module
- Parse args with
commander - Interactive prompts: project name, template (vue/nuxt), ESLint, ecosystem packages
- Copy template to target directory
- Replace
{{projectName}}placeholders in package.json/README.md - Inject selected dependencies and TypeScript/ESLint configs
- Package manager detection: Auto-detects npm/yarn/pnpm from
npm_config_user_agent - TypeScript always enabled: No opt-out option
- Ecosystem packages: cientos (recommended), post-processing, leches defined in
ECOSYSTEM_PACKAGESarray - Template variables: Use
{{projectName}}in template files for substitution
Both templates include TheExperience.vue component demonstrating:
- TresCanvas setup with camera, lights, grid
useLoopcomposable for animation- Type-safe TresObject refs
Vue template: Vite config with GLSL plugin, Three.js chunking, vue-tsc
Nuxt template: Pre-configured @tresjs/nuxt module, SSR-ready