]>
git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - tools/peertube.ts
3 import * as program
from 'commander'
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('watch', 'watch a video in the terminal ✩°。⋆').alias('w')
21 /* Not Yet Implemented */
23 .command('plugins [action]',
24 'manage plugins on a local instance',
25 { noHelp: true } as program
.CommandOptions
27 .command('diagnostic [action]',
28 'like couple therapy, but for your instance',
29 { noHelp: true } as program
.CommandOptions
32 'manage an instance where you have elevated rights',
33 { noHelp: true } as program
.CommandOptions
37 if (!process
.argv
.slice(2).length
) {
38 const logo
= '░P░e░e░r░T░u░b░e░'
40 ___/),.._ ` + logo
+ `
43 \\'='='), "\\ -._-"-. -"/
44 / ""/"\\,_\\,__"" _" /,-
46 / | ._\\\\ |\\ |_.".-" /
47 / | __\\)|)|),/|_." _,."
48 / \_." " ") | ).-""---''--
58 _,.__/"\\/_ (the CLI for red chocobos)
60 --/---"---" "-) )---- by Chocobozzz et al.`)
65 const state
= (settings
.default === undefined || settings
.default === -1) ?
66 'no instance selected, commands will require explicit arguments' :
67 ('instance ' + settings
.remotes
[settings
.default] + ' selected')
69 .on('--help', function () {
71 console
.log(' State: ' + state
)
73 console
.log(' Examples:')
75 console
.log(' $ peertube auth add -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD"')
76 console
.log(' $ peertube up <videoFile>')
77 console
.log(' $ peertube watch https://peertube.cpy.re/videos/watch/e8a1af4e-414a-4d58-bfe6-2146eed06d10')