Command Reference

Global Flags

These flags are available on all commands:

FlagShortDescriptionDefault
--config-cPath to config filetow.yaml
--environment-eTarget environment
--module-mTarget module
--server-sTarget server number (0 = all)0
--verbose-vEnable debug outputfalse
--dry-runShow actions without executingfalse
--insecureSkip SSH host key verificationfalse

Commands

tow init

Auto-detect project type and generate configuration.

tow init

Scans your project directory and detects:

  • Language: Java, Node.js, Python, Go, Rust
  • Framework: Spring Boot, NestJS, Express, FastAPI, Django, Flask, Next.js
  • Build tool: Gradle, Maven, npm, yarn, pnpm, poetry, uv, cargo
  • Monorepo modules: settings.gradle, pom.xml <modules>
  • CI/CD: Dockerfile, docker-compose, GitHub Actions, GitLab CI, Jenkins

Generates:

  • tow.yaml with detected module types and sensible defaults
  • script/{module}/env.sh — environment variables for each module
  • script/{module}/server — start/stop/status/restart control script

Note: Library modules (ending in -common, -core, -support, -lib, -shared, -util) are automatically excluded from deployment modules.

tow validate

Validate configuration file without connecting to servers.

tow validate
tow validate -c custom-config.yaml

Checks:

  • Required fields (project.name, servers, modules)
  • SSH key file existence
  • Module type validity
  • Health check configuration

tow deploy

Run the deploy pipeline: package → upload → install → stop → start.

tow deploy -e prod -m api-server
tow deploy -e prod -m api-server -s 1    # Deploy to server 1 only
tow deploy -e prod                        # Deploy all modules
tow deploy -e prod --dry-run              # Preview without executing

tow auto

Run the full pipeline: build → package → upload → install → stop → start.

tow auto -e dev -m api-server
tow auto -e prod -m api-server --dry-run

This is the most common command for end-to-end deployment from source code to running service.

tow start

Start a module on remote servers.

tow start -e prod -m api-server
tow start -e prod -m api-server -s 1

After starting, Tow runs health checks based on the module’s health_check configuration.

tow stop

Stop a module on remote servers.

tow stop -e prod -m api-server
tow stop -e prod -m api-server -s 2

tow restart

Stop then start a module.

tow restart -e prod -m api-server

tow status

Check the current status of a module.

tow status -e prod -m api-server

Shows:

  • Process ID (PID)
  • Uptime
  • Memory usage
  • Current deployment version (symlink target)

tow rollback

Switch to a previous deployment version.

# Roll back to the previous deployment
tow rollback -e prod -m api-server

# Roll back to a specific version
tow rollback -e prod -m api-server -t 20240626-101530

Rollback is instant — it switches the current symlink and restarts the service. No re-upload or re-build required.

tow logs

Stream remote log files.

tow logs -e prod -m api-server
tow logs -e prod -m api-server -f "ERROR"      # Filter with grep
tow logs -e prod -m api-server -n 100           # Last 100 lines
tow logs -e prod -m api-server -s 1             # Specific server

tow setup

Initialize remote server directory structure.

tow setup -e dev
tow setup -e prod -m api-server

Creates on each server:

{base_dir}/{module}-{server_number}/
├── deploy/      # Deployment versions
├── upload/      # Upload staging
├── log/         # Persistent logs
├── conf/        # Persistent configuration
└── {data_dirs}  # Custom data directories

tow upload

Transfer a file to remote servers.

tow upload -e prod -m api-server
tow upload -e prod -m api-server path/to/file.tar.gz

tow install

Extract the uploaded package and update the current symlink.

tow install -e prod -m api-server

Creates a new timestamped directory in deploy/ and updates the symlink.

tow list

List configuration information.

tow list modules       # List all modules
tow list envs          # List all environments
tow list deployments -e prod -m api-server  # List deployment history

tow login

Open an interactive SSH session to a server.

tow login -e prod -m api-server -s 1

tow unlock

Force release a deploy lock.

tow unlock -e prod -m api-server

