13 unstable releases (3 breaking)
0.4.7 | Jan 20, 2023 |
---|---|
0.4.6 | Jan 20, 2023 |
0.3.0 | Jan 16, 2023 |
0.2.0 | Jan 15, 2023 |
0.1.3 |
|
#1710 in Command line utilities
130KB
1K
SLoC
Contains (Mach-o exe, 40KB) .experiments/cpp/canvas-sync
canvas-sync
A barebones CLI tool that keeps local folders up-to-date with online folders on Canvas.
Install
Installing canvas-sync
currently requires an installation of
cargo
. To install cargo, follow these awesome
instructions. Once you have cargo installed, you can
now install canvas-sync
with
cargo install canvas-sync
Configuration
Depending on your operating system, canvas-sync
chooses a different
default configuration file location. To find out this location, run
canvas-sync config
If it doesn't exist, then create it and fill it in with this template:
---
access_token: a_very_secret_value
base_path: /path/to/your/base # optional
folders:
- url: https://canvas.nus.edu.sg/courses/12345/files/folder/Lecture%20Notes
path: MA2101/lec
- url: https://canvas.nus.edu.sg/courses/98765/files/folder/Tutorials
path: MA2104/tut
-
access_token
- this is what authenticates into canvas instead of a username and password. This can be found at your canvas profile settings and looking around for the 'token' keyword. Generate a fresh one and make sure to save the token string to a safe location. -
base_path
- this is an optional parameter that will pre-pend all other paths in your config. Leave this out of your config if you want greater freedom in specifying each path. Otherwise, it's a nice way to shorten all your other paths. -
folders
- this is an array of{ url, path }
objects.url
points to the folder on canvas that you want to track.path
points to the local directory on your computer that you want to be synced with that folder online.
Specifying urls
In each { url, path }
object, is the page that each url should point to:
path
will then track the contents of this folder.
Usage
Once you have specified your configuration, there
are a few commands that canvas-sync
supports:
canvas-sync # ping canvas servers to check if token is valid
canvas-sync fetch # fetch updates without downloading
canvas-sync pull # fetch and download updates
canvas-sync config # see where your config.yml is stored.
canvas-sync set-token <token> # set your token
Dependencies
~13–26MB
~375K SLoC