A command-line interface for Trane

Overview

trane-cli

This repository contains the code for the command-line interface to Trane.

Documentation

The latest documentation for trane-cli can be found in the official Trane Book. A copy is shown before for easy reference.

Installation instructions

Github releases include a compiled binary. Download the one for your OS and architecture and put it somewhere where you and/or your shell can find it. There are releases for Linux, Windows, and Mac. Releases for ARM OS X are not available at the moment because cross-compilation is not working.

Build instructions

You can also build trane-cli from source. The only requirement is an installation of the stable Rust tool chain. Running cargo build from the repository's root should do the job.

You can also run cargo install to install the binary in the cargo bin directory.

Starting guide

Running the command

To start the binary call trane, if you installed it, or cargo run from the repo's root directory. As of now, the command line does not take any arguments. Once you start the CLI, you will be met with a prompt.

trane >>

Entering enter executes the input command. Pressing CTRL-C cancels the command. Pressing CTRL-D sends an EOF signal to break out of the line reading loop.

Entering your first command

To see the next exercise, enter (prompt not shown for brevity) trane next.

Internally, the clap library is being used to process the input. This requires that a command name is present, even though it's redundant because this CLI can only run one command. For this reason, trane-cli automatically prepends the command trane if it's not there already. So all commands can be run without the need for adding trane to the beginning.

Opening a course library

The previous command returns an error because Trane has not opened a course library. A course library is a set of courses under a directory containing a subdirectory named .trane/. Inside this subdirectory, Trane stores the results of previous exercises, blacklists, and saved filters. This directory is created automatically.

Let's suppose you have downloaded the trane-music and called Trane inside that directory. Then, you can type open ./ to load all the library under that directory.

Your first study session

If all the courses are valid, the operation will succeed. Now you can run the next command. Your first exercise should be shown.

trane >> next
Course ID: trane::music::guitar::basic_fretboard
Lesson ID: trane::music::guitar::basic_fretboard::lesson_1
Exercise ID: trane::music::guitar::basic_fretboard::lesson_1::exercise_7

Find the note G in the fretboard at a slow tempo without a metronome.

If you are unsure on what to do, you can try looking at the instructions for this lesson by running the instructions lesson command:

trane >> instructions lesson
Go down each string and find the given note in the first twelve frets.
Repeat but this time going up the strings.

Do this at a slow tempo but without a metronome.

Lessons and courses can also include accompanying material. For example, a lesson on the major scale could include material defining the major scale, and it's basic intervals for reference. This course does not contain any material. For those lessons or courses which do, you can display it with the material lesson and material course commands respectively.

So this exercise belongs to a course teaching the positions of the notes in the guitar fretboard, and it is asking us to go up and down the strings to find the note. Once you have given the exercise a try, you can set your score. There are no objective definitions of which score means but the main difference between them is the degree of unconscious mastery over the exercise. A score of one means you are just learning the position of the note, you still make mistakes, and have to commit conscious effort to the task. A score of five would mean you don't even have to think about the task because it has thoroughly soaked through all the various pathways involved in learning.

If you want to verify your answer, you can show the answer associated with the current exercise, by running the answer command. Let say we give it a score of two out of five. You can do so by entering score 2. The score is saved, but it's not submitted until you move to the next question to let you make corrections.

trane >> answer
Course ID: trane::music::guitar::basic_fretboard
Lesson ID: trane::music::guitar::basic_fretboard::lesson_1
Exercise ID: trane::music::guitar::basic_fretboard::lesson_1::exercise_7

Answer:

- 1st string (high E): 3rd fret
- 2nd string (B): 8th fret
- 3rd string (G): 12th fret
- 4th string (D): 5th fret
- 5th string (A): 10th fret
- 6th string (low E): 3rd fret

To show the current exercise again, you can use the current command. Now it's time to move onto the next question. Questions are presented in the order Trane schedules them and as you master the exercises you automatically unlock new lessons and courses.

Short reference for other commands.

At its simplest, the previous commands cover much of the most common operations. The documentation (accessed with the help or <COMMAND> --help commands) is pretty much self-explanatory for most other commands.

trane >> help
trane 0.1.0
A command-line interface for Trane

