@@ -8,26 +8,56 @@ Connecting to a Tarantool instance
88 $ tt connect {URI|INSTANCE} [OPTION ...]
99
1010
11- ``tt connect `` connects to a Tarantool instance by its URI or name specified
12- during its startup (`` tt start ``) .
11+ ``tt connect `` connects to a Tarantool instance by its URI or instance name specified
12+ in the current environment .
1313
1414Options
1515-------
1616
1717.. option :: -u USERNAME , --username USERNAME
1818
19- Username
19+ A Tarantool user for connecting to the instance.
2020
2121.. option :: -p PASSWORD , --password PASSWORD
2222
23- Password
23+ The user's password.
2424
2525.. option :: -f FILEPATH , --file FILEPATH
2626
2727 Connect and evaluate the script from a file.
2828
2929 ``- `` – read the script from stdin.
3030
31+ .. option :: -i , --interactive
32+
33+ Enter the interactive mode after evaluating the script passed in ``-f ``/``--file ``.
34+
35+ .. option :: -l LANGUAGE , --language LANGUAGE
36+
37+ The input language of the :ref: `tt interactive console <tt-interactive-console >`:
38+ ``lua `` (default) or ``sql ``.
39+
40+ .. option :: -x FORMAT , --outputformat FORMAT
41+
42+ The output format of the :ref: `tt interactive console <tt-interactive-console >`:
43+ ``yaml `` (default), ``lua ``, ``table ``, ``ttable ``.
44+
45+ .. option :: --sslcertfile FILEPATH
46+
47+ The path to an SSL certificate file for encrypted connections.
48+
49+ .. option :: --sslkeyfile FILEPATH
50+
51+ The path to a private SSL key file for encrypted connections.
52+
53+ .. option :: --sslcafile FILEPATH
54+
55+ The path to a trusted certificate authorities (CA) file for encrypted connections.
56+
57+ .. option :: --sslciphers STRING
58+
59+ The list of SSL cipher suites used for encrypted connections, separated by colons (``: ``).
60+
3161Details
3262-------
3363
@@ -38,14 +68,57 @@ You can also connect to instances in the same ``tt`` environment
3868(that is, those that use the same :ref: `configuration file <tt-config_file >` and Tarantool installation)
3969by their instance names.
4070
41- If authentication is required, specify the username and the password using the ``-u `` (``--username ``)
42- and ``-p `` (``--password ``) options.
71+ Authentication
72+ ~~~~~~~~~~~~~~
73+
74+ When connecting to an instance by its URI, ``tt connect `` establishes a remote connection
75+ for which authentication is required. Use one of the following ways to pass the
76+ username and the password:
77+
78+ * The ``-u `` (``--username ``) and ``-p `` (``--password ``) options:
79+
80+ .. code-block :: console
4381
44- By default, ``tt connect `` opens an interactive Tarantool console. Alternatively, you
45- can open a connection to evaluate a Lua script from a file or stdin. To do this,
46- pass the file path in the ``-f `` (``--file ``) option or use ``-f - `` to take the script
47- from stdin.
82+ $ tt connect 192.168.10.10:3301 -u myuser -p p4$$w0rD
83+
84+ * The connection string:
85+
86+ .. code-block :: console
87+
88+ $ tt connect myuser:[email protected] :3301 -u myuser -p p4$$w0rD 89+
90+ * Environment variables ``TT_CLI_USERNAME `` and ``TT_CLI_PASSWORD `` :
91+
92+ .. code-block :: console
93+
94+ $ export TT_CLI_USERNAME=myuser
95+ $ export TT_CLI_PASSWORD=p4$$w0rD
96+ $ tt connect 192.168.10.10:3301
97+
98+ If no credentials are provided for a remote connection, the user is automatically ``guest ``.
99+
100+ .. note ::
101+
102+ Local connections (by instance name instead of the URI) don't require authentication.
103+
104+ Encrypted connection
105+ ~~~~~~~~~~~~~~~~~~~~
106+
107+ To connect to instances that use SSL encryption, provide the SSL certificate and
108+ SSL key files in the ``--sslcertfile `` and ``--sslkeyfile `` options. If necessary,
109+ add other SSL parameters -- ``--sslcafile `` and ``--sslciphers ``.
110+
111+ Script evaluation
112+ ~~~~~~~~~~~~~~~~~
113+
114+ By default, ``tt connect `` opens an :ref: `interactive tt console <tt-interactive-console >`.
115+ Alternatively, you can open a connection to evaluate a Lua script from a file or stdin.
116+ To do this, pass the file path in the ``-f `` (``--file ``) option or use ``-f - ``
117+ to take the script from stdin.
118+
119+ .. code-block :: console
48120
121+ $ tt connect app -f test.lua
49122
50123 Examples
51124--------
0 commit comments