Giter Club home page Giter Club logo

glearn-cli's Introduction

Learn CLI

The Learn CLI is the command line interface for developing, previewing, and publishing curriculum on Learn.

Requirements

The learn command is supported on Mac, Linux, and Windows.

Installation

Option 1: Install with Homebrew (use WSL2 on Windows)

The easiest installation is with Homebrew, which is for MacOS and Linux. Follow these directions to install Homebrew. Once installed, run these commands on your command line.

brew tap gSchool/learn
brew install learn

Option 2: Install with curl (use WSL2 on Windows)

Use the command line utility curl to download and install the latest version. The learn command will be placed in the /usr/local/bin directory.

curl -sSL $(curl -sSL https://api.github.com/repos/gSchool/glearn-cli/releases/latest | grep -o "http.*$(uname -sm | sed 's/ /_/').tar.gz") | sudo tar -C /usr/local/bin -xzf - learn

Option 3: Install binaries directly from GitHub

Download binaries for all platforms directly from https://github.com/gSchool/glearn-cli/releases

Place the learn executable in a location included in your PATH so that it can be called from any directory.

Set API Token

After installation, you must set your API token. Copy your token from https://learn-2.galvanize.com/api_token and run this command, replacing YOUR_LEARN_API_TOKEN with your token.

learn set --api_token=YOUR_LEARN_API_TOKEN

Confirm Installation

Run the command

learn version

You should get a response like

v0.10.0

Help with other commands

learn help

Get Started: Walkthrough

You can generate a sample piece of curriculum to begin a walkthrough of how to develop curriculum with Learn with

learn walkthrough

Get Started: Quick Edits to Existing Curriculum

  1. Clone and edit curriculum
  2. Preview your changes. Run: learn preview -o <directory|file>
  3. Git add / commit / push changes to any branch
  4. Publish changes as a new Block revision. Run: learn publish

Update

Follow the instructions in the upgrade document.

Uninstall

Homebrew: brew uninstall learn

Other installations: delete learn executable

Development

To contribute, look at the development instructions.

glearn-cli's People

Contributors

bradford-hamilton avatar chad-galvanize avatar chrislondrie avatar dclay1983 avatar erinlhough avatar franklyandy avatar hr-curtissimo avatar jonathandavidlewis avatar lrnmls avatar pabranch avatar perrybranch-galvanize avatar pgrunde avatar proko8 avatar realistschuckle avatar sperella avatar torik17 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

glearn-cli's Issues

Request documentation update to reference latest learn cli commands

While doing some research on the Learn CLI and creating content on Learn, I noticed that the README instructions might be out of date and that an alias exists that doesn't seem to be in use.

Specifically, I noticed that the command "learn new" no longer worked, "learn guide" replaced it, and there is a third command "learn walkthrough" that appears to do the same thing as "learn guide." I also noticed that "learn guide" is an alias for walkthrough command but not listed in the output when I run the "learn help" command.

https://github.com/gSchool/glearn-cli/blob/cff7d28fcb8c9e66b220f553865056c564fe9214/app/cmd/guide.go

It looks like if a code change is applied to the file above and the readme is updated to reflect the new command (learn walkthrough) then things should be good to go.

Error messages not printed to stderr

I use a lot of output redirection when using the CLI, especially in scripts. Because some error messages are written to standard out, sometimes I don't know of failures until I look in a file. It would be lovely if errors were printed to standard error.

Expected Behavior

All fatal error messages are written to standard error.

Current Behavior

Some fatal error messages are written to standard out.

Possible Solution

Use the fmt.F*(os.Stderr, ...) form to print to standard error.

Steps to Reproduce

  1. Rename the ~/.glearn-config.yaml file to something else
  2. Run ../glearn-cli publish 1>/dev/null
  3. Note that the error message is not printed since standard out is being redirected to /dev/null

Context (Environment)

This would help those that use the CLI to write better scripts for their curriculum-making efforts.

Version check does not follow semantic versioning

I am running a pre-release version (v0.10.14-beta-1.0) of the CLI because I'm making improvements and while the changes have been merged into master, they haven't yet been put into a release.

Expected Behavior

When I run the publish or preview command, I do not get a message that tells me that there is a newer version of the CLI available.

Current Behavior

When I run the publish or preview command, it prints an incorrect message that there is a newer version of the CLI available.

Possible Solution

Use semantic versioning to compare the installed version and the latest version published.

Steps to Reproduce

  1. Clone the repo
  2. Change the currentReleaseVersion value to "20.0.0"
  3. Build the project
  4. Run ./glearn-cli preview path/to/repo and see the following message:
    WARNING: There is newer version of the learn tool available.
    Latest: v0.10.13
    Current: v20.0.0
    To avoid issues, upgrade by following the instructions at this link:
    https://github.com/gSchool/glearn-cli/blob/master/upgrade_instructions.md
    

Context (Environment)

This isn't a high-priority fix. It's just kind of annoying when running prer-elease versions.

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.