USAGE:
    trane <SUBCOMMAND>

OPTIONS:
    -h, --help       Print help information
    -V, --version    Print version information

SUBCOMMANDS:
    answer          Show the answer to the current exercise, if it exists
    blacklist       Subcommands to manipulate the unit blacklist
    current         Display the current exercise
    debug           Subcommands for debugging purposes
    filter          Subcommands for dealing with unit filters
    help            Print this message or the help of the given subcommand(s)
    instructions    Subcommands for showing course and lesson instructions
    material        Subcommands for showing course and lesson materials
    next            Proceed to the next exercise
    open            Open the course library at the given location
    score           Record the mastery score (1-5) for the current exercise

There are however, some details which warrant further explanation.

The filter metadata command allows you to define simple metadata filters. For example, to only show exercises for the major scale in the key of C, you can type:

trane >> filter metadata --course-metadata scale_type:major --lesson-metadata key:C
Set the unit filter to only show exercises with the given metadata

The filter set-saved command allows you to user more complex filters by storing the definition of the filter inside the .trane/filters directory. For now, a filter can be created by serializing a struct of type NamedFilter into a JSON file (see the file src/data/filter.rs inside the Trane repo for more details). You can refer to those filters by a unique ID in their file, which can be also shown by running the filter list-saved command.

Comments
  • feat: Support getting dependencies graph of course

    feat: Support getting dependencies graph of course

    • motivation let's say that I'm a novice. And I probably don't start out trying to learn. I might want to know, What would I learn, and in what order may I learn.

    • expect

    something like

    ~~ trane list dependencies ~~ ~~ to get all lessons in all course ~~

    • trane list dependencies [ids] to get all lessons given course ids or get all exercises given lesson ids
    • other Preferably json, or better yet, dot files
    opened by huang12zheng 10
  • feat: support multi library

    feat: support multi library

    • motion We use trane to go to the command line, And, there's command open [library], which is very flexible. But, I have an idea: Perhaps we can open multiple libraries in the same workspace Semantically add the course from each library to the workspace
    opened by huang12zheng 4
  • A question about database resets

    A question about database resets

    I think that my practice_stats.db got reset (all rows deleted...or tables dropped and rebuilt..not sure which) right after I upgraded from 0.2.1 to 0.2.7. Is that expected behavior and should I always backup my .trane/ directory prior to upgrading? Or to phrase the question another way - should I be expecting that upgrading will require me to reset practice stats between versions?

    I realize this is super beta stuff, so please don't feel like I'm asking for something here, I'm just trying set my own expectations.

    Thanks for the awesome little app! I've already started writing my own courses specific to learning major scale triad shapes on different strings!

    opened by schickm 4
  • Need to press ctrl+D twice before session save dialog displays - program locks terminal

    Need to press ctrl+D twice before session save dialog displays - program locks terminal

    When I close a trane-cli session with ctrl+D I get EOF: Exiting standard output. However, when I press ctrl+D a second time I get a more informative output about saving the session data. Additionally, the terminal is then captured and I can no longer interact with that terminal. Please see the screenshot below for an example of this behavior.

    image

    I'm on an m1 Macbook Pro. Please let me know if there's anything else that I can provide. Thanks for the software, so far I really enjoy using it!

    opened by amarcozzi 1
  • feat: Supports handling carriage returns and commands beginning with #

    feat: Supports handling carriage returns and commands beginning with #

    • motion Supports handling carriage returns(\n or '') and commands beginning with # Currently trane only supports commands, but sometimes customers will interpret the commands

    For example, the following scenario: https://asciinema.org/a/3DTwksv3htBp0ALH9qnsBt1NN

    opened by huang12zheng 1
Releases(v0.8.0)
Owner
The Trane Project
The Trane Project
Small command-line tool to switch monitor inputs from command line

swmon Small command-line tool to switch monitor inputs from command line Installation git clone https://github.com/cr1901/swmon cargo install --path .

William D. Jones 5 Aug 20, 2022
Low-level Rust library for implementing terminal command line interface, like in embedded systems.

Terminal CLI Need to build an interactive command prompt, with commands, properties and with full autocomplete? This is for you. Example, output only

