Skip to content

Command-line shell that interacts with the Choirless API as if it is a directory structure

License

Notifications You must be signed in to change notification settings

Choirless/choirlessshell

Repository files navigation

choirlessshell

A command-line shell that allows you to deal with Choirless users/choirs/songs/parts as if they are a directory hierarchy.

e.g.

>> 
>> cd [email protected]
[email protected] >> ll
001jqAp211hJM10gdxDs3ifaNF3gR9tk - The Dog Choir
001jtqPK3709Op2285kQ27t8Jc30NULC - The Cat Choir
[email protected] >> cd 001jqAp211hJM10gdxDs3ifaNF3gR9tk
[email protected]/The Dog Choir >> ll
001kPmUi20QKge4ataKT1bSFMt1OtU9D - Biscuits!
001kDfRz129Ap70i3DH53UhILr35zbfv - Chasing cats
001k8vmX2BnzhP3viVJF0c8wOz3FGV07 - Hey Mr Postman
[email protected]/The Dog Choir >> cd 001kPmUi20QKge4ataKT1bSFMt1OtU9D
[email protected]/The Dog Choir/Biscuits! >> ll
001kV1Vu0pnnsW1qfEO225XVlc1vcrNC 2020-10-20 Rufus 0ms
001kV2vF3w2gYJ0sVhAO3jz6w305e55U 2020-10-21 Rover 221ms
001kV2z44WrJxW2vXhkB0ILJmi3euMNw 2020-10-21 George 139ms
001kV37W0Ei1gw1z8fjy0XmXtp1bgGsB 2020-10-21 Spot 232ms
[email protected]/The Dog Choir/Biscuits! >> offset 001kV2vF3w2gYJ0sVhAO3jz6w305e55U 100
ok: offset set to 100
[email protected]/The Dog Choir/Biscuits! >> volume 001kV2vF3w2gYJ0sVhAO3jz6w305e55U 0.75
ok: offset set to 0.75
[email protected]/The Dog Choir/Biscuits! >> open
[email protected]/The Dog Choir/Biscuits! >> cd ..
[email protected]/The Dog Choir >> cd ..
[email protected] >> cd ..
>>
>> quit

Prerequisites

This tool assumes that you have a Choirless API running on http://localhost:3000. Here's how to do that:

schematic

Clone the choirlessapi repo

git clone https://github.com/Choirless/choirlessapi.git
cd choirlessapi
npm install

Run the Choirless API, passing it the credentials it needs to connect to the database:

export COUCH_CHOIRLESS_DATABASE="data"
export COUCH_INVITATION_DATABASE="invitations"
export COUCH_KEYS_DATABASE="keys"
export COUCH_RENDER_DATABASE="render_status"
export COUCH_USERS_DATABASE="users"
export COUCH_URL="https://user:[email protected]"
export LOCAL_MODE="true"
export COS_REGION="eu-gb"
export COS_ACCESS_KEY_ID="mycosaccesskeyid"
export COS_ACCESS_KEY_SECRET="mycosaccesskeysecret"
export COS_DEFAULT_BUCKET="choirless-videos-raw"
export COS_ENDPOINT="s3.eu-gb.cloud-object-storage.appdomain.cloud"
npm run server

Running choirlessshell

Clone the choirlessshell repo:

git clone https://github.com/Choirless/choirlessshell.git
cd choirlessshell
npm install

Run the shell:

npm run start

Available commands

cd <email or id> - change directory

At the top level you need to know the email address of a Choirless user e.g.

The directory hierarchy goes email / choir / song / songpart.

Use the ll command at any level other than the top level to see the contents. Once ll is run, the cd command will attempt to 'tab autocomplete' your command as you type.

ll - list directory contents

[email protected] >> ll
001jqAp211hJM10gdxDs3ifaNF3gR9tk - The Dog Choir
001jtqPK3709Op2285kQ27t8Jc30NULC - The Cat Choir

Any ids you see can be used as a parameter for cd (not the choir/song names) e.g.

