diff --git a/doc/reference/tt_cli/check.rst b/doc/reference/tt_cli/check.rst new file mode 100644 index 0000000000..808ea0b42f --- /dev/null +++ b/doc/reference/tt_cli/check.rst @@ -0,0 +1,34 @@ +Checking an application file +============================ + +.. code-block:: bash + + tt check APP_FILE + +``tt check`` checks the specified Tarantool application file for syntax errors. + +Details +------- + +``tt`` searches for ``APP_FILE`` inside the ``instances_available`` directory +specified in the :ref:`tt configuration file `. ``APP_FILE`` can be: + +* the name of an application file without the ``.lua`` extension. +* the name of a directory containing the ``init.lua`` file. In this case, ``init.lua`` is checked. + + +Examples +-------- + +* Check the syntax of the ``app.lua`` file from the ``instances_available`` directory: + + .. code-block:: bash + + tt check app + + +* Check the syntax of the ``init.lua`` file from the ``instance1/`` directory inside ``instances_available``: + + .. code-block:: bash + + tt check instance1 \ No newline at end of file diff --git a/doc/reference/tt_cli/commands.rst b/doc/reference/tt_cli/commands.rst index 3b03d3379c..0e6eb2fbf2 100644 --- a/doc/reference/tt_cli/commands.rst +++ b/doc/reference/tt_cli/commands.rst @@ -26,11 +26,11 @@ help for the given command. - Generate completion for a specified shell * - :doc:`help ` - Display help for ``tt`` or a specific command - * - ``logrotate`` - - :ref:`Rotate logs ` - * - ``check`` + * - :doc:`logrotate ` + - Rotate instance logs + * - :doc:`check ` - Check an application file for syntax errors - * - ``connect`` + * - :doc:`connect ` - Connect to a Tarantool instance * - ``rocks`` - Use the LuaRocks package manager @@ -49,3 +49,6 @@ help for the given command. version completion help + logrotate + check + connect \ No newline at end of file diff --git a/doc/reference/tt_cli/connect.rst b/doc/reference/tt_cli/connect.rst new file mode 100644 index 0000000000..51e86875ae --- /dev/null +++ b/doc/reference/tt_cli/connect.rst @@ -0,0 +1,81 @@ +Connecting to a Tarantool instance +================================== + +.. code-block:: bash + + tt connect URI|INSTANCE_NAME [flags] + + +``tt connect`` connects to a Tarantool instance by its URI or name specified +during its startup (``tt start``). + +Flags +----- + +.. container:: table + + .. list-table:: + :widths: 30 70 + :header-rows: 0 + + * - ``-u`` + + ``--username`` + - Username + * - ``-p`` + + ``--password`` + - Password + * - ``-f`` + + ``--file`` + - Connect and evaluate the script from a file. + + ``-`` – read the script from stdin. + +Details +------- + +To connect to an instance, ``tt`` typically needs its URI -- the host name or IP address +and the port. + +You can also connect to instances in the same ``tt`` environment +(that is, those that use the same :ref:`configuration file ` and Tarantool installation) +by their instance names. + +If authentication is required, specify the username and the password using the ``-u`` (``--username``) +and ``-p`` (``--password``) options. + +By default, ``tt connect`` opens an interactive Tarantool console. Alternatively, you +can open a connection to evaluate a Lua script from a file or stdin. To do this, +pass the file path in the ``-f`` (``--file``) option or use ``-f -`` to take the script +from stdin. + + +Examples +-------- + +* Connect to the ``app`` instance in the same environment: + + .. code-block:: bash + + tt connect app + +* Connect to the ``192.168.10.10`` host on port ``3301`` with authentication: + + .. code-block:: bash + + tt connect 192.168.10.10:3301 -u myuser -p p4$$w0rD + +* Connect to the ``app`` instance and evaluate the code from the ``test.lua`` file: + + .. code-block:: bash + + tt connect app -f test.lua + +* Connect to the ``app`` instance and evaluate the code from stdin: + + .. code-block:: bash + + echo "function test() return 1 end" | tt connect app -f - # Create the test() function + echo "test()" | tt connect app -f - # Call this function \ No newline at end of file diff --git a/doc/reference/tt_cli/logrotate.rst b/doc/reference/tt_cli/logrotate.rst new file mode 100644 index 0000000000..ae8322d2be --- /dev/null +++ b/doc/reference/tt_cli/logrotate.rst @@ -0,0 +1,18 @@ +Rotate instance logs +==================== + +.. code-block:: bash + + tt logrotate INSTANCE + +``tt logrotate`` rotates logs of a specified Tarantool instance. +Learn more about :ref:`rotating logs `. + +Examples +-------- + +Rotate logs of the ``app`` instance: + +.. code-block:: bash + + tt logrotate app \ No newline at end of file diff --git a/doc/reference/tt_cli/start.rst b/doc/reference/tt_cli/start.rst index 7a705c77db..f3e2e370fa 100644 --- a/doc/reference/tt_cli/start.rst +++ b/doc/reference/tt_cli/start.rst @@ -7,16 +7,17 @@ Starting a Tarantool instance tt start INSTANCE -``tt start`` starts the specified Tarantool :ref:`instance `. +``tt start`` starts a Tarantool instance from an application file. Details ------- -``INSTANCE`` is the name of an instance from the ``instances_available`` directory -specified in the :ref:`tt configuration file `. This can be: +The application file must be stored inside the ``instances_available`` +directory specified in the :ref:`tt configuration file `. +The ``INSTANCE`` value can be: -* the name of an :ref:`instance file ` without the ``.lua`` extension. -* the name of a directory containing the ``init.lua`` file. +* the name of an application file without the ``.lua`` extension. +* the name of a directory containing the ``init.lua`` file. In this case, the instance is started from ``init.lua``. Examples