Tuff CLI
Command-line tools for building and publishing Tuff plugins
Tuff CLI
The @talex-touch/tuff-cli package provides the tuff CLI for building and publishing Tuff plugins (bundling @talex-touch/unplugin-export-plugin for the build pipeline).
Installation
# Global installation
pnpm add -g @talex-touch/tuff-cli
# Or use via npx
npx @talex-touch/tuff-cli <command>
Commands
tuff create [name]
Create a new plugin via interactive prompts (type, language, UI framework, template).
tuff build
Run Vite build and then package .tpex output.
tuff build --watch --dev --output dist
Options:
--watch- Watch files and repackage after build--dev- Development mode (no minify, sourcemap enabled)--output <dir>- Output directory (default:dist)
tuff builder
Package existing build output into .tpex (no Vite build).
tuff builder
tuff dev
Start the Vite dev server for plugin development.
tuff dev --host --port 5173 --open
Options:
--host [host]- Bind host (omit value to listen on all)--port <port>- Dev server port--open- Open browser on start
tuff publish
Publish the latest .tpex package to Tuff Nexus.
tuff publish --tag 1.0.0 --channel RELEASE
Options:
--tag- Version tag (default: package.json version)--channel-RELEASE,BETA, orSNAPSHOT--notes- Changelog/notes (Markdown)--dry-run- Preview without publishing--api-url- Custom publish API URL
tuff login
Save your authentication token for publishing.
tuff login <token>
The token is stored in ~/.tuff/auth.json.
tuff logout
Remove saved authentication credentials.
tuff logout
tuff help / tuff about
Show help or tool information.
tuff
Run without arguments to enter interactive mode.
Vite Plugin Integration
You can also use the unplugin as a Vite plugin for automatic plugin building:
// vite.config.ts
import { defineConfig } from 'vite'
import TuffExport from '@talex-touch/unplugin-export-plugin/vite'
export default defineConfig({
plugins: [
TuffExport({
// Plugin options
})
]
})
Configuration
Optional tuff.config.{ts,js,mjs,cjs} can define defaults for build/dev/publish.
Precedence: CLI flags > tuff.config > manifest > defaults.
Publishing Workflow
- Build your plugin:
tuff build
(orvite build && tuff builder) - Login to Nexus:
tuff login YOUR_API_TOKEN - Publish:
tuff publish --tag 1.0.0 --channel RELEASE
The CLI will:
- Scan
dist/build(anddist) for.tpexpackages - Validate manifest/package versions
- Upload the latest
.tpexto the publish API