BackGetting started

Installation

Every way to install canvas-cli, how to update it, and how to remove it cleanly.

Requirements

Install methodPlatformsNeeds
Install scriptmacOS on Apple Silicon or Intel; Linux on x64 or arm64, glibc or musl (Alpine)curl or wget
npm, bun, or pnpmAnything Node.js runs on, including WindowsNode.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 | bash

In order, the script:

  1. 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.
  2. Downloads that binary and the release’s SHA256SUMS from the latest GitHub release.
  3. Refuses to continue if the checksum does not match.
  4. Runs the new binary once to make sure it starts on your system.
  5. Moves it into ~/.local/bin/canvas-cli, replacing any older copy in one step.
  6. Tells you if ~/.local/bin is not on your PATH, with the exact line to add for zsh, bash, or fish, and warns if another canvas-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-cli

Verify

canvas-cli --version

This 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 | bash

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

OptionEffect
bash -s -- 0.1.0Install a specific version instead of the latest (a leading v is fine).
CANVAS_CLI_VERSIONSame as the version argument.
CANVAS_CLI_INSTALL_DIRInstall somewhere other than ~/.local/bin.
CANVAS_CLI_DOWNLOAD_URLFetch 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" bash

Binaries 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 --all

Then remove the program itself:

rm ~/.local/bin/canvas-cli

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