Setup
Register the provider next to your cloud’s:
import * as GitHub from "alchemy/GitHub";
providers: Layer.mergeAll(Cloudflare.providers(), GitHub.providers()),The next alchemy login adds a GitHub step with three options:
ghCLI — shells out togh auth token(recommended).- Environment variables — reads
GITHUB_ACCESS_TOKEN, falling back toGITHUB_TOKEN(good for CI). - Stored PAT — a personal access token entered interactively,
saved under
~/.alchemy/credentials/<profile>/.
When CI=true, the login step skips the prompt and selects the
environment-variables method automatically.
See Profiles for how credentials are stored and switched.
Token scopes
Section titled “Token scopes”repo— always required.workflow— when you manage Actions secrets and variables.delete_repo— only when you opt a repository into deletion viadestroy(). Repositories default to retain on removal, so most tokens never need it.
Programmatic credentials
Section titled “Programmatic credentials”Skip profiles entirely by building the credentials layer from a token you already have in hand — useful in tests:
Effect.provide(GitHub.fromToken(token))fromToken accepts a plain string or a Redacted value. To read from
the environment instead, GitHub.fromEnv() builds the same layer from
GITHUB_ACCESS_TOKEN or GITHUB_TOKEN.
Next steps
Section titled “Next steps”- GitHub overview — resources and compositions.