2020-10-13 01:40:55 -04:00
```
2021-05-04 00:49:42 -04:00
╭───────────────────────────────────────────╮
│ * ▄▄█████▄▄ * │
│ ▄████▀▀▀████▄ * │
│ ▀▀█▀ ▀██▄ │
│ * ▄█▄ ▀██▄ │
│ ▄█████▄ ███ -+- │
│ ███ ▀█████▀ │
│ ▀██▄ ▀█▀ │
│ * ▀██▄ ▄█▄▄ * │
│ * ▀████▄▄▄████▀ │
│ ▀▀█████▀▀ │
│ -+- * │
│ ▄▀▄ ▄▀▀ █ │
│ █ █ ▀ ▀▄ █ │
│ █ █ █▀▄ █ ▄▀▄ █▀▄ ▀▄ █▀▄ ▄▀▄ █▄▀ ▄█▄ │
│ ▀▄▀ █ █ █ ▀▄▀ █ █ ▄▄▀ █ █ ▀▄█ █ ▀▄▄ │
│ │
│ https://onionshare.org/ │
╰───────────────────────────────────────────╯
2020-10-13 01:40:55 -04:00
```
## Installing OnionShare CLI
2021-08-30 16:54:24 -04:00
First, make sure you have `tor` and `python3` installed. In Linux, install it through your package manager. In macOS, install it with [Homebrew ](https://brew.sh ): `brew install tor` . Second, OnionShare is written in python, and you can install the command line version use python's package manager `pip` .
2020-10-13 01:40:55 -04:00
2021-08-30 16:54:24 -04:00
### Requirements
2020-10-13 01:40:55 -04:00
2021-08-30 16:54:24 -04:00
Debian/Ubuntu (APT):
2020-10-15 19:30:30 -04:00
```sh
2021-08-30 16:54:24 -04:00
sudo apt-get install tor python3-pip
2020-10-13 01:40:55 -04:00
```
2021-08-30 16:54:24 -04:00
Arch (Pacman):
```sh
sudo pacman -S tor python-pip
```
CentOS, Red Hat, and Fedora (Yum):
```sh
sudo yum install tor python3 python3-wheel
```
macOS (Homebrew):
```sh
brew install tor python
sudo easy_install pip
```
### Main
#### Installation
Install OnionShare CLI:
```sh
pip install --user onionshare-cli
```
2021-08-30 16:56:25 -04:00
#### Set path
2021-08-30 16:54:24 -04:00
2021-09-11 02:10:37 -04:00
When you install programs with pip and use the `--user` flag, it installs them into *~/.local/bin* , which isn't in your path by default. To add *~/.local/bin* to your path automatically for the next time you reopen the terminal or source your shell configuration file, do the following:
2021-08-30 16:54:24 -04:00
2021-09-11 02:10:37 -04:00
Apply the path to your shell file:
2021-08-30 16:54:24 -04:00
```sh
2021-09-11 02:10:37 -04:00
printf "PATH=\$PATH:~/.local/bin\n" >> ~/.${SHELL##*/}rc
2021-09-20 11:21:05 -04:00
. ~/.${SHELL##*/}rc
2021-08-30 16:54:24 -04:00
```
#### Usage
2020-10-13 01:40:55 -04:00
Then run it with:
2020-10-15 19:30:30 -04:00
```sh
2020-10-13 01:40:55 -04:00
onionshare-cli --help
```
## Developing OnionShare CLI
You must have python3 and [poetry ](https://python-poetry.org/ ) installed.
Install dependencies with poetry:
2020-10-15 19:30:30 -04:00
```sh
2020-10-13 01:40:55 -04:00
poetry install
```
To run from the source tree:
2020-10-15 19:30:30 -04:00
```sh
2020-10-13 01:40:55 -04:00
poetry run onionshare-cli
```
To run tests:
2020-10-15 19:30:30 -04:00
```sh
2020-10-14 23:42:20 -04:00
poetry run pytest -v ./tests
2020-10-13 01:40:55 -04:00
```
2020-10-15 19:30:30 -04:00
## Build a wheel package
```sh
poetry build
```
This will create `dist/onionshare_cli-$VERSION-py3-none-any.whl` .