BackConfiguration

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:

LocationHolds
~/.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 ingest

Everything 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:

.env
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

VariablePurpose
CANVAS_BASE_URLCanvas API address, used as is; include /api/v1
CANVAS_ACCESS_TOKENCanvas personal access token
CANVAS_CLI_PROFILEActive profile for the shell and ingest (default default)
AI_PROVIDERanthropic, openai, google, bedrock, copilot, or codex; see aliases
AI_MODELModel id for the provider
AI_EFFORTlow, medium, high, xhigh, or max
ANTHROPIC_API_KEYAnthropic key
OPENAI_API_KEYOpenAI key
GOOGLE_API_KEYGoogle AI Studio key
AWS_REGIONBedrock region
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEYBedrock credentials
AWS_SESSION_TOKEN, AWS_BEARER_TOKEN_BEDROCKTemporary or bearer-token Bedrock credentials
CODEX_HOMEWhere Codex keeps its model catalog (default ~/.codex)
COPILOT_GITHUB_TOKEN, GH_TOKEN, GITHUB_TOKENThe tokens the Copilot CLI signs in with. If any is set, canvas-cli reports Copilot as signed in
CANVAS_CLI_CREDENTIAL_BACKENDfile stores secrets in files instead of the macOS Keychain
XDG_CONFIG_HOMEMoves the config folder from ~/.config
DEBUG=canvas-cliSame as --debug (it must be exactly this value)

Precedence

When the same setting comes from more than one place, the first of these wins:

  1. An environment variable set in your shell
  2. The same variable in .env in the current folder
  3. What canvas-cli login or /model stored 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.

~/.config/canvas-cli/config.json
{
	"canvasBaseUrl": "https://school.instructure.com",
	"aiProvider": "anthropic",
	"aiModel": "claude-opus-5",
	"aiEffort": "high",
	"ingestSubmissionFeedback": true
}
KeyMeaning
canvasBaseUrlYour Canvas address, without /api/v1
aiProviderThe provider chosen at sign-in or with /model
aiModelThe model id
aiEffortThe effort level
awsRegionThe Bedrock region
ingestSubmissionFeedbackSet to false to skip your grader feedback during ingestion by default