4. CLI Reference
The Titan CLI is the central toolchain for building, testing, compiling, and managing Titan Planet applications and extensions. It powers the entire Orbit + Gravity workflow from local development to production deployment.
Installation
npm install -g @titanpl/cliNote: titan is the canonical command.
tit remains supported as a deprecated alias for backward compatibility.
Core Usage
titan <command> [options]Project Commands
titan init <project-name>
Scaffolds a new Titan Planet application.
Features
- Interactive project initialization
- JavaScript or TypeScript templates
- Hybrid Rust + JS architecture support
- Automatic runtime configuration generation
- Project structure bootstrapping
Options
| Option | Description |
|---|---|
-t, --template | Select application template |
Templates
| Template | Description |
|---|---|
js | Standard JavaScript application |
ts | Standard TypeScript application |
rust-js | Hybrid Rust + JavaScript architecture (Experimental) |
rust-ts | Hybrid Rust + TypeScript architecture (Experimental) |
Examples
titan init my-app
titan init my-app -t ts
titan init my-app -t rust-tsBased on the CLI initializer help definitions.
titan dev
Starts the TitanPl development server with live rebuild and hot reload.
Features
- Live Orbit router execution
- Route and action watching
- Automatic rebuild pipeline
- Native server compilation
- Instant hot reload
- Gravity runtime synchronization
Internal Behavior
- Bundles actions using
esbuild - Watches
app/for changes - Rebuilds native runtime automatically
- Restarts the server instantly after updates
Example
titan devDefined in the CLI router as the primary development server command.
titan build
Compiles TitanPl applications into deployable server artifacts.
Features
- Route precomputation
- Server artifact generation
- Packet bundling
- Native engine packaging
- Deployable binary preparation
Commands
| Command | Description |
|---|---|
titan build | Standard build pipeline |
titan build --release | Fully optimized production build |
titan build ext | Compile TitanPl extensions |
Release Mode
--release generates:
- Optimized runtime binaries
- Production-ready build output
- Self-contained deployment artifacts
- Precompiled route manifests
Examples
titan build
titan build --release
titan build extBuild system behavior comes from the Packet Bundler help definitions and CLI router.
titan start
Launches a previously built TitanPl production server.
Features
- Starts production Orbit router
- Loads compiled Gravity artifacts
- Executes prebuilt server binaries
Example
titan startThe command directly boots the production server from the existing build output.
titan run
Executes TitanPl servers.
Commands
| Command | Description |
|---|---|
titan run | Run compiled production server |
titan run ext | Launch extension sandbox server |
Sandbox Modes
TitanPl Sandbox
Minimal TitanPl server with extension injection support.
TGRV Sandbox
Standalone Gravity runtime execution environment.
Examples
titan run
titan run extRuntime launcher definitions are provided by the run help module.
titan update
Synchronizes, migrates, and upgrades TitanPl projects across framework versions.
Features
- Runtime migration
- Template conversion
- Native wrapper synchronization
- Ecosystem validation
- Extension verification
- Configuration regeneration
Options
| Option | Description |
|---|---|
--status, -s | Full ecosystem audit |
--template <js|ts> | Convert application template language |
--status Includes
- TitanPl package verification
- Extension validation
- Native binary inspection
- Runtime compatibility checks
- Marketplace registration validation
Template Conversion
Automatically:
- Updates
package.json - Renames source files
- Switches
jsconfig.json↔tsconfig.json
Examples
titan update
titan update --status
titan update --template ts
titan update --template jsNotes
-
Only affects the
app/directory -
Ignores:
node_modules/dist/target/sandbox/
After updating packages:
npm installUpdate system definitions come from the update help configuration.
Extension Commands
TitanPl extensions allow developers to extend the Gravity runtime using JavaScript, Rust, Go, or WebAssembly modules.
titan create ext <name>
Creates a new Titan extension package.
Supported Extension Types
| Type | Description |
|---|---|
js | Pure JavaScript runtime extension |
native | Rust native extension |
golang | Go shared library extension |
wasm | WebAssembly extension (Experimental) |
Generated Structure
native/ → Native source code
sandbox/ → Extension testing runtime
titan.json → Extension manifest
index.js → Runtime registration entrypointExample
titan create ext my-exttitan build ext
Compiles extension runtime binaries.
Supported Targets
- Rust native libraries
- Go shared objects
- WebAssembly modules
Outputs
Platform-specific runtime binaries such as:
.dll.so.dylib.wasm
Example
titan build exttitan run ext
Launches the Titan Extension Test Harness.
Features
- Minimal TitanPl server
- Isolated Gravity sandbox
- Native extension injection
- Runtime validation
- Local extension linking
Sandbox Modes
| Mode | Description |
|---|---|
| TitanPl Sandbox | Minimal TitanPl server |
| TGRV Sandbox | Standalone Gravity runtime |
Example
titan run extExtension toolkit definitions come from the extension help module.
Additional Commands
titan migrate
Runs TitanPl migration pipelines.
Purpose
- Framework migrations
- Runtime upgrades
- Legacy compatibility conversion
- Project structure evolution
The command exists in the CLI router and executes internal migration workflows.
Global Options
| Option | Description |
|---|---|
-h, --help | Show help information |
-v, --version | Show current Titan CLI version |
Examples
titan --help
titan --versionCLI option routing is defined directly in the main command dispatcher.