# `struo.toml` Manifest

Struo uses `struo.toml` files for workspace configuration and typed graph
targets. The file at the workspace root owns settings shared by the whole
repository. Additional manifests declare targets for the package directory
that contains them.

Script execution metadata does not belong in a manifest. Annotated scripts
keep their contract in `# struo` headers described by
[Scripted Automation](/guide/scripted/).

## Discovery

By default, Struo discovers every `struo.toml` below the workspace root while
skipping hidden directories. The root manifest can limit that scan:

```toml
[workspace]
include = ["apps/*/struo.toml", "packages/*/struo.toml"]
exclude = ["packages/experimental/struo.toml"]
```

`include` and `exclude` contain workspace-relative glob patterns. They match
both `struo.toml` manifests and native project markers such as `Cargo.toml` and
`mix.exs`. An excluded path is always omitted. When `include` is empty, every
discovered manifest and native project is included unless `exclude` removes
it.

A directory exclusion also excludes its descendants: `exclude = ["Demos"]`
prunes the entire `Demos` subtree, without excluding a sibling named
`DemosOther`.

## Root-only Tables

These tables are read only from the root manifest:

| Table | Purpose |
| --- | --- |
| `[workspace]` | Limits manifest discovery with `include` and `exclude`. |
| `[workspace.configuration]` | Selects the target operating system, architecture, and additional configuration tokens. |
| `[reporting]` | Controls whether workspace names may appear in live run argument telemetry. |
| `[modules]` | Loads project target-kind modules from `paths`. |
| `[infrastructures.<name>]` | Declares a named infrastructure provider. |
| `[infrastructure.cache]` | Chooses the shared cache provider. |
| `[infrastructure.execution]` | Chooses the remote execution provider. |
| `[infrastructure.artifacts]` | Chooses the artifact publication provider. |
| `[local_cache]` | Caps the local cache on this machine with `max_size`. See below. |

Package manifests that declare `[modules]`, `[reporting]`, or `[local_cache]`
are rejected. Keep shared module
and infrastructure configuration at the workspace root so every package sees
the same definitions.

See [Modules](/reference/modules/) and [Infrastructure](/guide/infrastructure/)
for the contracts owned by those tables.

`[local_cache] max_size` sets the size the local cache is kept under. It takes
a byte count or a size such as `"50GB"` or `"8GiB"` (KB, MB, GB, and TB are
powers of 1000; KiB, MiB, GiB, and TiB are powers of 1024), and `0` turns
automatic cleanup off. A value that is not a size is rejected when the
manifest loads. It defaults to 20 GB, and the `STRUO_CACHE_MAX_SIZE`
environment variable overrides it:

```toml
[local_cache]
max_size = "50GB"
```

