summaryrefslogtreecommitdiff
path: root/cli/README.md
blob: 00c175a7797725289d79657517058eb4976d75d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
```
╭───────────────────────────────────────────╮
│    *            ▄▄█████▄▄            *    │
│               ▄████▀▀▀████▄     *         │
│              ▀▀█▀       ▀██▄              │
│      *      ▄█▄          ▀██▄             │
│           ▄█████▄         ███        -+-  │
│             ███         ▀█████▀           │
│             ▀██▄          ▀█▀             │
│         *    ▀██▄       ▄█▄▄     *        │
│ *             ▀████▄▄▄████▀               │
│                 ▀▀█████▀▀                 │
│             -+-                     *     │
│   ▄▀▄               ▄▀▀ █                 │
│   █ █     ▀         ▀▄  █                 │
│   █ █ █▀▄ █ ▄▀▄ █▀▄  ▀▄ █▀▄ ▄▀▄ █▄▀ ▄█▄   │
│   ▀▄▀ █ █ █ ▀▄▀ █ █ ▄▄▀ █ █ ▀▄█ █   ▀▄▄   │
│                                           │
│          https://onionshare.org/          │
╰───────────────────────────────────────────╯
```

## Installing OnionShare CLI

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`.

### Requirements

Debian/Ubuntu (APT):
```sh
sudo apt-get install tor python3-pip
```

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
```

#### Set path

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:

First, discover what shell you are using:

```sh
echo $SHELL
```

Then apply the path to your shell file:

bash:

```sh
echo "PATH=\$PATH:~/.local/bin" >> ~/.bashrc
source ~/.bashrc
```

zsh:

```sh
echo "PATH=\$PATH:~/.local/bin" >> ~/.zshrc
source ~/.zshrc
```

#### Usage

Then run it with:

```sh
onionshare-cli --help
```

## Developing OnionShare CLI

You must have python3 and [poetry](https://python-poetry.org/) installed.

Install dependencies with poetry:

```sh
poetry install
```

To run from the source tree:

```sh
poetry run onionshare-cli
```

To run tests:

```sh
poetry run pytest -v ./tests
```

## Build a wheel package

```sh
poetry build
```

This will create `dist/onionshare_cli-$VERSION-py3-none-any.whl`.