(doc) add manpage to peertube cli
authorRigel Kent <sendmemail@rigelk.eu>
Sat, 20 Oct 2018 17:15:41 +0000 (19:15 +0200)
committerRigel Kent <par@rigelk.eu>
Sat, 20 Oct 2018 17:16:56 +0000 (19:16 +0200)
package.json
scripts/generate-cli-doc.sh [new file with mode: 0755]
server/tools/README.md [new file with mode: 0644]
yarn.lock

index 0798fdba289c77986e2c859560e44bed171f451d..bc514920de8e71fac033df268713ec8c3c0711cd 100644 (file)
@@ -49,6 +49,7 @@
     "test": "scripty",
     "help": "scripty",
     "generate-api-doc": "scripty",
+    "generate-cli-doc": "scripty",
     "parse-log": "node ./dist/scripts/parse-log.js",
     "prune-storage": "node ./dist/scripts/prune-storage.js",
     "optimize-old-videos": "node ./dist/scripts/optimize-old-videos.js",
     "jsonld-signatures": "https://github.com/Chocobozzz/jsonld-signatures#rsa2017",
     "lodash": "^4.17.10",
     "magnet-uri": "^5.1.4",
+    "marked-man": "^0.2.1",
     "memoizee": "^0.4.14",
     "morgan": "^1.5.3",
     "multer": "^1.1.0",
diff --git a/scripts/generate-cli-doc.sh b/scripts/generate-cli-doc.sh
new file mode 100755 (executable)
index 0000000..0d00f18
--- /dev/null
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+set -eu
+
+node_modules/marked-man/bin/marked-man server/tools/README.md > dist/server/tools/peertube.8
diff --git a/server/tools/README.md b/server/tools/README.md
new file mode 100644 (file)
index 0000000..6b94d74
--- /dev/null
@@ -0,0 +1,82 @@
+peertube(8) -- companion CLI for PeerTube
+=========================================
+
+SYNOPSIS
+--------
+
+```
+peertube [command] [options]
+```
+
+DESCRIPTION
+-----------
+
+`peertube` wraps various utilities around PeerTube that are used either on a running local, running remote, or cold local instance.
+
+COMMANDS
+--------
+
+Unless otherwise specified, every command can be queried for its own help or manual by passing its name to the `help` command, or by using the `--help` option.
+
+`auth [action]`: stores credentials for your accounts on remote instances so that you don't need to pass them at every command
+
+`upload|up`: upload a video to a remote instance
+
+    $ peertube upload \
+        -u "PEERTUBE_URL" \
+        -U "PEERTUBE_USER" \
+        --password "PEERTUBE_PASSWORD"
+
+`import-videos|import`: import a video from a streaming platform to a remote instance
+
+    $ peertube import \
+        -u "PEERTUBE_URL" \
+        -U "PEERTUBE_USER" \
+        --password "PEERTUBE_PASSWORD" \
+        -t "TARGET_URL"
+
+    The target URL can be directly the video file, or any of the supported sites of youtube-dl. The video is downloaded locally and then uploaded. Already downloaded videos will not be uploaded twice, so you can run and re-run the script in case of crash, disconnection…
+
+`watch|w`: watch a video in the terminal ✩°。⋆
+
+    -g, --gui <player>      player type (default: ascii)
+    -i, --invert            invert colors (ascii player only)
+    -r, --resolution <res>  video resolution (default: 720)
+
+    It provides support for different players:
+
+    - ascii (default ; plays in ascii art in your terminal!)
+    - mpv
+    - mplayer
+    - vlc
+    - stdout
+    - xbmc
+    - airplay
+    - chromecast
+
+`repl`: interact with the application libraries and objects even when PeerTube is not running
+
+    Type .help to see the repl-only functions, or to see the available PeerTube core functions:
+   
+    repl> lodash.keys(context)
+
+`help [cmd]`: display help for [cmd]
+
+EXAMPLES
+--------
+
+    $ peertube auth add -u "PEERTUBE_URL" -U "PEERTUBE_USER" --password "PEERTUBE_PASSWORD"
+    $ peertube up <videoFile>
+    $ peertube watch https://peertube.cpy.re/videos/watch/e8a1af4e-414a-4d58-bfe6-2146eed06d10
+
+SEE ALSO
+--------
+
+[PeerTube Tools Documentation](https://github.com/Chocobozzz/PeerTube/blob/develop/support/doc/tools.md)
+
+[PeerTube Admin Documentation](https://docs.joinpeertube.org/lang/en/docs/)
+
+REPORTING BUGS
+--------------
+
+See [PeerTube repository](https://github.com/Chocobozzz/PeerTube).
index a0fec9b5f8a73bceb0164d5c00c9710d6bf556b3..2478a0664efe090c0a4f20703b0d267cb7827975 100644 (file)
--- a/yarn.lock
+++ b/yarn.lock
@@ -5885,7 +5885,14 @@ map-visit@^1.0.0:
   dependencies:
     object-visit "^1.0.0"
 
-marked@^0.3.5:
+marked-man@^0.2.1:
+  version "0.2.1"
+  resolved "https://registry.yarnpkg.com/marked-man/-/marked-man-0.2.1.tgz#f259271481de3b507263489f5221b7c5acfd2383"
+  integrity sha1-8lknFIHeO1ByY0ifUiG3xaz9I4M=
+  dependencies:
+    marked "^0.3.2"
+
+marked@^0.3.2, marked@^0.3.5:
   version "0.3.19"
   resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.19.tgz#5d47f709c4c9fc3c216b6d46127280f40b39d790"
   integrity sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==