-
Notifications
You must be signed in to change notification settings - Fork 43
Add tt CLI docs #2973
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tt CLI docs #2973
Changes from all commits
708af1d
019d470
06104b1
32f4f14
6cf5da6
d30902a
1cefc51
a250d11
babb752
f7e40a1
bb2594c
13b1f24
a7558b3
da55a35
1597a41
954a414
b6b6388
df669ab
ae28d14
a77322c
e203fe7
98596ba
b0e3645
91506dd
b41c637
6e2b397
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Arguments | ||
========= | ||
|
||
``tt`` has the following arguments: | ||
|
||
.. container:: table | ||
|
||
.. list-table:: | ||
:widths: 40 60 | ||
:header-rows: 0 | ||
|
||
* - ``--cfg=FILE`` | ||
|
||
``-c=FILE`` | ||
- Path to the :ref:`configuration file <tt-config_file>`. | ||
* - ``--internal`` | ||
|
||
``-i`` | ||
- Force the use of an internal module even if there is an external module with the same name. | ||
|
||
.. // TODO: add link to external modules doc page when it's ready | ||
* - ``--local=DIRECTORY`` | ||
|
||
``-L=DIRECTORY`` | ||
- Use the ``tt`` environment from the specified directory. | ||
Learn more about the :ref:`local launch mode <tt-config_modes-local>`. | ||
* - ``--system`` | ||
|
||
``-S`` | ||
- Use the ``tt`` environment installed in the system. | ||
Learn more about the :ref:`system launch mode <tt-config_modes-system>`. | ||
* - ``--help`` | ||
|
||
``-h`` | ||
- Display help. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Commands | ||
======== | ||
|
||
Below is a list of `tt` commands. Run ``tt COMMAND help`` to see the detailed | ||
help for the given command. | ||
|
||
.. container:: table | ||
|
||
.. list-table:: | ||
:widths: 30 70 | ||
:header-rows: 0 | ||
|
||
* - ``start`` | ||
- Start a Tarantool :ref:`instance <admin-instance_file>` | ||
* - ``stop`` | ||
- Stop a Tarantool instance | ||
* - ``status`` | ||
- Get the current status of a Tarantool instance | ||
* - ``restart`` | ||
- Restart a Tarantool instance | ||
* - ``version`` | ||
- Show the ``tt`` version information | ||
* - ``completion`` | ||
- Generate autocompletion for a specified shell | ||
* - ``help`` | ||
- Display help for ``tt`` or a specific command | ||
* - ``logrotate`` | ||
- :ref:`Rotate logs <admin-logs>` | ||
LeonidVas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* - ``check`` | ||
- Check an application file for syntax errors | ||
* - ``connect`` | ||
- Connect to a Tarantool instance | ||
* - ``rocks`` | ||
- Use the LuaRocks package manager | ||
* - ``cat`` | ||
- Print the contents of ``.snap`` or ``.xlog`` files into stdout | ||
* - ``play`` | ||
- Play the contents of ``.snap`` or ``.xlog`` files to another Tarantool instance |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
Configuration | ||
============= | ||
|
||
.. _tt-config_file: | ||
|
||
Configuration file | ||
------------------ | ||
|
||
The key artifact that defines the ``tt`` environment and various aspects of its | ||
execution is its configuration file. | ||
|
||
By default, the configuration file is called ``tarantool.yaml``. The location | ||
where ``tt`` searches for it depends on the :ref:`launch mode <tt-config_modes>`. | ||
You can also pass the configuration file explicitly in the ``--cfg`` | ||
:doc:`argument <arguments>`. | ||
|
||
The ``tt`` configuration file is a YAML file with the following content: | ||
|
||
.. code:: yaml | ||
|
||
tt: | ||
modules: | ||
directory: path/to/modules/dir | ||
app: | ||
instances_available: path/to/available/applications | ||
run_dir: path/to/run_dir | ||
log_dir: path/to/log_dir | ||
log_maxsize: num (MB) | ||
log_maxage: num (days) | ||
log_maxbackups: num | ||
restart_on_failure: bool | ||
|
||
modules section | ||
~~~~~~~~~~~~~~~ | ||
|
||
* ``directory`` -- the directory where external modules are stored. | ||
.. // TODO: add link to external modules doc page when it's ready | ||
|
||
app section | ||
~~~~~~~~~~~ | ||
|
||
* ``instances_available`` -- the directory where :ref:`instances <admin-instance_file>` | ||
are stored. | ||
* ``run_dir``-- the directory for instance runtime artifacts, such as console | ||
sockets or PID files. | ||
* ``log_dir`` -- the directory where log files are stored. | ||
* ``log_maxsize`` -- the maximum size of the log file before it gets rotated, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a tip: make sure to cross-link to the |
||
in megabytes. Default: 100. | ||
* ``log_maxage`` -- the maximum age of log files in days. The age of a log | ||
file is defined by the timestamp encoded in its name. Default: not defined | ||
(log files aren't deleted based on their age). | ||
|
||
.. note:: | ||
|
||
A day is defined as exactly 24 hours. It may not exactly correspond to | ||
calendar days due to daylight savings, leap seconds, and other time adjustments. | ||
|
||
* ``log_maxbackups`` -- the maximum number of stored log files. | ||
Default: not defined (log files aren't deleted based on their count). | ||
* ``restart_on_failure`` -- restart the instance on failure: ``true`` or ``false``. | ||
Default: ``false``. | ||
|
||
.. _tt-config_modes: | ||
|
||
Launch modes | ||
------------ | ||
|
||
``tt`` launch mode defines its working directory and the way it searches for the | ||
configuration file. There are three launch modes: | ||
|
||
* default | ||
* system | ||
* local | ||
|
||
Default launch | ||
~~~~~~~~~~~~~~ | ||
|
||
**Argument**: none | ||
|
||
**Configuration file**: searched from the current directory to the root. | ||
Taken from ``/etc/tarantool`` if the file is not found. | ||
|
||
**Working directory**: The directory where the configuration file is found. | ||
|
||
.. _tt-config_modes-system: | ||
|
||
System launch | ||
~~~~~~~~~~~~~ | ||
|
||
**Argument**: ``--system`` or ``-S`` | ||
|
||
**Configuration file**: Taken from ``/etc/tarantool``. | ||
|
||
**Working directory**: Current directory. | ||
|
||
.. _tt-config_modes-local: | ||
|
||
Local launch | ||
~~~~~~~~~~~~ | ||
|
||
**Argument**: ``--local=DIRECTORY`` or ``-L=DIRECTORY`` | ||
|
||
**Configuration file**: Searched from the specified directory to the root. | ||
Taken from ``/etc/tarantool`` if the file is not found. | ||
|
||
**Working directory**: The specified directory. If ``tarantool`` or ``tt`` | ||
executable files are found in the working directory, they will be used. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
tt CLI utility | ||
============== | ||
|
||
``tt`` is a utility that provides a unified command-line interface for managing | ||
Tarantool-based applications. It covers a wide range of tasks -- from installing | ||
a specific Tarantool version to managing remote instances and developing applications. | ||
|
||
A multi-purpose tool for working with Tarantool from the command line, ``tt`` is | ||
a potential replacement for :doc:`tarantoolctl </reference/tarantoolctl>` | ||
and :doc:`Cartridge CLI </book/cartridge/cartridge_cli/index>`. | ||
|
||
.. warning:: | ||
|
||
As of Tarantool 2.10, ``tt`` is in the early development stage. It includes | ||
only basic functionality and may be unstable. We don't recommend using it | ||
in production environments. Check out the list of :doc:`supported commands <commands>`. | ||
|
||
To use ``tt``, you need to build it from sources. | ||
See :doc:`Installation <installation>` for details. | ||
|
||
.. toctree:: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm sorry, I don't understand what it is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's a doc engine command to generate the table of contents – the list of pages inside the |
||
:maxdepth: 1 | ||
:numbered: 0 | ||
|
||
installation | ||
configuration | ||
arguments | ||
commands |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Installation | ||
============ | ||
|
||
To install the ``tt`` command-line utility: | ||
|
||
1. Install third-party software required for building ``tt``: | ||
|
||
* `git <https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>`__, | ||
the version control system. | ||
* `Go language <https://golang.org/doc/install>`__, version 1.18 or later. | ||
* `mage <https://magefile.org/>`__ build tool. | ||
|
||
2. Clone the `tarantool/tt <https://github.com/tarantool/tt>`_ repository: | ||
|
||
.. code-block:: bash | ||
|
||
git clone https://github.com/tarantool/tt --recursive | ||
|
||
3. Go to the ``tt/`` directory and build ``tt`` using mage: | ||
|
||
.. code-block:: bash | ||
|
||
cd tt | ||
mage build | ||
|
||
``tt`` will appear in the current directory. | ||
|
||
Enabling shell completion | ||
------------------------- | ||
|
||
To enable the completion for ``tt`` commands, run the following command specifying | ||
the shell (``bash`` or ``zsh``): | ||
|
||
.. code-block:: bash | ||
|
||
. <(tt completion bash) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why parentheses? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if that's normal or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, fixed the layout