rtolms-cli

CLI development tool for the Roundtable Learning Management System

Usage no npm install needed!

<script type="module">
  import rtolmsCli from 'https://cdn.skypack.dev/rtolms-cli';
</script>

README

rtolms-cli

CLI development tool for the Roundtable Learning Management System

oclif Version Build status semantic-release


Requirements

Usage

$ npm install -g rtolms-cli
$ rtolms COMMAND
running command...
$ rtolms (-v|--version|version)
rtolms-cli/3.1.1 linux-x64 node-v10.15.0
$ rtolms --help [COMMAND]
USAGE
  $ rtolms COMMAND
...

Commands

rtolms autocomplete [SHELL]

display autocomplete installation instructions

USAGE
  $ rtolms autocomplete [SHELL]

ARGUMENTS
  SHELL  shell type

OPTIONS
  -r, --refresh-cache  Refresh cache (ignores displaying instructions)

EXAMPLES
  $ rtolms autocomplete
  $ rtolms autocomplete bash
  $ rtolms autocomplete zsh
  $ rtolms autocomplete --refresh-cache

See code: @oclif/plugin-autocomplete

rtolms clone

Updates local working copies

USAGE
  $ rtolms clone

OPTIONS
  -a, --auth-type=private-key|token  [default: token] Which authentication type to use
  -c, --concurrency=concurrency      (required) [default: 4] Number of operations to run at once
  -d, --dry-run                      Don't actually perform clone
  -h, --help                         show CLI help
  -v, --verbose                      Verbose
  --force                            Do not stop on errors
  --page-size=page-size              [default: 30] How many lines to show per page in list prompts

EXAMPLE
  $ rtolms clone

See code: src/commands/clone.ts

rtolms config

Create or modify configuration files

USAGE
  $ rtolms config

OPTIONS
  -h, --help             show CLI help
  -v, --verbose          Verbose
  --page-size=page-size  [default: 30] How many lines to show per page in list prompts

ALIASES
  $ rtolms config:list
  $ rtolms config:index

See code: src/commands/config/index.ts

rtolms config:init

Prompt for data to create the required configuration file

USAGE
  $ rtolms config:init

OPTIONS
  -h, --help             show CLI help
  -v, --verbose          Verbose
  --page-size=page-size  [default: 30] How many lines to show per page in list prompts

ALIASES
  $ rtolms init

See code: src/commands/config/init.ts

rtolms config:set KEY VALUE

Set a configuration key's value

USAGE
  $ rtolms config:set KEY VALUE

ARGUMENTS
  KEY    Config key to set
  VALUE  The value to set

OPTIONS
  -h, --help             show CLI help
  -v, --verbose          Verbose
  --page-size=page-size  [default: 30] How many lines to show per page in list prompts

ALIASES
  $ rtolms set
  $ rtolms config:set

See code: src/commands/config/set.ts

rtolms get-path [CUSTOMERNAME]

Prints repo directory path for a given customer

USAGE
  $ rtolms get-path [CUSTOMERNAME]

ARGUMENTS
  CUSTOMERNAME  Partial customer name (fuzzy matched to custom repo names)

OPTIONS
  -h, --help             show CLI help
  -v, --verbose          Verbose
  --page-size=page-size  [default: 30] How many lines to show per page in list prompts

ALIASES
  $ rtolms path

EXAMPLES
  $ rtolms get-path
  $ rtolms get-path fed

See code: src/commands/get-path.ts

rtolms git

Run any git operation on all customer repos

USAGE
  $ rtolms git

OPTIONS
  -c, --concurrency=concurrency  (required) [default: 1] Number of operations to run at once
  -h, --help                     show CLI help
  -v, --verbose                  Verbose
  --force                        Do not stop on errors
  --page-size=page-size          [default: 30] How many lines to show per page in list prompts

EXAMPLE
  $ rtolms git fetch

See code: src/commands/git.ts

rtolms help [COMMAND]

display help for rtolms

USAGE
  $ rtolms help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI

See code: @oclif/plugin-help

rtolms link [CUSTOMERNAME]

Link a custom dir to lms-core

USAGE
  $ rtolms link [CUSTOMERNAME]

ARGUMENTS
  CUSTOMERNAME  Partial customer name (fuzzy matched to custom repo names)

OPTIONS
  -h, --help             show CLI help
  -j, --use-junction     Use a junction symlink type on windows (defaults to "dir" type)
  -t, --target=target    Target path to link to
  -v, --verbose          Verbose
  --page-size=page-size  [default: 30] How many lines to show per page in list prompts

EXAMPLES
  $ rtolms link     
    # prompts for user input to select a customer
  $ rtolms link ama 
    # fuzzy matches customer
  $ rtolms link --target=~/Projects/some/dir 
    # Overrides link target manually

See code: src/commands/link.ts

rtolms reconfigure

Changes database connection strings

USAGE
  $ rtolms reconfigure

OPTIONS
  -R, --replace-raw=replace-raw  Same as -r but skips string replacements (the provided value is used verbatim).
  -d, --database=database        The name of the database to change to. Defaults to `config.database`.
  -h, --help                     show CLI help
  -r, --replace=replace          Replace entire connection string with this value instead of the current value.
  -s, --server=server            The database server name to change to. Defaults to `config.server`.
  -v, --verbose                  Verbose
  --no-strip-bom                 Do not remove the byte order mark from processed files
  --page-size=page-size          [default: 30] How many lines to show per page in list prompts

