~shreyasminocha/codeskulptor-cli

Unofficial CLI for CodeSkulptor.org
8b3f1895 — Shreyas Minocha 6 months ago
Update installation instructions
d330c18d — Shreyas Minocha 9 months ago
Update bucket, policy, and signature
7367d38d — Shreyas Minocha 1 year, 3 months ago
Rework the command-line interface

refs

main
browse  log 

clone

read-only
https://git.sr.ht/~shreyasminocha/codeskulptor-cli
read/write
git@git.sr.ht:~shreyasminocha/codeskulptor-cli

You can also use your local clone with git send-email.

#CodeSkulptor CLI

Unofficial command-line interface for CodeSkulptor.

#Features

  • Downloading user-created files
  • Downloading instructor-created files (comp140, examples140, …)
  • Uploading to random URIs (similar to the web interface)
  • Uploading to vanity URIs ✨✨

#Installation

git clone https://git.sr.ht/~shreyasminocha/codeskulptor-cli
cd codeskulptor-cli
sudo install ./bin/csk /usr/local/bin/csk
sudo install ./csk.1 /usr/local/share/man/man1/csk.1 # optionally install man page

Uninstall:

sudo rm /usr/local/bin/csk
sudo rm /usr/local/share/man/man1/csk.1

#Usage

USAGE
    csk SUBCOMMAND ARGS

SUBCOMMANDS
    u | upload		Upload files to CodeSkulptor

        `csk upload FILE [NAME]`

        The file will be uploaded to CodeSkulptor.
        If NAME is not specified, a randomly generated string will be used.
        A CodeSkulptor URL will be outputted to STDOUT.

    d | download	Download files from CodeSkulptor

        `csk download REMOTE_FILE [LOCAL_FILE]`

        The file will be downloaded and saved to LOCAL_FILE.
        If LOCAL_FILE is not specified, the file will be saved to a file with
        the same name as the remote file.

Run csk --help for details.

#Examples

# Download user306_U0CqjtUA8X_0.py
csk download user306_U0CqjtUA8X_0.py

# Download user306_U0CqjtUA8X_0.py to file.py
csk download user306_U0CqjtUA8X_0.py file.py

# Output user306_U0CqjtUA8X_0.py to STDOUT
csk download user306_U0CqjtUA8X_0.py - | less

# Upload example.py to a random URL
csk upload example.py

# Upload example.py to user306_example.py
csk upload example.py example

# Upload example.py to user306_example_7.py
csk upload example.py example_7

# Upload from STDIN to a random URL
pbpaste | csk upload -

#Development

The man page is generated using txt2man:

./bin/csk --help | txt2man -t 'CodeSkulptor CLI' -s 1 > csk.1

#License

MIT License