The YTsaurus CLI (Command Line Interface) is the most convenient way to interact with the YTsaurus system from the console. The CLI fully implements the features of all the commands supported by YTsaurus. The name of the command is specified as the first argument followed by its options. To get help on the CLI, just run the command:
yt --help yt read --help
To work with a cluster, you need to get an access token and put it in the
~/.yt/token file or the
YT_TOKEN environment variable.
For more information about the tokens and authentication, see the Authentication section.
In addition to the access token, you need to specify the cluster to work with. To do this, you can specify the proxy server name in the
YT_PROXY environment variable:
export YT_PROXY=<cluster-name> or pass the proxy server name to each command individually via the
proxy option, such as
Below are some features of the CLI:
All underscores in command and option names were replaced by hyphens.
output_table_pathsare specified via the
To specify multiple columns for sort or reduce, pass the
reduce-byoption several times, for example,
--sort-by a --sort-by bwill sort by composite key
If you write
--sort-by a,b, sorting by one column named
a,bwill be performed.
writecommand writes data chunk-by-chunk and under the transaction.
There is a
findcommand (implemented on top of get) which partially replicates the unix find utility.
By default, the
listcommand (without specifying the
--formatparameter) just enters a list of node elements, each on a separate string. It also has the
-loption that will enter useful information about the nodes along with their names.
By default, any files uploaded into YTsaurus are uploaded without the executable flag. If you want to upload a binary file that will run in a job, you must specify the
--executableoption when uploading or set the
/@executable=trueattribute after uploading.
The formats of the data received at the command input and appearing at the command output can be specified through the following environment variables:
YT_ARGUMENTS_FORMAT: Manages the format for the values of the options of the
--attributestype. The default value is
YT_STRUCTURED_DATA_FORMAT: Manages the format of the get/set command. The default value is
YT_TABULAR_DATA_FORMAT: Manages the format of reading/writing tables, as well as starting operation jobs. There is no default value, the variable value must be set explicitly or the
--formatoption must be specified.
There is a method to create aliases for commands. Aliases are specified in the
mkdir=create map_node ls=list rm=remove mv=move cp=copy
Auto-completion of binary file commands and paths for bash is supported.