This repository is currently being one-way mirrored on GitHub to provide automated releases.
Current MVP version: 0.1.4
Some features are still missing, but the core functionality is there.
sbcli is a command line interface for the SmartBeans1 application.
- The CLI currently only works with the production API, not the local dev server. This is because the production API is slightly different from the dev server. A solution for this is wip.
- The CLI currently only works with password authentication. Token authentication is wip.
- The CLI currently only allows submitting exercises that are in a workspace (i.e. in the directory that has been created by
sbcli sync). - On Windows,
sbcli loginapparently doesn't work when using git bash. Powershell 7 andcmdwork fine, though.
We have releases for Linux, Windows and MacOS. You can find them here.
You can easily install the latest release of sbcli using the provided installation script. Run the following command in your terminal to download and execute the script:
curl -sSL https://raw.githubusercontent.com/KVNU/sbcli/main/install.sh | bashor, if you don't have curl installed:
wget -qO- https://raw.githubusercontent.com/KVNU/sbcli/main/install.sh | bashThe script will automatically detect your platform and try to install the latest release.
Please note that moving the binary to your PATH may require administrative privileges on some systems. If you encounter permission issues, try running the script with administrative privileges or manually move the binary to a directory in your PATH.
You'll also need either jq or grep installed.
OpenSSL is required for the reqwest crate, which we use for HTTP requests. See here for more information.
cargo build --release
cargo install --path <project_dir>
A SmartBeans account which has password authentication enabled. Token login is wip.
The CLI is organized into subcommands. To see a list of available subcommands, run sbcli --help.
You'll need to configure the CLI before you can use it.
Run:
sbcli config -u USERNAME -c COURSE --host HOSTwith all required arguments to do so.
If you're not logged in, it'll ask if you want to do so. You can run sbcli login to log in at any time.
Then you'll want to run sbcli sync to download the exercise directory from SmartBeans, if you haven't done so during configuration. This will create a directory called tasks at <home_dir>/sbcli. You can change this by setting the SBCLI_EXERCISE_DIR environment variable(wip).
Next, you can run sbcli start to start a new exercise. By default, this will open the next exercise in order using your default editor. If you want to work on a specific exercise, you can run sbcli list to see a list of all exercises and their current status. Then you can run sbcli start TASK_ID to start working on that exercise.
Once you're done, you can run sbcli submit PATH_TO_SOLUTION to submit your solution to SmartBeans. Please note that you can only submit files that are in a workspace, i.e. in the directory that has been created by sbcli sync.
It's currently not possible to submit files are not in a workspace.
- Allow users to authenticate on the command line
- Allow login via username/password or OAuth/LTI
- Allow login via a long-lived session token generated by an API call or via the SmartBeans interface. This would eliminate the need to setup a password for the CLI.
- Facilitate a user's ability to interact with the SmartBeans applications exercise directory via the command line.
- Allow downloading exercises from SmartBeans via the command line
- Manage a local directory structure for exercises
- Allow running tests for local exercises
- Allow users to submit local exercises to SmartBeans
- Allow users to view the status of their submitted exercises
- Facilitate a user's ability to interact with other parts of SmartBeans locally on the CLI, e.g. viewing the leaderboard.
- Gamification features