CLI Command Reference
Complete reference for the Hyperstack CLI (hs).
Global Options
Section titled “Global Options”| Option | Description |
|---|---|
--config, -c <path> | Path to hyperstack.toml (default: hyperstack.toml) |
--json, -j | Output as JSON |
--help, -h | Show help |
--version, -V | Show version |
Quick Reference
Section titled “Quick Reference”| Command | Description |
|---|---|
hs init | Initialize project |
hs up [spec] | Deploy spec (push + build + deploy) |
hs status | Show project overview |
hs logs [build-id] | View build logs |
hs auth login | Authenticate |
Project Setup
Section titled “Project Setup”hs init
Section titled “hs init”Initialize a new Hyperstack project.
hs initCreates hyperstack.toml with auto-discovered specs from .hyperstack/*.ast.json.
hs config init
Section titled “hs config init”Create a fresh configuration file.
hs config iniths config validate
Section titled “hs config validate”Validate your configuration.
hs config validateAuthentication
Section titled “Authentication”hs auth register
Section titled “hs auth register”Create a new account.
hs auth registerPrompts for username and password (min 8 characters).
hs auth login
Section titled “hs auth login”Login to your account.
hs auth loginhs auth logout
Section titled “hs auth logout”Remove stored credentials.
hs auth logouths auth status
Section titled “hs auth status”Check local authentication status.
hs auth statushs auth whoami
Section titled “hs auth whoami”Verify authentication with server.
hs auth whoamiCredentials location: ~/.hyperstack/credentials.toml
Deployment
Section titled “Deployment”hs up [spec-name]
Section titled “hs up [spec-name]”Deploy a spec: push, build, and deploy in one command.
# Deploy all specshs up
# Deploy specific spechs up my-spec
# Deploy to branchhs up my-spec --branch staging# Creates: my-spec-staging.stack.hypertek.app
# Preview deploymenths up my-spec --previewOptions:
| Flag | Description |
|---|---|
--branch, -b <name> | Deploy to named branch |
--preview | Create preview deployment |
hs status
Section titled “hs status”Show overview of all specs, builds, and deployments.
hs statushs status --jsonhs logs [build-id]
Section titled “hs logs [build-id]”View build logs.
# Most recent buildhs logs
# Specific buildhs logs 123Spec Management
Section titled “Spec Management”hs spec push [spec-name]
Section titled “hs spec push [spec-name]”Push local specs to remote.
# Push all specshs spec push
# Push specific spechs spec push my-spechs spec pull
Section titled “hs spec pull”Pull remote specs to local config.
hs spec pullhs spec list
Section titled “hs spec list”List all remote specs.
hs spec lisths spec list --jsonhs spec show <spec-name>
Section titled “hs spec show <spec-name>”Show detailed spec information.
hs spec show my-spechs spec show my-spec --version 3hs spec versions <spec-name>
Section titled “hs spec versions <spec-name>”Show version history.
hs spec versions my-spechs spec versions my-spec --limit 10hs spec delete <spec-name>
Section titled “hs spec delete <spec-name>”Delete a spec from remote.
hs spec delete my-spechs spec delete my-spec --force # Skip confirmationBuild Commands
Section titled “Build Commands”hs build create <spec-name>
Section titled “hs build create <spec-name>”Create a new build from a spec.
hs build create my-spechs build create my-spec --version 2hs build create my-spec --ast-file ./my-spec.ast.jsonhs build create my-spec --no-waitOptions:
| Flag | Description |
|---|---|
--version, -v <n> | Use specific version (default: latest) |
--ast-file <path> | Use local AST file directly |
--no-wait, -n | Don’t wait for completion |
hs build list
Section titled “hs build list”List all builds.
hs build lisths build list --status completedhs build list --limit 10hs build status <build-id>
Section titled “hs build status <build-id>”Get detailed build status.
hs build status 123hs build status 123 --watchhs build status 123 --jsonhs build logs <build-id>
Section titled “hs build logs <build-id>”View build logs.
hs build logs 123Deployment Commands
Section titled “Deployment Commands”hs deploy info <build-id>
Section titled “hs deploy info <build-id>”Show deployment information for a build.
hs deploy info 123hs deploy info 123 --jsonOutput includes:
- WebSocket URL:
wss://my-spec.stack.hypertek.app - Status, uptime, resource usage
hs deploy list
Section titled “hs deploy list”List all active deployments.
hs deploy lisths deploy list --limit 20hs deploy stop <deployment-id>
Section titled “hs deploy stop <deployment-id>”Stop a deployment.
hs deploy stop 123hs deploy rollback <spec-name>
Section titled “hs deploy rollback <spec-name>”Rollback to a previous deployment.
# Rollback to previous versionhs deploy rollback my-spec
# Rollback to specific versionhs deploy rollback my-spec --to 2
# Rollback to specific buildhs deploy rollback my-spec --build 123
# Rollback branch deploymenths deploy rollback my-spec --branch stagingOptions:
| Flag | Description |
|---|---|
--to <version> | Target version |
--build <id> | Target build ID |
--branch <name> | Branch to rollback |
--rebuild, -r | Force full rebuild |
--no-wait, -n | Don’t watch progress |
SDK Generation
Section titled “SDK Generation”hs sdk list
Section titled “hs sdk list”List specs available for SDK generation.
hs sdk lisths sdk create typescript <spec-name>
Section titled “hs sdk create typescript <spec-name>”Generate TypeScript SDK.
hs sdk create typescript my-spechs sdk create typescript my-spec --output ./src/generated/hs sdk create typescript my-spec --package-name @myorg/my-sdkConfiguration File
Section titled “Configuration File”File: hyperstack.toml
[project]name = "my-project"
# SDK generation settings[sdk]output_dir = "./generated"typescript_package = "@myorg/my-sdk"
# Build preferences[build]watch_by_default = true
# Spec definitions# Auto-discovered from .hyperstack/*.ast.json# Define explicitly for custom naming:[[specs]]name = "my-game"ast = "SettlementGame" # Entity name or path to .ast.jsondescription = "Settlement game tracking"
[[specs]]name = "token-tracker"ast = ".hyperstack/Token.ast.json"Build Process
Section titled “Build Process”Status Flow
Section titled “Status Flow”pending -> uploading -> queued -> building -> pushing -> deploying -> completed \-> failedBuild Phases
Section titled “Build Phases”| Phase | Description |
|---|---|
| SUBMITTED | Queued for processing |
| PROVISIONING | Starting build environment |
| DOWNLOAD_SOURCE | Preparing source |
| INSTALL | Installing dependencies |
| PRE_BUILD | Preparing build |
| BUILD | Compiling |
| POST_BUILD | Finalizing |
| UPLOAD_ARTIFACTS | Publishing image |
| FINALIZING | Deploying to runtime |
Typical Workflows
Section titled “Typical Workflows”First-Time Setup
Section titled “First-Time Setup”# Initialize projecths init
# Create account and loginhs auth register
# Validate configurationhs config validateDevelopment Cycle
Section titled “Development Cycle”# Make changes to spec, rebuild Rust cratecargo build
# Deployhs up my-spec
# Check statushs status
# View logs if issueshs logsBranch Deploys
Section titled “Branch Deploys”# Deploy feature branchhs up my-spec --branch feature-x# URL: my-spec-feature-x.stack.hypertek.app
# Check deploymenths deploy list
# Clean up when donehs deploy stop <deployment-id>Rollback
Section titled “Rollback”# Quick rollback to previous versionhs deploy rollback my-spec
# Rollback to specific versionhs deploy rollback my-spec --to 2Environment Variables
Section titled “Environment Variables”| Variable | Description |
|---|---|
HYPERSTACK_API_URL | Override API endpoint |
Error Reference
Section titled “Error Reference”| Error | Solution |
|---|---|
Not authenticated | Run hs auth login |
Spec not found | Check hs spec list for available specs |
AST file not found | Run cargo build to generate AST |
Build failed | Check hs build logs <id> for details |
Config invalid | Run hs config validate |
WebSocket URL Patterns
Section titled “WebSocket URL Patterns”After successful deployment:
| Type | Pattern |
|---|---|
| Production | wss://{spec-name}.stack.hypertek.app |
| Branch | wss://{spec-name}-{branch}.stack.hypertek.app |
| Local | ws://localhost:8080 |
Get the URL with:
hs deploy info <build-id>