Use this when a deploy was interrupted and the lock wasn’t cleaned up.

tow cleanup

Remove old deployment directories from remote servers.

tow cleanup -e prod -m api-server              # Keep default (from config or 5)
tow cleanup -e prod -m api-server --keep 3     # Keep only 3 most recent

The current active deployment is never removed. Configure automatic cleanup in tow.yaml:

retention:
  keep: 5
  auto_cleanup: true    # Clean up after every deploy/auto

tow download

Download files from a remote server to local.

tow download -e prod -m api-server logs/std.log
tow download -e prod -m api-server /var/log/syslog -d ./local-logs/

If the path is relative, it’s resolved against the module base directory.

tow provision

Provision a new server with basic requirements.

tow provision -e prod -m api-server --timezone Asia/Seoul --locale en_US.UTF-8 --jre --tools
FlagDescription
--timezoneSet server timezone (e.g., Asia/Seoul)
--localeSet server locale (e.g., en_US.UTF-8)
--jreInstall Java Runtime Environment
--toolsInstall essential tools (lsof, nc, curl, tar)

This also runs tow setup to create the deployment directory structure.

tow threaddump

Trigger a thread dump on Java/Spring Boot modules for debugging.

tow threaddump -e prod -m api-server
tow threaddump -e prod -m api-server -s 1

Sends kill -3 to the JVM process. Thread dump output is written to the application’s log file.

Only available for modules with type springboot or java.

tow mcp-server

Start the MCP (Model Context Protocol) server for AI agent integration.

tow mcp-server
tow mcp-server -c /path/to/tow.yaml

This exposes Tow operations as tools for AI assistants (Claude, Cursor, Windsurf). See AI Agent Integration below.

Advanced Flags

Rolling Deployment

Deploy to one server at a time, verifying health before proceeding to the next:

tow deploy -e prod -m api-server --rolling
tow auto -e prod -m api-server --rolling
tow start -e prod -m api-server --rolling

Auto-Rollback

Automatically revert to the previous deployment if health check fails after start:

tow auto -e prod -m api-server --auto-rollback

Production Confirmation

Production environments (prod, production, live) require interactive confirmation:

⚠  WARNING: You are about to deploy api-server in PROD
  Type 'yes' to confirm:

Skip with -y / --yes flag (for CI/CD):

tow deploy -e prod -m api-server -y

JSON Output

Machine-readable output for CI/CD pipelines:

tow status -e prod -m api-server -o json
tow list deployments -e prod -m api-server -o json

AI Agent Integration

MCP Server

Configure in Claude Desktop, Cursor, or any MCP-compatible client:

{
  "mcpServers": {
    "tow": {
      "command": "tow",
      "args": ["mcp-server"],
      "env": { "TOW_CONFIG": "./tow.yaml" }
    }
  }
}

Available MCP tools:

ToolDescription
tow_statusCheck module status (PID, uptime, memory)
tow_deployDeploy a module (with production safety gate)
tow_rollbackRollback to previous deployment
tow_logsFetch recent log lines
tow_list_deploymentsList deployment history
tow_list_modulesList configured modules
tow_list_environmentsList configured environments

Command Pipelines

Commandbuildpackageuploadinstallstopstarthealth check
auto
deploy
start
stop
restart
rollback
upload
install

Dry-Run Mode

Add --dry-run to any command to preview actions without executing:

tow auto -e prod -m api-server --dry-run
[1/6] Building api-server...
  → Would run: ./gradlew :api-server:bootJar
[2/6] Packaging api-server...
  → Would create: build/api-server.tar.gz
[3/6] Uploading to prod-1 (52.78.100.1)...
  → Would SCP: build/api-server.tar.gz → ~/upload/
[4/6] Installing on prod-1...
  → Would extract to: deploy/20240626-143022/
  → Would update symlink: current → deploy/20240626-143022
[5/6] Stopping api-server on prod-1...
  → Would run: bin/server stop
[6/6] Starting api-server on prod-1...
  → Would run: bin/server start