]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/tools/peertube.ts
3 import { registerTSPaths
} from '../helpers/register-ts-paths'
6 import { CommandOptions
, program
} from 'commander'
7 import { getSettings
, version
} from './cli'
10 .version(version
, '-v, --version')
11 .usage('[command] [options]')
13 /* Subcommands automatically loaded in the directory and beginning by peertube-* */
15 .command('auth [action]', 'register your accounts on remote instances to use them with other commands')
16 .command('upload', 'upload a video').alias('up')
17 .command('import-videos', 'import a video from a streaming platform').alias('import')
18 .command('get-access-token', 'get a peertube access token', { noHelp: true }).alias('token')
19 .command('plugins [action]', 'manage instance plugins/themes').alias('p')
20 .command('redundancy [action]', 'manage instance redundancies').alias('r')
22 /* Not Yet Implemented */
25 'diagnostic [action]',
26 'like couple therapy, but for your instance',
27 { noHelp: true } as CommandOptions
30 'manage an instance where you have elevated rights',
31 { noHelp: true } as CommandOptions
35 if (!process
.argv
.slice(2).length
) {
36 const logo
= '░P░e░e░r░T░u░b░e░'
38 ___/),.._ ` + logo
+ `
41 \\'='='), "\\ -._-"-. -"/
42 / ""/"\\,_\\,__"" _" /,-
44 / | ._\\\\ |\\ |_.".-" /
45 / | __\\)|)|),/|_." _,."
46 / \\_." " ") | ).-""---''--
56 _,.__/"\\/_ (the CLI for red chocobos)
58 --/---"---" "-) )---- by Chocobozzz et al.\n`)
63 const state
= (settings
.default === undefined || settings
.default === -1)
64 ? 'no instance selected, commands will require explicit arguments'
65 : 'instance ' + settings
.remotes
[settings
.default] + ' selected'
68 .addHelpText('after', '\n\n State: ' + state
+ '\n\n' +
70 ' $ peertube auth add -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD"\n' +
71 ' $ peertube up <videoFile>\n'
75 .catch(err
=> console
.error(err
))