ClojureScript compiler and JS bundler with comprehensive development tooling
—
Shadow-CLJS provides a comprehensive command-line interface for all development and build operations. Commands are executed through the global shadow-cljs binary or npx.
Compiles a build once and exits. Used for one-time builds or CI/CD pipelines.
shadow-cljs compile <build-id> [options]
# Options:
--debug # Enable debug mode with readable output
--pseudo-names # Use pseudo names for debugging
--source-maps # Generate source maps
--config-merge <edn> # Merge additional configuration
--verbose # Enable verbose outputUsage Examples:
# Basic compilation
shadow-cljs compile app
# Debug compilation with source maps
shadow-cljs compile app --debug --source-maps
# Compile with additional configuration
shadow-cljs compile app --config-merge '{:closure-defines {app.config/DEBUG true}}'Starts watching a build for file changes and automatically recompiles. Essential for development workflow.
shadow-cljs watch <build-id> [options]
# Options:
--debug # Enable debug mode
--verbose # Enable verbose output
--sync # Force synchronous compilation
--config-merge <edn> # Merge additional configurationUsage Examples:
# Start watching with hot reload
shadow-cljs watch app
# Watch with debug output
shadow-cljs watch app --debug --verbose
# Watch with custom configuration
shadow-cljs watch app --config-merge '{:dev-http {8080 \"public\"}}'Compiles with Google Closure Compiler optimizations enabled for production builds.
shadow-cljs release <build-id> [options]
# Options:
--debug # Enable debug mode (disable optimizations)
--pseudo-names # Use pseudo names in optimized output
--source-maps # Generate source maps for production
--config-merge <edn> # Merge additional configurationUsage Examples:
# Production build
shadow-cljs release app
# Production build with source maps
shadow-cljs release app --source-maps
# Debug release build
shadow-cljs release app --debugPerforms compilation analysis and error checking without generating output files.
shadow-cljs check <build-id> [options]
# Options:
--verbose # Enable verbose output
--config-merge <edn> # Merge additional configurationUsage Examples:
# Check for compilation errors
shadow-cljs check app
# Verbose error checking
shadow-cljs check app --verboseManages the Shadow-CLJS development server for hot reload and development tools.
# Start development server
shadow-cljs server [options]
# Options:
--port <number> # Server port (default: 9630)
--host <string> # Server host (default: localhost)
--config-merge <edn> # Merge additional configuration
# Stop development server
shadow-cljs stopUsage Examples:
# Start server on default port
shadow-cljs server
# Start server on custom port
shadow-cljs server --port 8080
# Start server with custom configuration
shadow-cljs server --config-merge '{:dev-http {3000 \"public\"}}'
# Stop running server
shadow-cljs stopInteractive Read-Eval-Print Loop for development and debugging.
# Build-specific REPL
shadow-cljs repl <build-id>
# Node.js REPL
shadow-cljs node-repl [options]
# Options:
--config-merge <edn> # Merge additional configuration
# Browser REPL
shadow-cljs browser-repl [options]
# Options:
--config-merge <edn> # Merge additional configuration
# Connect to ClojureScript REPL
shadow-cljs cljs-repl <build-id>Usage Examples:
# Start REPL for browser build
shadow-cljs repl app
# Start Node.js REPL for server-side development
shadow-cljs node-repl
# Start browser REPL for general ClojureScript development
shadow-cljs browser-repl
# Connect to existing build REPL
shadow-cljs cljs-repl appCommands for inspecting build state and project information.
# Show build information
shadow-cljs info [build-id]
# Show project classpath
shadow-cljs classpath
# Generate Maven POM file
shadow-cljs pom
# Show version information
shadow-cljs --version
# Show help
shadow-cljs help [command]Usage Examples:
# Show all builds information
shadow-cljs info
# Show specific build information
shadow-cljs info app
# Show project classpath
shadow-cljs classpath
# Show help for a specific command
shadow-cljs help watchExecute ClojureScript tests in different environments.
# Run Node.js tests
shadow-cljs node-test [test-build-id] [options]
# Run Karma tests (browser)
shadow-cljs karma [test-build-id] [options]
# Generic test command
shadow-cljs test [options]
# Options:
--config-merge <edn> # Merge additional configuration
--autorun # Enable automatic test runningUsage Examples:
# Run Node.js tests
shadow-cljs node-test test
# Run browser tests with Karma
shadow-cljs karma test
# Run generic test command
shadow-cljs test
# Run tests with automatic rerun
shadow-cljs node-test test --autorunSpecialized commands for advanced use cases and debugging.
# Tree shaking analysis
shadow-cljs tree-shake <build-id>
# Dependency analysis
shadow-cljs deps [options]
# Clean compiled files
shadow-cljs clean [build-id]
# REPL for specific namespaces
shadow-cljs clj-repl
# nREPL server
shadow-cljs nrepl
# Server management commands
shadow-cljs start # Start development server
shadow-cljs stop # Stop development server
shadow-cljs restart # Restart development server
# Project initialization
shadow-cljs init # Initialize new shadow-cljs project
# AOT compilation
shadow-cljs aot # Ahead-of-time compilationUsage Examples:
# Analyze unused code
shadow-cljs tree-shake app
# Clean all build outputs
shadow-cljs clean
# Clean specific build
shadow-cljs clean app
# Start Clojure REPL
shadow-cljs clj-repl
# Server management
shadow-cljs start
shadow-cljs stop
shadow-cljs restart
# Initialize new project
shadow-cljs init
# AOT compilation
shadow-cljs aotInstall with Tessl CLI
npx tessl i tessl/npm-shadow-cljs