CLI Reference

Complete reference for Andromeda's command-line interface.

Synopsis

andromeda [COMMAND] [OPTIONS] [ARGS...]

Commands

run

Execute JavaScript or TypeScript files.

Syntax:

andromeda run [OPTIONS] <FILES...>

Arguments:

Options:

Examples:

# Run a single file
andromeda run script.ts

# Run multiple files
andromeda run utils.js main.ts helper.ts

# Run with verbose output
andromeda run --verbose my-app.ts

# Run without strict mode
andromeda run --no-strict legacy-script.js

repl

Start an interactive Read-Eval-Print Loop.

Syntax:

andromeda repl [OPTIONS]

Options:

Examples:

# Start basic REPL
andromeda repl

# Start REPL with debugging features
andromeda repl --expose-internals --print-internals

# Start REPL with GC disabled (for debugging)
andromeda repl --disable-gc

REPL Commands:

compile

Compile a JavaScript/TypeScript file into a single-file executable.

Syntax:

andromeda compile <INPUT> <OUTPUT>

Arguments:

Examples:

# Compile a TypeScript file
andromeda compile my-app.ts my-app.exe

# Compile to a Unix executable
andromeda compile script.js ./my-tool

# Compile with full paths
andromeda compile /path/to/source.ts /usr/local/bin/mytool

fmt

Format JavaScript and TypeScript files.

Syntax:

andromeda fmt [PATHS...]

Arguments:

Examples:

# Format specific files
andromeda fmt script.ts utils.js

# Format entire directory
andromeda fmt src/

# Format current directory
andromeda fmt

# Format multiple directories
andromeda fmt src/ tests/ examples/

Supported File Types:

Global Options

These options are available for all commands:

Examples:

# Show general help
andromeda --help

# Show help for specific command
andromeda run --help

# Show version
andromeda --version

File Types

Andromeda supports these file extensions:

Extension Description
.js JavaScript files
.ts TypeScript files
.jsx JavaScript with JSX* (React)
.tsx TypeScript with JSX* (React)
.mjs ES Module JavaScript
.mts ES Module TypeScript

*JSX not actually supported yet

Environment Variables

Andromeda respects these environment variables:

Variable Description Default
RUST_LOG Set logging level info
NO_COLOR Disable colored output false

Examples:

# Enable debug logging
RUST_LOG=debug andromeda run script.ts

# Disable colors
NO_COLOR=1 andromeda run script.ts

Debugging

Verbose Output

Use --verbose with the run command to see detailed execution information:

andromeda run --verbose script.ts

This shows:

REPL Debugging

Start REPL with debugging options:

andromeda repl --expose-internals --print-internals

This provides access to:

Error Reporting

Andromeda provides detailed error messages with:

Examples

Basic Script Execution

# Simple execution
andromeda run hello.ts

# Multiple files with dependencies
andromeda run utils.ts main.ts

andromeda run complex-app.ts

Development Workflow

# Format code
andromeda fmt src/

andromeda run src/main.ts

# Test in REPL
andromeda repl

# Create production executable
andromeda compile src/main.ts dist/my-app

CI/CD Integration

TODO: Write up

completions

Generate shell completion scripts for bash, zsh, fish, or PowerShell.

Syntax:

andromeda completions [SHELL]

Arguments:

Examples:

# Auto-detect shell and generate completions
andromeda completions

# Generate bash completions
andromeda completions bash > ~/.local/share/bash-completion/completions/andromeda

# Generate zsh completions
andromeda completions zsh > ~/.oh-my-zsh/completions/_andromeda

# Generate fish completions
andromeda completions fish > ~/.config/fish/completions/andromeda.fish

# Generate PowerShell completions
andromeda completions powershell > andromeda.ps1

upgrade

Upgrade Andromeda to the latest version or a specific version.

Syntax:

andromeda upgrade [OPTIONS]

Options:

Examples:

# Upgrade to latest version
andromeda upgrade

# Force reinstall current version
andromeda upgrade --force

# Upgrade to specific version
andromeda upgrade --version v0.2.0

# Check what would be upgraded (dry run)
andromeda upgrade --dry-run

Troubleshooting

For common issues and solutions, see the Troubleshooting Guide.

For more examples check out the Examples