TresJS CLI
The tres command line tool for TresJS projects.
@tresjs/cli is the command line companion for TresJS projects. It exposes a single tres
binary that automates the parts of a 3D project that are tedious to write by hand, starting
with turning a .glb/.gltf model into a real Vue component.
Installation
Run it without installing anything:
npx @tresjs/cli --help
yarn dlx @tresjs/cli --help
pnpm dlx @tresjs/cli --help
Or add it to the project so everyone on the team runs the same version:
npm install -D @tresjs/cli
yarn add -D @tresjs/cli
pnpm add -D @tresjs/cli
Once installed, the binary is available as tres:
tres --help
The CLI requires Node.js 20 or later.
Commands
tres gltf public/models/robot.glb
# ✔ src/models/Robot.gen.vue
# 3 slots: Head, Body, Base
Global options
| Option | Description |
|---|---|
-V, --version | Print the CLI version. |
-h, --help | Print help for the CLI or for a specific command (tres gltf --help). |
Looking for a way to scaffold a new project? That is a different tool:
npm create tres@latest.
See the installation guide.