ALIASES
  $ rtolms reconf
  $ rtolms reconfig
  $ rtolms setdb
  $ rtolms set-db
  $ rtolms changedb

EXAMPLES
  $ lms reconfig   
    # Replaces *server* and *database* values in connection strings with those from your current configuration 

    This is useful for new databases with no auth info 

  $ lms reconf -r "Server=willbereplaced;DataBase=willbereplaced;UID=dev;PWD=elopment;"    
    # Replaces entire connection string with this val (with *server* and *database* values replaced)
  $ lms reconf -R "Server=willNOTbereplaced;DataBase=willNOTbereplaced;UID=dev;PWD=elopment;"    
    # Replaces entire connection string with this val verbatim

See code: src/commands/reconfigure.ts

rtolms sql:incrementals [CUSTOMERNAME]

Run SQL incremental scripts

USAGE
  $ rtolms sql:incrementals [CUSTOMERNAME]

ARGUMENTS
  CUSTOMERNAME  Partial customer name (fuzzy matched to custom repo names)

OPTIONS
  -L, --no-use-linked
      Ignore currently linked custom dir

  -a, --archived
      Show archived incrementals also

  -c, --core
      Run core incrementals instead of custom

  -d, --database=database
      The name of the database to change to. Defaults to `config.database`.

  -h, --help
      show CLI help

  -p, --password=password
      (required) [default: elopment] The password to connect to the db with.

  -s, --server=server
      The database server name to change to. Defaults to `config.server`.

  -u, --username=username
      [default: dev] The username to connect to the db with.

  -v, --verbose
      Verbose

  --from=from
      (required) [default: last 6 months] Preselect scripts dated after FROM. See
      [parser](https://github.com/wanasit/chrono) for more info on matching.

         --from="last 6 months"
         --from="2 months ago"
         --from="June"
         --from="2018-03-01"
         --from="last month"
         --from="jan 1"

  --instance=instance
      The sql server instance on the server (Must have port 1434 open). Defaults to server.split(\)[1]

  --page-size=page-size
      [default: 30] How many lines to show per page in list prompts

DESCRIPTION
  This command will look for .sql scripts in subdirectories of the selected repo
  named "Sql". If any are found, it will prompt you to select which scripts to
  run before executing them.

  The --from flag can be used to preselect scripts which are dated after
  the given time. See examples for more.

ALIASES
  $ rtolms sql
  $ rtolms sql:index

EXAMPLES
  $ rtolms sql:incrementals     
    # finds scripts in your currently linked custom dir
  $ rtolms sql:incrementals -L  
    # prompts for a custom repo to look for scripts in
  $ rtolms sql:incrementals --core --from="jul 4"     
    # finds scripts in your lms-core dir and preselects all dated after July 4 of this year
  $ rtolms sql:incrementals ama 
    # finds scripts in fuzzy matched lms-custom-aama dir
  $ rtolms sql:incrementals -s="my-vm.local" 
    # connects to server on "my-vm.local" (port 1433)
  $ rtolms sql:incrementals -s="my-vm.local\\SQLEXPRESS" 
    # connects to server instance "SQLEXPRESS" on "my-vm.local"
  $ rtolms sql:incrementals -ca 
    # runs archived incrementals from core

See code: src/commands/sql/incrementals.ts

rtolms status

Shows status of all repos

USAGE
  $ rtolms status

OPTIONS
  -c, --concurrency=concurrency  (required) [default: 4] Number of operations to run at once
  -f, --fetch                    Fetch from remote before checking status
  -h, --help                     show CLI help
  -v, --verbose                  Verbose
  --force                        Do not stop on errors
  --page-size=page-size          [default: 30] How many lines to show per page in list prompts

ALIASES
  $ rtolms st
  $ rtolms stat

See code: src/commands/status.ts

rtolms unlink

Unlink a custom dir to lms-core

USAGE
  $ rtolms unlink

OPTIONS
  -h, --help             show CLI help
  -v, --verbose          Verbose
  --page-size=page-size  [default: 30] How many lines to show per page in list prompts

See code: src/commands/unlink.ts

rtolms which

Prints which customer is currently linked

USAGE
  $ rtolms which

OPTIONS
  -h, --help             show CLI help
  -v, --verbose          Verbose
  --page-size=page-size  [default: 30] How many lines to show per page in list prompts

See code: src/commands/which.ts


Configuration with .env Files

As of v2.17.0, the cli will read database and server from .env or .env.defaults files in the root of the currently linked custom dir.

For example, if we have this fs structure:

├── lms
│   ├── lms-core
│   ├── lms-custom-enviva #<-- linked
│   │   └── .env.defaults
│   ├── lms-custom-plygem
│   └── lms-custom-tcx
│        ├── .env
│        └── .env.defaults

When running any command, the CLI will read the database value from lms/lms-custom-enviva/.env.defaults.

See https://github.com/mrsteele/dotenv-defaults#readme for more.