canvas-sync

Crates.iocanvas-sync
lib.rscanvas-sync
version0.4.7
sourcesrc
created_at2023-01-13 02:06:55.185675
updated_at2023-01-20 04:50:55.217277
descriptionA barebones CLI tool that keeps local folders up-to-date with online folders on Canvas.
homepagehttps://github.com/nguyenvukhang/canvas-sync
repositoryhttps://github.com/nguyenvukhang/canvas-sync
max_upload_size
id757551
size368,272
Khang (nguyenvukhang)

documentation

https://github.com/nguyenvukhang/canvas-sync

README

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

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

  3. 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:

canvas-demo

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
Commit count: 194

cargo fmt