CSERun is a utility tool designed to assist UNSW CSE students in running course commands such as autotest and give in their local environment.
Powered by Rust, it simplifies the process of executing course-specific commands directly from a local machine.
No more struggling with SSH or dealing with remote connections. Run your commands locally and get instant feedback.
Recommended installation method for macOS users. Install CSERun using Homebrew package manager:
brew tap xxxbrian/tap
brew install cserun
For Rust users, install CSERun directly using Cargo package manager:
cargo install cserun --git https://github.com/xxxbrian/cserun
After installation, navigate to the directory where you wish to run commands:
cd /path/to/your/work # The directory to run commands in
# Example: cd ~/COMP6991/lab01/exercise01
To run a command, use CSERun as follows:
cserun "your_command_here"
# Example: cserun "6991 autotest"
After the initial run, CSERun will prompt you to create and modify a TOML configuration file. This file contains essential settings for connecting to the CSE server, including server details and authentication method.
You can check your configuration file location with:
cserun --config
[server]
addr = "cse.unsw.edu.au" # Default server address, no need to change.
port = 22 # Default port, no need to change.
user = "z5555555" # Replace "z5555555" with your actual zID.
You must choose one of the three available authentication methods:
If you prefer using a password for authentication, uncomment and fill in the password field.
[auth]
type = "password"
password = "your_password" # Optional. Recommended to fill for convenience.
For those who use SSH keys, specify the path to your private key.
# [auth]
type = "key"
private_key_path = "/path/to/private/key" # Required for key authentication.
# public_key_path = "/path/to/public/key" # Optional.
# passphrase = "your_passphrase" # Optional.
Agent authentication is useful if you have an SSH agent running that manages your keys.
# [auth]
type = "agent"
To enhance file synchronization speed with the server, CSERun supports .gitignore
and .ignore
files. It will exclude files and directories specified in these files from syncing, which is particularly useful for ignoring project-generated directories like node_modules
and target
.
cserun [OPTIONS] <COMMAND>
--config
: Display the path of the configuration file--no-sync
: Skip the file synchronization step before running the command--env <KEY:VALUE>
: Set environment variables for the session-h, --help
: Display help information-V, --version
: Print the versionRun a command without syncing files and with environment variables set:
cserun --no-sync --env uni:unsw --env faculty:cse "echo \$uni; echo \$faculty"
Example output:
[1/5] 🌐 Connecting to cse.unsw.edu.au:22 [2/5] 🔗 Handshake successful [3/5] 🔒 Authenticated as z5555555 [4/5] 🚫 Skipped syncing local files [5/5] ✨ Environment variables set [5/5] 🚀 Command sented: echo $uni; echo $faculty =============== Output =============== unsw cse ====================================== Exit status: Success