ap
CLI tool that builds the exact folder + zip structure Canvas wants for C assignment submissions.
Install
Cargo (any platform)
Homebrew (macOS/Linux)
Scoop (Windows)
scoop bucket add ap https://github.com/cat-forgor/AssignmentPacker
scoop install ap
Chocolatey (Windows)
choco install ap
WinGet (Windows)
winget install cat-forgor.ap
AUR (Arch Linux)
Debian/Ubuntu (.deb)
Download the .deb from releases:
Windows Installer (.msi)
Download ap-windows-x64.msi from releases and run it. Installs to Program Files and adds ap to your PATH automatically.
Pre-built binaries
Grab the latest binary from releases.
Windows: rename to ap.exe and add to your PATH.
Linux/macOS:
From source
Requires Rust 1.85+ (edition 2024):
Quick start
After ap init, you don't need to pass your id or name or auto-doc each time
Usage
# full command with auto-doc
# bring your own doc instead
# minimal (if you used ap init)
Flags
| Flag | Short | Description |
|---|---|---|
--assignment |
-a |
Assignment number or label (e.g. 7 or Assignment7) |
--name |
-n |
Student name |
--id |
-i |
Student ID |
--c-file |
-c |
Path to .c file (auto-detected if only one in cwd) |
--doc-file |
-d |
Path to an existing .doc file |
--auto-doc |
Generate .doc automatically |
|
--run-command |
Custom shell command to run the program | |
--theme |
-t |
Screenshot theme (default, light, dracula, monokai, solarized) |
--output-dir |
-o |
Output directory (defaults to .) |
--force |
-f |
Overwrite existing output |
Config
See ap config set --help for all options. Config values are used as defaults and can be overridden by flags.
You can set a preferred editor with ap config set --editor "code --wait". Otherwise it checks $VISUAL, $EDITOR, then probes for common editors in PATH.
Auto-doc
When --auto-doc is enabled, ap will:
- Find
gccorclangand compile your.cfile - Run the binary and capture stdout/stderr
- Render a terminal screenshot as a PNG
- Generate an RTF
.doccontaining your source code, the screenshot, and captured output
Pass --run-command if you need a custom compile/run step (e.g. --run-command "make && ./myprogram").
Themes
The screenshot in the generated doc uses a terminal-style theme. Built-in options:
default light dracula monokai solarized
You can also create custom themes as TOML files in ~/.config/assignment_packer/themes/:
# ~/.config/assignment_packer/themes/nord.toml
= "#2E3440"
= "#D8DEE9"
= 2 # 1-4
= 16 # max 64
= "JetBrainsMono-Regular.ttf" # in themes dir, or absolute path
= 16 # pixel height (8-72)
Then use it with --theme nord.
Notes
--forceoverwrites existing output folders and zips- All non-binary files in the current directory are copied into the submission folder
- If no
.docis provided and--auto-docis off, the submission is created without one (with a warning)