HashMismatch 47 Nov 25, 2022
Crunch is a command-line interface (CLI) to claim staking rewards every X hours for Substrate-based chains

crunch · crunch is a command-line interface (CLI) to claim staking rewards every X hours for Substrate-based chains. Why use crunch To automate payout

null 39 Dec 8, 2022
Command line interface for Solana Metaplex programs.

Metaplex Command Line Interface This is a command line interface for creating and managing non-fungible tokens on the Solana blockchain through the Me

Caleb Everett 26 Jul 12, 2022
Railway CLI - This is the command line interface for Railway.

Railway CLI This is the command line interface for Railway. Use it to connect your code to Railways infrastructure without needing to worry about envi

Nebula 4 Mar 20, 2022
Command line interface as a function.

Command line interface as a function. fncmd fncmd is an opinionated command line parser frontend that wraps around clap. The functionality is mostly i

Yu Shimura 67 Dec 7, 2022
A silly program written in Rust to output nonsensical sentences in the command line interface.

A silly program written in Rust to output nonsensical sentences in the command line interface.

Rachael Ava 1 Dec 13, 2021
Scouty is a command-line interface (CLI) to keep an eye on substrate-based chains and hook things up

scouty is a command-line interface (CLI) to keep an eye on substrate-based chains and hook things up

TurboFlakes 15 Aug 6, 2022
A standalone Command Line Interface debugging tool for The Witcher 3 written in Rust

A standalone Command Line Interface debugging tool for The Witcher 3 written in Rust. This tool is intended for Witcher 3 modders who make mainly scri

Przemysław Cedro 5 Apr 20, 2022
A command line interface meant to bridge the gap between Rust and shell scripting

clawbang A command line interface meant to bridge the gap between Rust and shell scripting. Intended for use with HEREDOCs and shebangs: $ clawbang <<

Chris Dickinson 52 Mar 25, 2022
Gix is a command-line interface (CLI) to access git repositories

gix is a command-line interface (CLI) to access git repositories. It's written to optimize the user-experience, and perform as good or better than the

Sebastian Thiel 5.2k Jan 5, 2023
The official command-line interface for the makedeb Package Repository

mpr-cli This is the repository for the MPR CLI, the official command-line interface for the makedeb Package Repository. Installation Users have a few

makedeb 38 Jan 2, 2023
A command line interface for trash written in Rust (WIP)

trashctl A command line interface for trash Features Add file to trash List files Permanently delete a file Restore file Empty the trash Documentation

0xMRTT 2 Nov 11, 2022
Command-line interface to Microsoft To Do

⚠ This is a hackathon project with no official support or quality guarantee Hackathon 2022 tdi The command-line interface, for some, is the natural wa

Microsoft Hackathons 5 Oct 26, 2022
The awesome-app Command Line Interface

Rust CLI to create Awesome Applications with Rust. More info at awesomeapp.org Install > cargo install awesome-app Create your first app: # Create you

RUST-AWESOME-APP 41 Jan 4, 2023
This is a simple command-line interface tool that allows you to interact with ChatGPT from OpenAI or Azure.

HeyGPT This is a simple command-line interface tool that allows you to interact with ChatGPT from OpenAI or Azure. You can use it to: Chat with ChatGP

Philip 5 Mar 28, 2023
A command-line interface for interacting with the ChatGPT API from OpenAI

cligpt cligpt is a command-line interface for interacting with the ChatGPT API from OpenAI. With cligpt, you can quickly and easily generate text by s

Felipe S. S. Schneider 6 Apr 4, 2023
tmplt is a command-line interface tool that allows you to quickly and easily set up project templates for various programming languages and frameworks

tmplt A User Friendly CLI Tool For Creating New Projects With Templates About tmplt is a command-line tool that lets users quickly create new projects

Humble Penguin 35 Apr 8, 2023
SKYULL is a command-line interface (CLI) in development that creates REST API project structure templates with the aim of making it easy and fast to start a new project.

SKYULL is a command-line interface (CLI) in development that creates REST API project structure templates with the aim of making it easy and fast to start a new project. With just a few primary configurations, such as project name, you can get started quickly.

Gabriel Michaliszen 4 May 9, 2023