Bazel Label Resolver

Type a Bazel label or target pattern the way you would after bazel build, and see the repository, package and target it really names.

Examples: //my/app:app, //my/app/..., :lib, tools/parser, @rules_go//go:def.bzl, -//legacy/.... The working directory only matters for patterns that do not start with // or @.

Resolves to
—
Enter a label or target pattern above.
What the label names
Form
Repository
Package
Target
Matches
Targets tagged manual
Equivalent command
—

A label is read the way Bazel's label documentation defines it. The repository part is optional: @name// is an apparent repository, @@name// a canonical one, and @@// always means the main repository, even from an external one. The package is the path between // and the first colon, and the target is what follows. With no colon the last path segment becomes the target, so //my/app means //my/app:app, never the package my/app; the same shorthand turns //foo/bar/wiz into //foo/bar/wiz:wiz even when no such package exists. A target may contain slashes for files in subdirectories, but its path must be in normal form; package names may not contain a colon or a tilde, a double slash, or . and .. segments, and non-ASCII characters are allowed only in target names.

On a command line, :all matches rule targets while :* and :all-targets also match files and implicit outputs such as _deploy.jar; ... matches packages beneath a directory, and //... stops at the main repository's boundary. Targets tagged manual are left out of wildcard builds and tests, but bazel query does not filter them. A leading - subtracts a pattern from the ones before it, needs -- before it on the command line, and does not stop a subtracted target being built as a dependency. Relative patterns are resolved against the working directory rather than the workspace root. A relative path with a slash and no colon is genuinely ambiguous — only the BUILD files decide — so the page lists the three spellings instead of guessing. Everything is computed in your browser; nothing is sent anywhere else.