Quick Start

The main feature of v2raycli is listed as below

1
v2raycli -h
1
2
3
4
5
6
7
8
9
Usage: v2raycli [OPTIONS] COMMAND [ARGS]...

Options:
  -v, --version  Show v2raycli's version information.
  -h, --help     Show this message and exit.

Commands:
  list  List information of current subscription.
  run   Start a proxy connections in subscription.

List Proxy Sites in Subscription

Before starting using v2raycli, you need a subscription url from your proxy service (such as justmysocks). Then put this url into V2RAY_SUBSCRIPTION environment (e.g. in linux)

1
2
# Use your own subscription url
export V2RAY_SUBSCRIPTION='https://jmssub.net/members/getsub.php?service=777777&id=4c646243-6c01-42f4-a4f1-eef212b2e659'

Then you can see the proxy sites in subscription you given.

1
v2raycli list
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
+-----+----------------------------------------------------------------------------------------------+
|   # | Subscription Site                                                                            |
|-----+----------------------------------------------------------------------------------------------|
|   1 | https://jmssub.net/members/getsub.php?service=777777&id=4c646243-6c01-42f4-a4f1-eef212b2e659 |
+-----+----------------------------------------------------------------------------------------------+
+-----+-------+---------------------------------------+-------------+-----------------------+
|   # |   Sub | Name                                  | Protocol    | Address               |
|-----+-------+---------------------------------------+-------------+-----------------------|
|   1 |     1 | JMS-267288@c21s1.jamjams3.net:22890   | shadowsocks | 176.122.175.196:22890 |
|   2 |     1 | JMS-267288@c21s2.jamjams3.net:22890   | shadowsocks | 176.122.177.36:22890  |
|   3 |     1 | JMS-267288@c21s3.jamjams3.net:22890   | vmess       | 216.24.185.154:22890  |
|   4 |     1 | JMS-267288@c21s4.jamjams3.net:22890   | vmess       | 212.50.248.23:22890   |
|   5 |     1 | JMS-267288@c21s5.jamjams3.net:22890   | vmess       | 104.193.8.12:22890    |
|   6 |     1 | JMS-267288@c21s801.jamjams3.net:22890 | vmess       | 174.137.58.128:22890  |
+-----+-------+---------------------------------------+-------------+-----------------------+

Or using the -s argument

1
v2raycli list -s 'https://jmssub.net/members/getsub.php?service=777777&id=4c646243-6c01-42f4-a4f1-eef212b2e659'

Other arguments can be shown with -h argument.

1
v2raycli list -h
1
2
3
4
5
6
7
8
Usage: v2raycli list [OPTIONS]

  List information of current subscription.

Options:
  -s, --subscription TEXT  Subscription of proxy sites, can be assigned in env
                           'V2RAY_SUBSCRIPTION'.
  -h, --help               Show this message and exit.

Start Local Proxy Service

Before starting the proxy service locally, you need to configure the executable file of v2ray (you can download this from v2ray/dist on Github):

1
2
# Use your own v2ray binary executable
export V2RAY_BIN=./bin/v2ray

After the configuration is complete, the service can be started locally

1
2
3
v2raycli run                   # Start the proxy (socks5 protocol, port 17777)
v2raycli run -P http -p 16384  # Start at port 16384 with http protocol
v2raycli run -R                # DO NOT ASK ME! Just randomly use one site

The other arguments can be shown with -h argument.

1
v2raycli run -h
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Usage: v2raycli run [OPTIONS]

  Start a proxy connections in subscription.

Options:
  -s, --subscription TEXT         Subscription of proxy sites, can be assigned
                                  in env 'V2RAY_SUBSCRIPTION'.
  -p, --port INTEGER              Port to start the v2ray local service.
                                  [default: 17777]
  -P, --protocol [socks|http]     Protocol to start the v2ray local service.
                                  [default: socks]
  -e, --executable FILE           V2Ray executable file, can be assigned in
                                  env 'V2RAY_BIN'.  [required]
  -R, --random                    Randomly choose a site to connect to without
                                  interaction.
  -L, --loglevel [DEBUG|INFO|WARN|ERROR]
                                  Log level for v2raycli and v2ray core.
                                  [default: INFO]
  --check_site TEXT               Site to connect for checking the proxy
                                  service.  [default: https://pixiv.net]
  --check_interval INTEGER        Interval in seconds of checking the proxy
                                  service  [default: 300]
  -h, --help                      Show this message and exit.