> ## Documentation Index
> Fetch the complete documentation index at: https://site.aspect.build/llms.txt
> Use this file to discover all available pages before exploring further.

# How to use external AXL modules

> Reuse AXL extension code across repositories with MODULE.aspect declarations, the Aspect CLI's external module system for Bazel-style dependencies.

`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:

```python title="MODULE.aspect" theme={null}
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:**

| Parameter        | Description                                                                                                                                         |
| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`           | The module name used in `load()` statements as `@name`                                                                                              |
| `urls`           | List of archive URLs (first reachable URL is used)                                                                                                  |
| `integrity`      | SHA-512 checksum in [subresource integrity format](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity) for reproducibility |
| `strip_prefix`   | Directory prefix to strip from the archive (usually `repo-commitsha`)                                                                               |
| `auto_use_tasks` | If `True`, all tasks exported by the module are automatically registered as CLI commands — no explicit `load()` in your `.axl` files needed         |
| `dev`            | If `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:

```python title=".aspect/config.axl" theme={null}
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:

```python theme={null}
load("@aspect//traits.axl", "BazelTrait")
load("@aspect//feature/artifacts.axl", "ArtifactUpload")
load("@aspect//format.axl", "format")
```
