---
title: Target
order: 4
description: "A named operation (build, test, ...) you invoke with magus run <target>; it may compose a spell's tool-native operations and depend on other targets."
tags: [glossary, core-model]
---

# Target

A named operation (`build`, `test`, ...) you invoke with `magus run <target>`; it
may compose a spell's tool-native operations and depend on other targets.

## Elsewhere

In Make a target is a file or a phony rule name; in Bazel it is a labeled rule instance
(`//pkg:name`); a compiler's target is the platform it emits code for. A magus target is
always a named operation of one project, and `magus run <target> <project>` is how it runs.

## Example

```sh
magus run test libs/xdg
```

## Used in

<!-- BEGIN GLOSSARY USAGE (generated by glossary-usage-generate from the knowledge graph; edit the generator, not this list) -->

In the docs:

- [Files a target edits rather than produces](../concepts/cache.md#files-a-target-edits-rather-than-produces)
- [Re-running a target whose inputs have not moved](../concepts/cache/output-refs.md#re-running-a-target-whose-inputs-have-not-moved)
- [Charm vs target: the command boundary](../concepts/charms.md#charm-vs-target-the-command-boundary)
- [B. A repository-local target (the prototype)](../decisions/0003-running-an-invocation-on-another-operating-system.md#b-a-repository-local-target-the-prototype)
- [A spell exports fun op(target: Target, req: Req) > Resp](../decisions/0011-typed-provider-calls.md#a-spell-exports-fun-optarget-target-req-req--resp)
- [5. Compose a ci target and run only what changed](../guides/getting-started.md#5-compose-a-ci-target-and-run-only-what-changed)

In the code (`magus refs <name>` lists every site):

- `dry.Target` (Go)
- `interp.Target` (Go)
- `types.Target` (Go)

<!-- END GLOSSARY USAGE -->

## See also

- [Op](op.md)
- [Magusfile](magusfile.md)
- [Targets](../concepts/targets.md)
