Docs/Tuff CLI
Universal Developer

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

EXAMPLE.BASH
# 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.

EXAMPLE.BASH
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).

EXAMPLE.BASH
tuff builder

tuff dev

Start the Vite dev server for plugin development.

EXAMPLE.BASH
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.

EXAMPLE.BASH
tuff publish --tag 1.0.0 --channel RELEASE

Options:

  • --tag - Version tag (default: package.json version)
  • --channel - RELEASE, BETA, or SNAPSHOT
  • --notes - Changelog/notes (Markdown)
  • --dry-run - Preview without publishing
  • --api-url - Custom publish API URL

tuff login

Save your authentication token for publishing.

EXAMPLE.BASH
tuff login <token>

The token is stored in ~/.tuff/auth.json.

tuff logout

Remove saved authentication credentials.

EXAMPLE.BASH
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:

EXAMPLE.TYPESCRIPT
// 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

  1. Build your plugin:
    EXAMPLE.BASH
    tuff build
    

    (or vite build && tuff builder)
  2. Login to Nexus:
    EXAMPLE.BASH
    tuff login YOUR_API_TOKEN
    
  3. Publish:
    EXAMPLE.BASH
    tuff publish --tag 1.0.0 --channel RELEASE
    

The CLI will:

  • Scan dist/build (and dist) for .tpex packages
  • Validate manifest/package versions
  • Upload the latest .tpex to the publish API
Was this helpful?