TCSS CLI
A powerful command-line interface for the TCSS (Typed CSS) compiler.
Installation
From Source
From Crates.io (Coming Soon)
Quick Start
# Get help
# Check version
# Compile a file
# Watch for changes
Usage
Getting Help
Display help information:
# General help
# Command-specific help
Version Information
Display version:
Compile Command
Compile a TCSS file to CSS:
Options:
-o, --output <OUTPUT>- Output CSS file (defaults to input with .css extension)-m, --minify- Minify the output CSS-w, --watch- Watch for changes and recompile-v, --verbose- Enable verbose output--debug- Enable debug mode
Examples:
# Basic compilation
# Compile with custom output
# Compile and minify
# Compile and watch for changes
Watch Command
Watch files or directories for changes and auto-compile:
Options:
-o, --output <OUTPUT>- Output directory for compiled CSS-m, --minify- Minify the output CSS-v, --verbose- Enable verbose output
Examples:
# Watch current directory
# Watch specific directory
# Watch with minification
Init Command
Initialize a new TCSS project:
Options:
-d, --dir <DIR>- Project directory (defaults to project name)-v, --verbose- Enable verbose output
Examples:
# Create new project
# Create project in specific directory
Project Structure:
my-project/
├── src/
│ └── main.tcss # Example TCSS file
├── dist/ # Compiled CSS output
├── .gitignore
└── README.md
Check Command
Check TCSS files for errors without compiling:
Options:
-v, --verbose- Enable verbose output
Examples:
# Check single file
# Check multiple files
# Check with verbose output
Command Aliases
TCSS CLI provides short aliases for frequently used commands:
| Command | Alias | Usage |
|---|---|---|
| compile | c | tcss c styles.tcss |
| watch | w | tcss w src/ |
| init | i | tcss i my-project |
Examples:
# Using aliases
Global Options
These options work with all commands:
-v, --verbose- Enable verbose output--debug- Enable debug mode (includes verbose)-h, --help- Print help information-V, --version- Print version information
Verbose Mode
Verbose mode shows additional information about operations:
# Compile with verbose output
# Watch with verbose output
What verbose mode shows:
- File operations (reading/writing)
- File sizes
- Timing information
- Progress updates
Example output:
→ Compiling: styles.tcss
✓ Compiled styles.tcss → styles.css
📄 styles.css - 1.23 KB
⏱ Compilation took 45ms
Debug Mode
Debug mode shows detailed debugging information (automatically includes verbose output):
# Compile with debug output
# Check with debug output
What debug mode shows:
- Compilation phases (tokenization, parsing, generation)
- Token and AST node counts
- Internal state and variables
- Detailed timing per phase
- Full error context
Example output:
ℹ TCSS CLI 0.1.0 (debug mode)
DEBUG: Debug mode enabled - showing detailed output
DEBUG: Input file = "styles.tcss"
DEBUG: Phase 1: Tokenization
DEBUG: Generated 42 tokens
DEBUG: Phase 2: Parsing
DEBUG: Parsed 8 AST nodes
DEBUG: Phase 3: CSS Generation
DEBUG: Generated 1234 bytes of CSS
✓ Compiled styles.tcss → styles.css
Use cases:
- Verbose: Development and understanding what's happening
- Debug: Troubleshooting issues and detailed diagnostics
See VERBOSE_DEBUG_MODES.md for complete documentation.
Examples:
# Get help for any command
# Check version
# Use verbose mode
# Combine options
Examples
Basic Workflow
# 1. Create a new project
# 2. Edit src/main.tcss
# ... make your changes ...
# 3. Compile to CSS
# 4. Or watch for changes
Production Build
# Compile and minify for production
Development Workflow
# Watch for changes during development
CI/CD Integration
# Check files in CI
# Build for production
Features
- ✅ Fast Compilation - Compile TCSS to CSS instantly
- ✅ Watch Mode - Auto-compile on file changes
- ✅ Minification - Optimize CSS for production
- ✅ Error Checking - Validate TCSS without compiling
- ✅ Project Scaffolding - Quick project setup
- ✅ Colored Output - Beautiful terminal output
- ✅ Verbose Mode - Detailed compilation info
Testing
The TCSS CLI has comprehensive test coverage with 145+ tests:
# Run all tests
# Run specific test suite
# Run with test runner script
Test Coverage:
- ✅ 50+ compile command tests
- ✅ 35+ check command tests
- ✅ 25+ init command tests
- ✅ 30+ error handling tests
- ✅ 20+ E2E tests
- ✅ 15+ verbose/debug tests
See docs/TESTING.md for complete testing guide.
License
MIT