Installation
Every way to install canvas-cli, how to update it, and how to remove it cleanly.
Requirements
| Install method | Platforms | Needs |
|---|---|---|
| Install script | macOS on Apple Silicon or Intel; Linux on x64 or arm64, glibc or musl (Alpine) | curl or wget |
| npm, bun, or pnpm | Anything Node.js runs on, including Windows | Node.js 20.10 or later |
Either way you also need a Canvas account and a personal access token, and optionally an AI provider. The Copilot and ChatGPT providers also need their own CLI, installed with npm. /pdf uses a LaTeX compiler (Tectonic, pdflatex, xelatex, or lualatex) for nicer output if you have one; if not, it asks each time whether to install Tectonic or use a basic layout.
Install Script
The recommended way on macOS and Linux. It installs a self-contained binary with no Node.js needed:
curl -fsSL https://raw.githubusercontent.com/reyabsaluja/canvas-cli/main/install.sh | bashIn order, the script:
- Works out your platform. An Intel shell running under Rosetta on Apple Silicon still gets the native arm64 build, and Alpine or other musl systems get the musl build.
- Downloads that binary and the release’s
SHA256SUMSfrom the latest GitHub release. - Refuses to continue if the checksum does not match.
- Runs the new binary once to make sure it starts on your system.
- Moves it into
~/.local/bin/canvas-cli, replacing any older copy in one step. - Tells you if
~/.local/binis not on yourPATH, with the exact line to add for zsh, bash, or fish, and warns if anothercanvas-cli(an npm install, say) would run instead.
The whole script is wrapped in a function, so a download cut off halfway runs nothing. You can read it before running it.
npm and Others
The same program is published to npm as @reyabsaluja/canvas-cli. Use this on Windows, or if you already manage command-line tools with a Node package manager.
npm install -g @reyabsaluja/canvas-clibun add -g @reyabsaluja/canvas-clipnpm add -g @reyabsaluja/canvas-clinpx @reyabsaluja/canvas-cliRuns the latest version once, without installing.
Verify
canvas-cli --versionThis prints the version, for example 0.1.0. To check your setup rather than the install, run canvas-cli status, which shows what is configured without contacting Canvas, or /doctor inside the shell, which does.
Update
canvas-cli does not update itself. To get the latest version, run the same command you installed with:
curl -fsSL https://raw.githubusercontent.com/reyabsaluja/canvas-cli/main/install.sh | bashnpm install -g @reyabsaluja/canvas-cli@latestbun add -g @reyabsaluja/canvas-cli@latestpnpm add -g @reyabsaluja/canvas-cli@latestYour credentials, course caches, and chat history are kept between versions. The changelog lists what changed.
Script Options
The script reads a version argument and three environment variables:
| Option | Effect |
|---|---|
bash -s -- 0.1.0 | Install a specific version instead of the latest (a leading v is fine). |
CANVAS_CLI_VERSION | Same as the version argument. |
CANVAS_CLI_INSTALL_DIR | Install somewhere other than ~/.local/bin. |
CANVAS_CLI_DOWNLOAD_URL | Fetch the binary and checksums from a mirror instead of GitHub. |
# A specific version
curl -fsSL https://raw.githubusercontent.com/reyabsaluja/canvas-cli/main/install.sh | bash -s -- 0.1.0
# Into ~/bin instead
curl -fsSL https://raw.githubusercontent.com/reyabsaluja/canvas-cli/main/install.sh | CANVAS_CLI_INSTALL_DIR="$HOME/bin" bashBinaries for every supported macOS and Linux target are also attached to each GitHub release if you would rather download one by hand. On macOS, a binary downloaded in a browser needs chmod +x and xattr -d com.apple.quarantine before its first run. Without curl, use wget -qO- https://raw.githubusercontent.com/reyabsaluja/canvas-cli/main/install.sh | bash.
How It’s Verified
Releases are built by GitHub Actions from a tagged commit. The same run publishes the npm package with provenance, which links the package on npm to the exact commit and workflow that built it, and attaches the binaries and their SHA-256 sums to the GitHub release. The install script checks the download against those sums before it installs anything. If your system has neither sha256sum nor shasum, it warns and skips the check.
The macOS binaries are ad-hoc signed. Files downloaded with curl are not quarantined, so macOS does not show an “unidentified developer” prompt.
Uninstall
Removing the program leaves your data alone. To remove your credentials, config, and the .canvas-cli folder in the current directory too, clean up first:
canvas-cli clean --allThen remove the program itself:
rm ~/.local/bin/canvas-clinpm uninstall -g @reyabsaluja/canvas-clibun remove -g @reyabsaluja/canvas-clipnpm remove -g @reyabsaluja/canvas-cliFrom Source
To run the latest code or contribute, clone the repository. Development uses Bun:
git clone https://github.com/reyabsaluja/canvas-cli.git
cd canvas-cli
bun install
bun run dev # run from source
bun run check # typecheck, build, and test
bun run build:binary # a standalone binary in dist-bin/The tests run on Node.js, so you need Node.js 20.10 or later as well. See CONTRIBUTING.md before opening a pull request.