[email protected] >> cd 001jqAp211hJM10gdxDs3ifaNF3gR9tk
[email protected]/The Dog Choir >> ll
001kPmUi20QKge4ataKT1bSFMt1OtU9D - Biscuits!
001kDfRz129Ap70i3DH53UhILr35zbfv - Chasing cats

cat <id> - output file contents

>> cat [email protected]
{
  type: 'user',
  userId: '001jqAoq1iTYBk2HNVCT14IttY0htWeI',
  name: 'Glynn Bird',
  email: '[email protected]',
  verified: false,
  createdOn: '2020-06-30T07:36:40.459Z',
  userType: 'admin'
}
>> cd [email protected]
[email protected] >> ll
001jqAp211hJM10gdxDs3ifaNF3gR9tk - The Dog Choir
001jtqPK3709Op2285kQ27t8Jc30NULC - The Cat Choir
[email protected] >> cat 001jqAp211hJM10gdxDs3ifaNF3gR9tk
{
  type: 'choir',
  choirId: '001jqAp211hJM10gdxDs3ifaNF3gR9tk',
  name: 'The Submariners',
  description: '',
  choirType: 'public',
  createdOn: '2020-06-30T07:36:52.863Z',
  createdByUserId: '001jqAoq1iTYBk2HNVCT14IttY0htWeI',
  createdByName: 'N/A'
}

cd .. - go up a level

url <url> - jump to Choirless song given a URL

Copy and paste a Choirless URL and pass it to the url command e.g.

>> url https://www.choirless.com/dashboard/choir/001jtqPK3709Op2285kQ27t8Jc30NULC/song/001kHpAg2p3kJq219ZwO3pU34l2khPgK
-/Glynn's Test Choir/Impossible Weight >>

Jumps straight to the song directory, using a fake user '-' at the top level.

volume <id> <level> - adjust the volume level of a song part

[email protected]/The Dog Choir/Biscuits! >> volume 001kHpUj3mKUC60vg8Sy08qaN21voG9H 0.5
ok: set volume to 0.5
[email protected]/The Dog Choir/Biscuits! >>

offset <id> <level> - adjust the offset of a song part in milliseconds

[email protected]/The Dog Choir/Biscuits! >> offset 001kHpUj3mKUC60vg8Sy08qaN21voG9H 250
ok: set offset to 250
[email protected]/The Dog Choir/Biscuits! >>

hide <id> - hide song part from the final render

[email protected]/The Dog Choir/Biscuits! >> hide 001kHpUj3mKUC60vg8Sy08qaN21voG9H
ok: part hidden
[email protected]/The Dog Choir/Biscuits! >>

unhide <id> - unhide song part from the final render

[email protected]/The Dog Choir/Biscuits! >> unhide 001kHpUj3mKUC60vg8Sy08qaN21voG9H
ok: part unhidden
[email protected]/The Dog Choir/Biscuits! >>

audio <id> <flag> - mark song part as "audio only" or not

[email protected]/The Dog Choir/Biscuits! >> audio 001kHpUj3mKUC60vg8Sy08qaN21voG9H true
ok: part audio
[email protected]/The Dog Choir/Biscuits! >>

open - opens the current song/choir in the web interface

[email protected]/The Dog Choir/Biscuits! >> open
ok: opened song in web browser
[email protected]/The Dog Choir/Biscuits! >>

download all - downloads all the song parts

[email protected]/The Dog Choir/Biscuits! >> download all
C1kjQjM1vO0pU1zPM1t1GqwMs4DrHTD  ■■■□□□□□□□□□□□□□□□□□ 3/20
[email protected]/The Dog Choir/Biscuits! >>

download <id> - downloads a single song part

[email protected]/The Dog Choir/Biscuits! >> download 001kHpUj3mKUC60vg8Sy08qaN21voG9H
downloading song part
download complete
[email protected]/The Dog Choir/Biscuits! >>

plot <id> - display sync plot

[email protected]/The Dog Choir/Biscuits! >> plot 001kHpUj3mKUC60vg8Sy08qaN21voG9H
ok: sync plot opened in browser
[email protected]/The Dog Choir/Biscuits! >>

About

Command-line shell that interacts with the Choirless API as if it is a directory structure

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published