The local cache is shared by every workspace on the machine. When workspaces
set different values, the cleanup applies the value of the workspace whose
command started it, so prefer `STRUO_CACHE_MAX_SIZE` when one machine works
on several workspaces with different needs. See
[Keep the local cache bounded](/guide/scripted/caching#keep-the-local-cache-bounded).

Argument values are hashed by default. To allow names declared in the workspace
graph to appear as readable values in live run telemetry, opt in explicitly:

```toml
[reporting]
argv_privacy = "workspace"
```

Use `argv_privacy = "strict"` to keep the default. This setting does not make
arbitrary command arguments readable.

The target configuration defaults to the host. Set it explicitly when
analysis and dependency selection should describe another platform:

```toml
[workspace.configuration]
os = "linux"
arch = "arm64"
tokens = ["release"]
```

Struo normalizes common operating system and architecture names. For example,
`darwin` becomes `macos`, `arm64` becomes `aarch64`, and `amd64` becomes
`x86_64`. The ordered selection tokens include the most specific
operating-system and architecture combinations, their aliases, the individual
values, the additional `tokens`, and `default`. Use `struo query workspace` to
inspect the exact configuration seen by target kinds.

`struo build`, `struo lint`, `struo run`, and `struo test` accept `--config`
overrides that layer on top of these workspace defaults for a single
invocation. See the [configurations guide](/guide/graph/configuration) for
the override model, precedence, and how outputs stay separated.

An execution-only provider can select a sandbox adapter and immutable tool
environment:

```toml
[infrastructures.remote_tests]
kind = "microsandbox"
image = "node:22.18.0-alpine"

[infrastructure.execution]
provider = "remote_tests"
```

The provider name is a workspace policy label. Script headers and command-line
options can select it without coupling the script to Microsandbox.

Hosted execution providers select their immutable environment with a template
or image:

```toml
[infrastructures.e2b_tests]
kind = "e2b"
template = "vitest-node-22"

[infrastructures.daytona_tests]
kind = "daytona"
image = "node:22.18.0-bookworm"

[infrastructures.boat_tests]
kind = "boat"
snapshot = "node-tests-v1"

[infrastructures.langsmith_tests]
kind = "langsmith"
snapshot = "node-tests:v1"

[infrastructures.together_tests]
kind = "together"
snapshot = "<snapshot-id>"

[infrastructures.northflank_tests]
kind = "northflank"
image = "node:22.18.0-bookworm"
deployment_plan = "nf-compute-200"

[infrastructures.self_hosted]
kind = "opensandbox"
image = "node:22.18.0-bookworm"

[infrastructures.vercel_tests]
kind = "vercel"
runtime = "node24"

[infrastructures.runloop_tests]
kind = "runloop"
blueprint = "bpt_your_node_blueprint"

[infrastructures.blaxel_tests]
kind = "blaxel"
image = "blaxel/base-image:latest"
```

Northflank also requires a `project` in the execution binding. For team-scoped
tokens, set `account` to the team ID. See [Northflank execution](/guide/infrastructure/northflank).

Docker execution requires an already available, full immutable image ID in
`image`, not a tag. See [Docker execution](/guide/infrastructure/docker) for
image preparation and coordinator requirements.

Together requires an existing snapshot ID and organization sandbox access. See
[Together Code Sandbox](/guide/infrastructure/together) for setup and lifecycle.

Sprites uses its standard hosted environment without an image or template:

```toml
[infrastructures.sprite_tests]
kind = "sprites"
```

See [Sprites](/guide/infrastructure/sprites) for credentials and disposal.

Tensorlake requires a prepared image or snapshot and the API key's namespace:

```toml
[infrastructures.tensorlake_tests]
kind = "tensorlake"
image = "node-tests-v1" # Or snapshot = "snapshot-id", not both.
namespace = "your-project-namespace"
```

See [Tensorlake](/guide/infrastructure/tensorlake) for prerequisites and cleanup.

LangSmith requires a prepared v2 snapshot and an explicit workspace UUID in the
environment. See [LangSmith Sandboxes](/guide/infrastructure/langsmith) for
credentials, trusted sandbox origins, and cleanup.

Boat uses a saved snapshot rather than an OCI image. See
[Boat execution](/guide/infrastructure/boat) for snapshot preparation and cleanup.

Vercel selects a provider-managed runtime rather than an immutable image. See
[Vercel Sandbox](/guide/infrastructure/vercel) for authentication and team/project scope.

Runloop requires a Blueprint ID in `blueprint`. See
[Runloop Devboxes](/guide/infrastructure/runloop) for authentication and lifecycle details.

Blaxel requires a prepared image and workspace credentials. Its execution
binding must include `properties.workspace`; the CLI resolves it from
`STRUO_BLAXEL_WORKSPACE` or `BL_WORKSPACE` when not explicitly configured.
The workspace participates in action cache identity. See
[Blaxel](/guide/infrastructure/blaxel) for setup and cleanup.

Docker, E2B, Daytona, Blaxel, Boat, LangSmith, Together, Northflank, Sprites, Tensorlake,
OpenSandbox, Vercel Sandbox, Runloop, and Microsandbox provide execution only.
Tuist provides execution and shared caching. Bind each capability independently
when a workspace uses both.

## Targets

The root manifest and package manifests can declare one or more targets:

```toml
[[target]]
name = "hello"
kind = "rust_binary"
srcs = ["src/**/*.rs"]
deps = ["../greeting/greeting"]

[target.attrs]
crate_root = "src/main.rs"
edition = "2024"
```

Every target accepts these common fields:

| Field | Required | Meaning |
| --- | --- | --- |
| `name` | yes | Name unique within the package. |
| `kind` | yes | Target kind that defines attributes, dependencies, providers, and capabilities. |
| `srcs` | no | Package-relative source paths or glob patterns. Paths starting with `.struo/` refer to runtime state at the workspace root. |
| `deps` | no | Target identifiers consumed by this target. |
| `dependencies` | no | Named dependency roles declared by the target kind. Each role contains target identifiers and validates its own provider contract. |
| `visibility` | no | Consumers allowed to depend on this target. An empty list is public. |
| `attrs` | no | Target-kind-specific values validated against the selected schema. |

Unknown manifest fields are rejected. Use
[`struo query schema <kind>`](/reference/cli/query/schema) to inspect the
attributes and dependency contracts accepted by a target kind.

Use `deps` for the target kind's default dependency role. Use
`[target.dependencies]` when the schema exposes more precise roles:

```toml
[[target]]
name = "app"
kind = "rust_binary"
deps = ["./library"]

[target.dependencies]
proc_macro_deps = ["./derive"]
link_deps = ["./native"]
```

Validation checks each role against its matching schema entry. Analysis keeps
`deps` in declared order and exposes the other roles separately, so a target
kind can distinguish compiler plug-ins, runtime-only dependencies, native
links, and other semantics without hardcoding them in Struo.
Target kinds can also set minimum and maximum counts for each role. Validation
reports an attribute-scoped repair before an edit can commit too few or too
many dependencies.

## Target Identifiers

A target identifier combines its package path and target name. A target named
`hello` in `apps/hello/struo.toml` has the identifier `apps/hello/hello`. A
target in the root manifest uses its name directly.

Dependency references resolve as follows:

- `packages/logging/logging` is relative to the workspace root.
- `./support` is relative to the package containing the current manifest.
- `../shared/shared` moves from the current package to a sibling package.

Use one of these identifiers with `struo query target`, `struo build`, `struo
run`, and `struo test`.

Target-valued entries under `[target.attrs]` use the same normalization rules.
`struo query validate-workspace` checks that these references resolve to a
declared target.

## Visibility

Targets are public unless `visibility` restricts them:

```toml
[[target]]
name = "Core"
kind = "rust_library"
visibility = ["package:apps/client", "subtree:tools", "tests/CoreTests"]
```

Each entry grants access to one class of consumer:

- `public` grants access to every target.
- `private` grants access to targets in the same package.
- `package:apps/client` grants access to targets in that exact package.
- `subtree:tools` grants access to targets in `tools` and its child packages.
- `tests/CoreTests` grants access to one exact target.

Exact targets use the same workspace-relative and package-relative
normalization as dependencies. Complete-workspace validation returns
`invalid_visibility` for malformed entries and `dependency_not_visible` when a
dependency edge crosses the declared boundary.

## Conditional Values

Target kinds can accept `select` values for configurable attributes. A target
can also select dependencies for the workspace target configuration:

```toml
[target.deps.select]
macos = ["./apple_support"]
linux = ["./linux_support"]
default = ["./portable_support"]
```

The target-kind schema reports both `configurable` and `implemented` for every
attribute. Validation rejects `select` on a non-configurable attribute and
rejects an unavailable compatibility attribute marked `implemented = false`.
Schemas can also report `allowed_values` for string attributes. Validation
rejects other values with the target, attribute, and accepted replacements.
Schemas can report `disallowed_values` when only a small reserved set should
be rejected. Validation ignores surrounding whitespace for those comparisons
and reports an attribute-scoped replacement before analysis.
Generic target kinds use the tokens returned by `struo query workspace`.
Ecosystem target kinds can add their own tokens and restrictions.

## Inspect

Use the graph before running work:

```sh
struo query targets
struo query target apps/hello/hello
struo query schema rust_binary
```

These commands show resolved target identifiers, selected target kinds,
dependencies, capabilities, and accepted attributes.
