2021-06-23 20:53:51 +00:00
|
|
|
* 0x0 uploader
|
|
|
|
This is a very lightweight front-end to the [[http://0x0.st][0x0 pastebin service]] for slightly easier
|
|
|
|
command line use.
|
|
|
|
** Use
|
2022-12-01 17:18:02 +00:00
|
|
|
#+begin_src bash :results output replace :tangle no
|
2022-12-01 17:20:51 +00:00
|
|
|
oxo --help
|
2022-12-01 17:18:02 +00:00
|
|
|
#+end_src
|
2021-06-23 20:53:51 +00:00
|
|
|
|
2022-12-01 17:20:51 +00:00
|
|
|
#+RESULTS:
|
|
|
|
#+begin_example
|
|
|
|
|
|
|
|
Usage: oxo [OPTIONS] COMMAND [ARGS]...
|
|
|
|
|
|
|
|
A command line utility for 0x0.st compliant pastebins.
|
|
|
|
To use a different 0x0 site, set `OXO_BASE_URL` in your environment, or
|
|
|
|
specify it in the relevant subcommand.
|
|
|
|
|
|
|
|
╭─ Options ────────────────────────────────────────────────────────────────────╮
|
|
|
|
│ --version Show the version and exit. │
|
|
|
|
│ --install-completion Install completion for the current shell. │
|
|
|
|
│ --show-completion Show completion for the current shell, to copy │
|
|
|
|
│ it or customize the installation. │
|
|
|
|
│ --help Show this message and exit. │
|
2022-12-01 17:18:02 +00:00
|
|
|
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
|
|
╭─ Commands ───────────────────────────────────────────────────────────────────╮
|
2023-01-24 19:06:39 +00:00
|
|
|
│ delete Delete uploaded files if tokens are found on disk at │
|
|
|
|
│ `token_cache_dir`. │
|
|
|
|
│ files Upload one or more files. If one is provided by the 0x0 site used │
|
|
|
|
│ on a successful upload, a management token will be printed to │
|
|
|
|
│ stderr along with instructions on how to use it to delete or adjust │
|
|
|
|
│ the expiration time on the uploaded file(s). If │
|
|
|
|
│ `--token-cache-dir` is passed or `OXO_TOKEN_CACHE_DIR` is set, the │
|
|
|
|
│ management token will also be cached as a json file in that │
|
|
|
|
│ directory. The cache directory will be created on first use. │
|
|
|
|
│ repost Repost one or more urls. │
|
|
|
|
│ shorten Shorten one or more urls. │
|
2022-12-01 17:18:02 +00:00
|
|
|
╰──────────────────────────────────────────────────────────────────────────────╯
|
2021-06-23 20:53:51 +00:00
|
|
|
|
2022-12-01 17:18:02 +00:00
|
|
|
#+end_example
|
2022-12-02 22:05:19 +00:00
|
|
|
#+begin_src bash :results output replace :tangle no
|
|
|
|
oxo files --help
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+RESULTS:
|
|
|
|
#+begin_example
|
|
|
|
|
|
|
|
Usage: oxo files [OPTIONS] FILES...
|
|
|
|
|
2022-12-07 23:18:57 +00:00
|
|
|
Upload one or more files. If one is provided by the 0x0 site used on a
|
|
|
|
successful upload, a management token will be printed to stderr along with
|
|
|
|
instructions on how to use it to delete or adjust the expiration time on the
|
|
|
|
uploaded file(s). If `--token-cache-dir` is passed or `OXO_TOKEN_CACHE_DIR`
|
|
|
|
is set, the management token will also be cached as a json file in that
|
|
|
|
directory. The cache directory will be created on first use.
|
2022-12-02 22:05:19 +00:00
|
|
|
|
|
|
|
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
|
|
|
|
│ * files FILES... [default: None] [required] │
|
|
|
|
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
|
|
╭─ Options ────────────────────────────────────────────────────────────────────╮
|
2023-02-11 02:01:00 +00:00
|
|
|
│ --use-long-name --no-use-long-name If true, create a harder │
|
|
|
|
│ to guess name. │
|
|
|
|
│ [default: │
|
|
|
|
│ no-use-long-name] │
|
|
|
|
│ --base-url TEXT [env var: OXO_BASE_URL] │
|
|
|
|
│ [default: │
|
|
|
|
│ https://0x0.st] │
|
|
|
|
│ --expires INTEGER Expiration time, in │
|
|
|
|
│ hours or epoch │
|
|
|
|
│ milliseconds │
|
|
|
|
│ [default: None] │
|
|
|
|
│ --token-cache-dir TEXT [env var: │
|
|
|
|
│ OXO_TOKEN_CACHE_DIR] │
|
|
|
|
│ [default: None] │
|
|
|
|
│ --help Show this message and │
|
|
|
|
│ exit. │
|
2022-12-02 22:05:19 +00:00
|
|
|
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
|
|
|
|
|
|
#+end_example
|
|
|
|
|
|
|
|
#+begin_src bash :results output replace :tangle no
|
|
|
|
oxo repost --help
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+RESULTS:
|
|
|
|
#+begin_example
|
|
|
|
|
|
|
|
Usage: oxo repost [OPTIONS] URLS...
|
|
|
|
|
|
|
|
Repost one or more urls.
|
|
|
|
|
|
|
|
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
|
|
|
|
│ * urls URLS... [default: None] [required] │
|
|
|
|
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
|
|
╭─ Options ────────────────────────────────────────────────────────────────────╮
|
2023-02-11 02:01:00 +00:00
|
|
|
│ --use-long-name --no-use-long-name If true, create a harder │
|
|
|
|
│ to guess name. │
|
|
|
|
│ [default: │
|
|
|
|
│ no-use-long-name] │
|
|
|
|
│ --base-url TEXT [env var: OXO_BASE_URL] │
|
|
|
|
│ [default: │
|
|
|
|
│ https://0x0.st] │
|
|
|
|
│ --expires INTEGER Expiration time, in │
|
|
|
|
│ hours or epoch │
|
|
|
|
│ milliseconds │
|
|
|
|
│ [default: None] │
|
|
|
|
│ --token-cache-dir TEXT [env var: │
|
|
|
|
│ OXO_TOKEN_CACHE_DIR] │
|
|
|
|
│ [default: None] │
|
|
|
|
│ --help Show this message and │
|
|
|
|
│ exit. │
|
2022-12-02 22:05:19 +00:00
|
|
|
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
|
|
|
|
|
|
#+end_example
|
|
|
|
|
|
|
|
#+begin_src bash :results output replace :tangle no
|
|
|
|
oxo shorten --help
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+RESULTS:
|
|
|
|
#+begin_example
|
|
|
|
|
|
|
|
Usage: oxo shorten [OPTIONS] URLS...
|
|
|
|
|
|
|
|
Shorten one or more urls.
|
|
|
|
|
|
|
|
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
|
|
|
|
│ * urls URLS... [default: None] [required] │
|
|
|
|
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
|
|
╭─ Options ────────────────────────────────────────────────────────────────────╮
|
2023-01-24 19:06:39 +00:00
|
|
|
│ --base-url TEXT [env var: OXO_BASE_URL] │
|
|
|
|
│ [default: https://0x0.st] │
|
|
|
|
│ --expires INTEGER Expiration time, in hours or epoch │
|
|
|
|
│ milliseconds │
|
|
|
|
│ [default: None] │
|
|
|
|
│ --token-cache-dir TEXT [env var: OXO_TOKEN_CACHE_DIR] │
|
|
|
|
│ [default: None] │
|
|
|
|
│ --help Show this message and exit. │
|
2022-12-02 22:05:19 +00:00
|
|
|
╰──────────────────────────────────────────────────────────────────────────────╯
|
2022-12-14 23:45:27 +00:00
|
|
|
|
|
|
|
#+end_example
|
|
|
|
#+begin_src bash :results output replace :tangle no
|
|
|
|
oxo delete --help
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
#+RESULTS:
|
|
|
|
#+begin_example
|
|
|
|
|
|
|
|
Usage: oxo delete [OPTIONS] [TOKEN_CACHE_DIR]
|
|
|
|
|
|
|
|
Delete uploaded files if tokens are found on disk at `token_cache_dir`.
|
|
|
|
|
|
|
|
╭─ Arguments ──────────────────────────────────────────────────────────────────╮
|
|
|
|
│ token_cache_dir [TOKEN_CACHE_DIR] [env var: OXO_TOKEN_CACHE_DIR] │
|
|
|
|
╰──────────────────────────────────────────────────────────────────────────────╯
|
|
|
|
╭─ Options ────────────────────────────────────────────────────────────────────╮
|
|
|
|
│ --interactive --no-interactive If True, prompt for each token found. │
|
|
|
|
│ [default: no-interactive] │
|
|
|
|
│ --help Show this message and exit. │
|
|
|
|
╰──────────────────────────────────────────────────────────────────────────────╯
|
2022-12-02 22:05:19 +00:00
|
|
|
|
|
|
|
#+end_example
|
|
|
|
|
2022-12-01 17:31:44 +00:00
|
|
|
** Installation
|
|
|
|
*** pipx
|
|
|
|
[[https://pypa.github.io/pipx/][pipx]] automates the creation of isolated runtimes for python CLI utilities like
|
|
|
|
=oxo=. Once =pipx= is installed, install =oxo= like so, and it'll be on your
|
|
|
|
=$PATH=
|
|
|
|
#+begin_src bash
|
|
|
|
pipx install git+https://tildegit.org/grym/oxo@master # or @tag-of-your-choice
|
|
|
|
#+end_src
|
|
|
|
*** pip + venv
|
|
|
|
If you'd prefer to create or manage your own isolated runtime for =oxo=, create
|
|
|
|
a venv and install =oxo= into it:
|
|
|
|
#+begin_src bash
|
|
|
|
python3 -m venv oxovenv #or wherever you want the venv to go
|
|
|
|
oxovenv/bin/pip install git+https://tildegit.org/grym/oxo@master # or @tag-of-your-choice
|
|
|
|
ln -s oxovenv/bin/oxo ${HOME}/.local/bin # optionally add to here, or anywhere else on your $PATH
|
|
|
|
#+end_src
|
|
|
|
*** development
|
|
|
|
If you'd like to set up a development install to edit oxo on your own (to
|
|
|
|
prepare a PR, for example):
|
|
|
|
#+begin_src bash
|
|
|
|
git clone https://tildegit.org/grym/oxo
|
|
|
|
cd oxo
|
|
|
|
make install
|
|
|
|
#+end_src
|