Titan Planet Logo
How to Use Titan

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/cli

Note: 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

OptionDescription
-t, --templateSelect application template

Templates

TemplateDescription
jsStandard JavaScript application
tsStandard TypeScript application
rust-jsHybrid Rust + JavaScript architecture (Experimental)
rust-tsHybrid Rust + TypeScript architecture (Experimental)

Examples

titan init my-app
titan init my-app -t ts
titan init my-app -t rust-ts

Based 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 dev

Defined 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

CommandDescription
titan buildStandard build pipeline
titan build --releaseFully optimized production build
titan build extCompile 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 ext

Build 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 start

The command directly boots the production server from the existing build output.


titan run

Executes TitanPl servers.

Commands

CommandDescription
titan runRun compiled production server
titan run extLaunch 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 ext

Runtime 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

OptionDescription
--status, -sFull 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.jsontsconfig.json

Examples

titan update
titan update --status
titan update --template ts
titan update --template js

Notes

  • Only affects the app/ directory

  • Ignores:

    • node_modules/
    • dist/
    • target/
    • sandbox/

After updating packages:

npm install

Update 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

TypeDescription
jsPure JavaScript runtime extension
nativeRust native extension
golangGo shared library extension
wasmWebAssembly extension (Experimental)

Generated Structure

native/      → Native source code
sandbox/     → Extension testing runtime
titan.json   → Extension manifest
index.js     → Runtime registration entrypoint

Example

titan create ext my-ext

titan 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 ext

titan 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

ModeDescription
TitanPl SandboxMinimal TitanPl server
TGRV SandboxStandalone Gravity runtime

Example

titan run ext

Extension 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

OptionDescription
-h, --helpShow help information
-v, --versionShow current Titan CLI version

Examples

titan --help
titan --version

CLI option routing is defined directly in the main command dispatcher.

On this page