Git Product home page Git Product logo

sbcli's Introduction

About

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.

Known issues

  • 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 login apparently doesn't work when using git bash. Powershell 7 and cmd work fine, though.

Installation

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 | bash

or, if you don't have curl installed:

wget -qO- https://raw.githubusercontent.com/KVNU/sbcli/main/install.sh | bash

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

Building from source

Prerequisites

OpenSSL is required for the reqwest crate, which we use for HTTP requests. See here for more information.

Building

cargo build --release

Installing

cargo install --path <project_dir>

Usage

Prerequisites

A SmartBeans account which has password authentication enabled. Token login is wip.

Commands

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 HOST

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

Design

High Level Goals

Core functionality

  • 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

Optional functionality

  • Facilitate a user's ability to interact with other parts of SmartBeans locally on the CLI, e.g. viewing the leaderboard.
  • Gamification features

Footnotes

  1. https://gitlab.gwdg.de/smart/smartbeans โ†ฉ

sbcli's People

Contributors

erdfern avatar

Watchers

 avatar

sbcli's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.