Skip to content

Commands

Note: This is a user guide (informative). For normative requirements, see the Commands Specification.

Structyl provides a unified command interface that works across all programming languages.

Standard Commands

CommandPurposeExample
cleanRemove build artifactsstructyl clean rs
restoreInstall dependenciesstructyl restore py
buildBuild the projectstructyl build rs
build:releaseBuild with release optimizationsstructyl build:release rs
testRun testsstructyl test py
test:coverageRun tests with coverage (requires custom config)structyl test:coverage py
checkRun static analysis (lint, typecheck, format-check)structyl check go
check:fixAuto-fix static analysis issuesstructyl check:fix go
benchRun benchmarksstructyl bench go
demoRun demo codestructyl demo cs
docGenerate API docsstructyl doc rs
packCreate distributable packagestructyl pack ts
publishPublish package to registrystructyl publish ts
publish:dryDry-run publishstructyl publish:dry ts

Lint and Format Commands

Individual lint, format, and format-check commands are not part of the standard command vocabulary. Instead, toolchains implement these as part of check (for verification) and check:fix (for auto-correction). See Toolchains for specific mappings.

test:coverage

The test:coverage command requires a custom definition—no built-in toolchain provides a default implementation.

Running Commands

On a Single Target

bash
structyl <command> <target>

# Examples
structyl build rs
structyl test py
structyl clean go

On All Targets

bash
structyl <command>

# Examples
structyl build    # Build everything
structyl test     # Test all languages
structyl clean    # Clean everything

With Arguments

Pass arguments to the underlying command:

bash
structyl test py --verbose
structyl build rs --release

Use -- to separate Structyl flags from command arguments. Everything after -- is passed directly to the underlying command without being interpreted by Structyl:

bash
structyl --docker build cs -- --verbose --debug
# Structyl processes --docker, passes --verbose --debug to the build command

structyl build rs -- --help
# Shows help for the underlying build tool, not Structyl

Command Variants

Related commands use a colon (:) naming convention:

bash
structyl build rs           # Debug build
structyl build:release rs   # Release build

structyl test py            # All tests
structyl test:unit py       # Unit tests only

Define variants in configuration:

json
{
  "commands": {
    "build": "cargo build",
    "build:release": "cargo build --release",
    "test": "cargo test",
    "test:unit": "cargo test --lib"
  }
}

Meta Commands

Commands that operate on multiple targets:

CommandDescription
structyl buildBuild all targets (respects dependencies)
structyl testTest all language targets
structyl cleanClean all targets
structyl restoreRestore dependencies for all targets
structyl ciRun full CI pipeline
structyl versionVersion management (get, set, bump)

CI Pipeline

The ci command runs a complete build pipeline:

bash
structyl ci

Executes: cleanrestorecheckbuildtest

See CI Integration for details.

Utility Commands

CommandDescription
structyl initInitialize a new Structyl project
structyl newDeprecated: Alias for init
structyl targetsList configured targets
structyl release <version>Set version and release
structyl upgrade [version]Manage pinned CLI version (--check for status)
structyl config validateValidate configuration
structyl completion <shell>Generate shell completion (bash, zsh, fish)
structyl test-summaryParse and summarize go test -json output

release --force includes uncommitted changes

When --force is used with structyl release, all uncommitted changes in the working directory are staged and included in the release commit. Ensure uncommitted changes are intentional before using this flag.

Generation Commands

CommandDescription
structyl dockerfileGenerate Dockerfiles for targets
structyl githubGenerate GitHub Actions CI workflow
structyl mise syncRegenerate mise.toml from config

Docker Commands

CommandDescription
structyl docker-build [svc]Build Docker images for services
structyl docker-cleanRemove Docker containers and images

Defining Commands

From Toolchain

Specify a toolchain to get standard commands:

json
{
  "targets": {
    "rs": {
      "toolchain": "cargo"
    }
  }
}

Override Commands

Customize specific commands:

json
{
  "targets": {
    "cs": {
      "toolchain": "dotnet",
      "commands": {
        "test": "dotnet run --project MyLib.Tests"
      }
    }
  }
}

Explicit Commands

For targets without a toolchain:

json
{
  "targets": {
    "img": {
      "type": "auxiliary",
      "commands": {
        "build": "python scripts/generate.py",
        "clean": "rm -rf output/"
      }
    }
  }
}

Command Composition

Combine commands using arrays:

json
{
  "commands": {
    "check": ["lint", "format-check"],
    "ci": ["restore", "check", "build", "test"]
  }
}

Array elements execute sequentially.

Variables

Use variables in commands:

json
{
  "vars": {
    "test_project": "MyLib.Tests"
  },
  "commands": {
    "test": "dotnet run --project ${test_project}"
  }
}

Built-in variables:

  • ${target} - Target name
  • ${target_dir} - Target directory
  • ${root} - Project root
  • ${version} - Project version

Null Commands

Set a command to null to disable it:

json
{
  "commands": {
    "bench": null
  }
}

Running a null command succeeds with a warning.

Global Flags

FlagDescription
--dockerRun in Docker container
--no-dockerDisable Docker mode
--type=<type>Filter by target type (language or auxiliary)
-q, --quietMinimal output (errors only)
-v, --verboseMaximum detail
-h, --helpShow help message
--versionShow Structyl version

Docker Mode Precedence

--no-docker overrides --docker and STRUCTYL_DOCKER. See Commands Specification for full precedence rules.

Removed Flags (Migration)

The following flags have been removed:

FlagRemoved InAlternative
--continuev1.0.0Use continue_on_error: true in CI pipeline step definitions

Using removed flags produces an error.

Environment Variables

VariableDescriptionDefault
STRUCTYL_DOCKEREnable Docker mode (1, true, or yes)(unset)
STRUCTYL_PARALLELParallel workers (internal runner only)CPU count
NO_COLORDisable colored output (any non-empty value)(unset)

STRUCTYL_PARALLEL Limitation

When STRUCTYL_PARALLEL > 1, targets are scheduled in topological order but execution does not wait for dependencies to complete. Use STRUCTYL_PARALLEL=1 for strict dependency ordering. See Commands Specification for details.

Exit Codes

CodeMeaning
0Success
1Command failed
2Configuration error
3Environment error

Next Steps

© 2026 Andrey Akinshin MIT