Profiles and settings
Where canvas-cli keeps credentials and config, how profiles separate accounts, and the environment variables it reads.
Where Things Live
canvas-cli keeps two kinds of state in two places:
| Location | Holds |
|---|---|
~/.config/canvas-cli/ | Your sign-in: the Canvas address, AI provider settings, and (outside the macOS Keychain) your secrets. One set per profile. |
.canvas-cli/ | In whatever folder you run canvas-cli from: course caches, workspaces, conversations, exports, and your course list. See Local files. |
Set XDG_CONFIG_HOME to move the first one; it becomes $XDG_CONFIG_HOME/canvas-cli. The folder is readable only by you, and so is every file in it.
Credentials
canvas-cli login stores your Canvas token and any AI keys once, so you never paste them again. Where they go depends on your system:
- macOS: the login Keychain, under the service
canvas-cli, one item per profile and secret. No plaintext copy is written, and any old one is removed. - Linux and Windows, or when the Keychain is unavailable: files under
~/.config/canvas-cli/credentials/, readable only by you.
Setting CANVAS_CLI_CREDENTIAL_BACKEND=file forces the file store on macOS too, which is mainly useful in tests and CI. canvas-cli status tells you which store is in use. Subscription providers store nothing: their login belongs to the vendor’s own CLI.
Profiles
Profiles keep separate Canvas accounts apart, for example your university and a summer program. Each has its own Canvas address, token, and AI settings.
canvas-cli login --profile summer # set one up
canvas-cli status --profile summer # check it
export CANVAS_CLI_PROFILE=summer # use it for the shell and ingestEverything uses CANVAS_CLI_PROFILE, or default if it is unset. login, logout, and status also take --profile to name one directly. Profile names can use letters, numbers, hyphens, and underscores.
Running login again on an existing profile only replaces what the wizard asks about; other saved settings are kept.
.env Files
Everything login stores can also come from environment variables, or from a .env file in the folder you run canvas-cli from. That suits shared machines and scripts, where you would rather not store anything:
CANVAS_BASE_URL=https://school.instructure.com/api/v1
CANVAS_ACCESS_TOKEN=12345~abcdef...
AI_PROVIDER=anthropic
ANTHROPIC_API_KEY=sk-ant-...Keep .env out of version control. A real environment variable always wins over the same one in .env.
Variables
| Variable | Purpose |
|---|---|
CANVAS_BASE_URL | Canvas API address, used as is; include /api/v1 |
CANVAS_ACCESS_TOKEN | Canvas personal access token |
CANVAS_CLI_PROFILE | Active profile for the shell and ingest (default default) |
AI_PROVIDER | anthropic, openai, google, bedrock, copilot, or codex; see aliases |
AI_MODEL | Model id for the provider |
AI_EFFORT | low, medium, high, xhigh, or max |
ANTHROPIC_API_KEY | Anthropic key |
OPENAI_API_KEY | OpenAI key |
GOOGLE_API_KEY | Google AI Studio key |
AWS_REGION | Bedrock region |
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY | Bedrock credentials |
AWS_SESSION_TOKEN, AWS_BEARER_TOKEN_BEDROCK | Temporary or bearer-token Bedrock credentials |
CODEX_HOME | Where Codex keeps its model catalog (default ~/.codex) |
COPILOT_GITHUB_TOKEN, GH_TOKEN, GITHUB_TOKEN | The tokens the Copilot CLI signs in with. If any is set, canvas-cli reports Copilot as signed in |
CANVAS_CLI_CREDENTIAL_BACKEND | file stores secrets in files instead of the macOS Keychain |
XDG_CONFIG_HOME | Moves the config folder from ~/.config |
DEBUG=canvas-cli | Same as --debug (it must be exactly this value) |
Precedence
When the same setting comes from more than one place, the first of these wins:
- An environment variable set in your shell
- The same variable in
.envin the current folder - What
canvas-cli loginor/modelstored for the active profile
Each setting is resolved on its own. If you set AI_PROVIDER in the environment to something other than your saved provider, set AI_MODEL too, or the saved model is sent to the new provider. And because /model saves to config.json, a variable in your shell or .env overrides it the next time you start canvas-cli.
canvas-cli status shows the Canvas address, whether a token is set, and where it is stored, without contacting Canvas. Its AI line shows the provider saved in config.json, even when AI_PROVIDER overrides it. /doctor in the shell checks what is actually in effect, and whether it works.
config.json
Each profile’s settings are a small JSON file: config.json for the default profile, config.<profile>.json for others. login and /model write it, and you can edit it by hand. Running login again rewrites the whole file, so set ingestSubmissionFeedback again afterwards if you had changed it.
{
"canvasBaseUrl": "https://school.instructure.com",
"aiProvider": "anthropic",
"aiModel": "claude-opus-5",
"aiEffort": "high",
"ingestSubmissionFeedback": true
}| Key | Meaning |
|---|---|
canvasBaseUrl | Your Canvas address, without /api/v1 |
aiProvider | The provider chosen at sign-in or with /model |
aiModel | The model id |
aiEffort | The effort level |
awsRegion | The Bedrock region |
ingestSubmissionFeedback | Set to false to skip your grader feedback during ingestion by default |