aspect auth login on your machine, and with an ASPECT_API_TOKEN on CI. The one credential covers both:
An Aspect Enterprise deployment has its own sign-in, so
it takes its own login and its own token. See its
and
.
Your Aspect account
Sign up for free. The same account works across all Aspect products. The first user to sign up is the Account Owner. Anyone who joins the account after that needs an owner or admin to give them a role in Aspect settings. Installing or linking an App takes one of these:The role names above are the portal’s.
aspect github token --role takes the dotted
spellings: checks.read, checks.write, statuses.read, statuses.write, prs.read,
prs.write, issues.read, actions.read.On your machine
0600 file at ~/.aspect/credentials.json where no keyring is reachable. It renews itself in the background. Aspect Cloud local setup goes on from here: building with --remote, pointing vanilla bazel at the cache, and checking it worked.
aspect auth statusshows who you’re signed in as.aspect auth login --profile <name>keeps a second identity, such as a personal account, separate.aspect auth logoutremoves the stored credential.aspect auth login --with-tokenreads a JWT from stdin instead of opening a browser, and--with-api-tokenreads an API token the same way.aspect auth login --no-browserprints the URL instead of opening one — the path for an SSH session or a container.aspect auth login --org <org>picks the organization. Required non-interactively if your account belongs to more than one, since there is no prompt to answer.aspect auth status --output=jsonis the machine-readable surface. Each entry carries its ownlogin_command, so a script can tell you exactly what to run.aspect auth logout --allclears every profile at once.aspect auth configureandaspect auth useadd and select an Aspect Workflows deployment;aspect auth removeforgets one.
Generate an Aspect API token (for CI)
CI runners are non-interactive, so they authenticate with a long-lived token instead of a browser flow.1
Create the token
Open API tokens in the Aspect app and select Create token. Give it a Token name that identifies where it will be used (e.g.
ci-main), then select Create token.2
Copy the token
The app shows the token once. It authenticates as you in your current organization.The whole string is the value of
ASPECT_API_TOKEN.3
Provide the token to CI
Store
ASPECT_API_TOKEN as a secret in your CI platform and expose it to the runner. How you wire it in depends on the platform:Token roles and scopes
ASPECT_API_TOKEN doesn’t itself carry any VCS permissions. It authenticates to the Aspect API, and when a feature needs to call your VCS the Aspect API uses the linked App to make the call. Which scopes a feature can use is determined by the roles assigned to your token in the API Tokens portal, bounded by the App’s own permissions (so a feature can never receive more access than the App was granted at install time).
Roles are bundles of fine-grained permissions. Pick the smallest bundle that covers what your CI actually does, or pick the Integration User role for everything.
GitHub token roles and scopes
Write implies read: assigning a
*.write role automatically authorizes the matching *.read scope, so you don’t need to add both. metadata: read is always included on every token.GitLab token roles and scopes
Unlike the GitHub roles, GitLab token roles do not auto-imply each other. GitLab’s OAuth scope vocabulary is coarser than GitHub’s per-resource permission map, so role narrowing applies primarily as a permission gate; the minted token’s effective scope set is whatever the App was registered with for your role’s GitLab scope.
When a role is missing
If a feature needs a scope your token’s roles don’t cover, the Aspect API returns 403 and the feature logs an authentication failure. Add the missing role in the API Tokens portal and re-issue the token to enable the scope.Troubleshooting
A pull-request feature that can’t authenticate logs<feature>: Authentication failed for <owner>/<repo> — <reason>, for example GitHub status checks: Authentication failed for …. The reason names what’s missing (no token, no App installed or linked) and links to this page.
If PR comments, MR notes, or status checks aren’t appearing as expected, check the App installation and ASPECT_API_TOKEN first. See the GitHub App or GitLab App page for provider-specific symptoms.
Support
Hit a bug or have a feature request? Open an issue on aspect-build/aspect-cli. Join the Aspect Community Slack, Aspect’s free community support. Ask in#help for general support. Join the discussion and see what others are building with the Aspect CLI and Aspect Extension Language (AXL) in the #cli and #axl channels.
For Bazel and the Bazel rulesets, Bazel Slack is the best place for support and discussion. Ask about Aspect’s rules_js in #javascript and rules_py in #python.
