Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/hypertekorg/hyperstack/llms.txt

Use this file to discover all available pages before exploring further.

hs init

Initialize a Hyperstack project by creating a hyperstack.toml configuration file. The command auto-detects .stack files in your project directory.

Usage

hs init [OPTIONS]

Description

The init command:
  1. Scans the current directory for .stack files
  2. Creates a hyperstack.toml configuration file
  3. Registers each stack with default settings
  4. Sets up SDK generation configuration (optional)
Use this when you have existing stack files and need to set up the CLI configuration.

Options

--config
string
default:"hyperstack.toml"
Path to the configuration file to create
--verbose
boolean
Show detailed output during initialization

Examples

Basic Initialization

hs init
Scans for .stack files and creates hyperstack.toml:
Scanning for stack files...
Found 2 stacks:
  - stacks/nft-indexer.stack
  - stacks/token-tracker.stack

Created hyperstack.toml with 2 stacks

Custom Configuration Path

hs init --config my-config.toml

Generated Configuration

A typical generated hyperstack.toml:
hyperstack.toml
# Auto-generated by hs init

[[stack]]
name = "nft-indexer"
ast_file = "stacks/nft-indexer.stack"

[[stack]]
name = "token-tracker"
ast_file = "stacks/token-tracker.stack"

# SDK generation settings (optional)
[sdk.typescript]
output = "./sdk/typescript"
package_name = "@my-org/my-stack-sdk"

[sdk.rust]
output = "./sdk/rust"
crate_name = "my_stack_sdk"

Interactive Configuration

After scanning for stacks, you may be prompted to configure:
  • Stack names (defaults to filename without extension)
  • SDK output directories
  • Package/crate names for generated SDKs

Stack Detection

The command searches for files matching:
  • **/*.stack - Stack definition files
  • Excludes: node_modules/, target/, .git/

Validation

After creating the configuration, validate it:
hs config validate
This checks:
  • TOML syntax is valid
  • All referenced .stack files exist
  • Stack names are unique
  • Output paths are writable

Error Handling

No Stack Files Found

Error: No .stack files found in current directory
Solution: Create a stack file first, or use hs create to start from a template.

Configuration Already Exists

Error: hyperstack.toml already exists
Solution: Delete the existing file or use --config to specify a different path.

Workflow

Typical workflow after hs init:
# 1. Initialize configuration
hs init

# 2. Validate configuration
hs config validate

# 3. Authenticate
hs auth login

# 4. Deploy stacks
hs up

Manual Configuration

Instead of using hs init, you can manually create hyperstack.toml:
hyperstack.toml
[[stack]]
name = "my-stack"
ast_file = "stacks/my-stack.stack"

[sdk.typescript]
output = "./sdk/typescript"
package_name = "@my-org/my-stack-sdk"
url = "wss://my-stack.stack.usehyperstack.com"
See Configuration Reference for all available options.

Return Codes

  • 0 - Success
  • 1 - Error (no stacks found, file I/O error, etc.)

Next Steps

Build docs developers (and LLMs) love