Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.aspect.build/llms.txt

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

MODULE.aspect at your repo root declares external AXL module dependencies — analogous to MODULE.bazel for Bazel deps. Once declared, modules are loadable in any .axl file in the repo.

Declaring a dependency

Use axl_archive_dep to pull in a module from an archive URL:
MODULE.aspect
axl_archive_dep(
    name = "aspect_rules_lint",
    urls = ["https://github.com/aspect-build/rules_lint/archive/65525d871f677071877d3ea1ec096499ff7dd147.tar.gz"],
    integrity = "sha512-TGcxutWr8FwxrK3G+uthbEpuYM2oOVpHPOvaVPzLLuHkfPY0jn/GWFp9myQeFzDFsRZ4ilT0jAWfGZhTk/nesQ==",
    strip_prefix = "rules_lint-65525d871f677071877d3ea1ec096499ff7dd147",
    auto_use_tasks = True,
    dev = True,
)
Parameters:
ParameterDescription
nameThe module name used in load() statements as @name
urlsList of archive URLs (first reachable URL is used)
integritySHA-512 checksum in subresource integrity format for reproducibility
strip_prefixDirectory prefix to strip from the archive (usually repo-commitsha)
auto_use_tasksIf True, all tasks exported by the module are automatically registered as CLI commands — no explicit load() in your .axl files needed
devIf True, the module is only active during local development, not in CI environments that set ASPECT_DEV=false

Loading from a module

After declaring a dependency, use load() to import specific symbols:
.aspect/config.axl
load("@aspect_rules_lint//lint.axl", "LintTrait")

def config(ctx: ConfigContext):
    ctx.traits[LintTrait].aspects = ["//tools/lint:my_linter"]
load() path forms:
  • "@module_name//path/to/file.axl" — file inside a declared external module
  • "@aspect//traits.axl" — built-in Aspect library (always available, no declaration needed)
  • "./relative.axl" — relative to the current file
  • "path/from/repo/root.axl" — absolute from the workspace root (no leading ./)

Built-in @aspect library

The @aspect module is always available without a MODULE.aspect declaration. It exports the built-in traits, features, and utilities used throughout the config examples in these docs:
load("@aspect//traits.axl", "BazelTrait")
load("@aspect//feature/artifacts.axl", "ArtifactUpload")
load("@aspect//format.axl", "format")