X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftools%2Fpeertube.ts;h=fc85c421097c17056695fcda67cbce9d23e9a376;hb=076e1310d3b0f1e2368b7144ae84f5d703f914d5;hp=7441161b1506d58763315c8d75a092c7cd216cde;hpb=0491173a61aed66205c017e0d7e0503ea316c144;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tools/peertube.ts b/server/tools/peertube.ts old mode 100755 new mode 100644 index 7441161b1..fc85c4210 --- a/server/tools/peertube.ts +++ b/server/tools/peertube.ts @@ -1,5 +1,8 @@ #!/usr/bin/env node +import { registerTSPaths } from '../helpers/register-ts-paths' +registerTSPaths() + import * as program from 'commander' import { version, @@ -7,7 +10,7 @@ import { } from './cli' program - .version(version(), '-v, --version') + .version(version, '-v, --version') .usage('[command] [options]') /* Subcommands automatically loaded in the directory and beginning by peertube-* */ @@ -17,13 +20,11 @@ program .command('import-videos', 'import a video from a streaming platform').alias('import') .command('get-access-token', 'get a peertube access token', { noHelp: true }).alias('token') .command('watch', 'watch a video in the terminal ✩°。⋆').alias('w') + .command('repl', 'initiate a REPL to access internals') + .command('plugins [action]', 'manage instance plugins/themes').alias('p') /* Not Yet Implemented */ program - .command('plugins [action]', - 'manage plugins on a local instance', - { noHelp: true } as program.CommandOptions - ).alias('p') .command('diagnostic [action]', 'like couple therapy, but for your instance', { noHelp: true } as program.CommandOptions @@ -57,14 +58,15 @@ if (!process.argv.slice(2).length) { ,"\\/ _,.__/"\\/_ (the CLI for red chocobos) / \\) "./, ". - --/---"---" "-) )---- by Chocobozzz et al.`) + --/---"---" "-) )---- by Chocobozzz et al.\n`) } getSettings() .then(settings => { - const state = (settings.default === -1) ? - 'no instance selected, commands will require explicit arguments' : - ('instance ' + settings.remotes[settings.default] + ' selected') + const state = (settings.default === undefined || settings.default === -1) + ? 'no instance selected, commands will require explicit arguments' + : 'instance ' + settings.remotes[settings.default] + ' selected' + program .on('--help', function () { console.log()