Federated video streaming platform using ActivityPub and P2P in the web browser with Angular. https://joinpeertube.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

73 lines
2.4 KiB

  1. #!/usr/bin/env node
  2. import { CommandOptions, program } from 'commander'
  3. import { getSettings, version } from './cli'
  4. program
  5. .version(version, '-v, --version')
  6. .usage('[command] [options]')
  7. /* Subcommands automatically loaded in the directory and beginning by peertube-* */
  8. program
  9. .command('auth [action]', 'register your accounts on remote instances to use them with other commands')
  10. .command('upload', 'upload a video').alias('up')
  11. .command('import-videos', 'import a video from a streaming platform').alias('import')
  12. .command('get-access-token', 'get a peertube access token', { noHelp: true }).alias('token')
  13. .command('plugins [action]', 'manage instance plugins/themes').alias('p')
  14. .command('redundancy [action]', 'manage instance redundancies').alias('r')
  15. /* Not Yet Implemented */
  16. program
  17. .command(
  18. 'diagnostic [action]',
  19. 'like couple therapy, but for your instance',
  20. { noHelp: true } as CommandOptions
  21. ).alias('d')
  22. .command('admin',
  23. 'manage an instance where you have elevated rights',
  24. { noHelp: true } as CommandOptions
  25. ).alias('a')
  26. // help on no command
  27. if (!process.argv.slice(2).length) {
  28. const logo = '░P░e░e░r░T░u░b░e░'
  29. console.log(`
  30. ___/),.._ ` + logo + `
  31. /' ,. ."'._
  32. ( "' '-.__"-._ ,-
  33. \\'='='), "\\ -._-"-. -"/
  34. / ""/"\\,_\\,__"" _" /,-
  35. / / -" _/"/
  36. / | ._\\\\ |\\ |_.".-" /
  37. / | __\\)|)|),/|_." _,."
  38. / \\_." " ") | ).-""---''--
  39. ( "/.""7__-""''
  40. | " ."._--._
  41. \\ \\ (_ __ "" ".,_
  42. \\.,. \\ "" -"".-"
  43. ".,_, (",_-,,,-".-
  44. "'-,\\_ __,-"
  45. ",)" ")
  46. /"\\-"
  47. ,"\\/
  48. _,.__/"\\/_ (the CLI for red chocobos)
  49. / \\) "./, ".
  50. --/---"---" "-) )---- by Chocobozzz et al.\n`)
  51. }
  52. getSettings()
  53. .then(settings => {
  54. const state = (settings.default === undefined || settings.default === -1)
  55. ? 'no instance selected, commands will require explicit arguments'
  56. : 'instance ' + settings.remotes[settings.default] + ' selected'
  57. program
  58. .addHelpText('after', '\n\n State: ' + state + '\n\n' +
  59. ' Examples:\n\n' +
  60. ' $ peertube auth add -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD"\n' +
  61. ' $ peertube up <videoFile>\n'
  62. )
  63. .parse(process.argv)
  64. })
  65. .catch(err => console.error(err))