CLI Reference
The document below, covers the major commands and sub-commands to work with Tabsdata Command Line Interface (CLI). For more options, please use -h/--help option in the CLI to obtain the full list and description of commands and their options.
Tabsdata provides 2 CLI tools:
tdserver- Tabsdata Server CLItd- Tabsdata Client CLI
Tabsdata Server CLI tdserver
The tdserver CLI is used to manage the Tabsdata server.
It provides the following commands:
start- Start the Tabsdata server.stop- Stop the Tabsdata server.status- Get the status of the Tabsdata server.logs- Get the logs of the Tabsdata server.
Note: You can use tdserver status --metrics to access the report on disk utilization.
Tabsdata Client CLI td
The td CLI is used to interact with a Tabsdata server.
The td CLI works with options and in interactive mode if the options are not provided.
Interactive Mode
By default, the td CLI enters interactive mode if there is a required option that is missing.
To disable interactive mode, use the --no-prompt option immediately after the td command.
Login to Server
td login --server localhost:2457 --username <USER> --role <ROLE> --password <PASSWORD>
Default:
td login --server localhost:2457 --username admin --role sys_admin --password tabsdata
The port number is optional, if not provided, the default port number 2457 is used.
User, role and password immediately after installation are admin, sys_admin and tabsdata respectively.
The user session token is stored in the ~/.tabsdata.connection.json directory.
After a successful login, the user remains logged in until the td logout command is executed or
until the session expires (2 hours after login)
Logout from Server
td logout
Terminates the current session if any.
User Sub-Commands
Create a User
td user create <NAME> --password <PASSWORD> --full-name <FULL_NAME> --email <EMAIL>
Password must be at least 8 characters long.
Show User Info
td user info <NAME>
List Users
td user list
Update User
td user update <NAME> -full-name <NEW_FULL_NAME> --email <NEW_EMAIL>
Password must be at least 8 characters long.
Delete User
td user delete <NAME> -confirm delete
Collection Management Commands
Collection Sub-Commands
td collection create --name <NAME> --description <DESCRIPTION>
Password must be at least 8 characters long.
Show Collection Info
td collection info --name <NAME>
List Collections
td collection list
Update Collection
td collection update --name <NAME> --new-name <NEW_NAME> --description <NEW_DESCRIPTION>
Functions Sub-Commands
Register a Function
td fn register --coll examples --path <PYTHON_FILE>::<PYTHON_FUNCTION>
--description <DESCRIPTION> --local-pkg <LOCAL_PACKAGE_PATH>
--requirements <REQUIREMENTS_TXT_PATH>
Use the --local-pkg option to specify the path to local packages not available in PyPi.
Use the --requirements option to specify the path to a requirements.txt file switching
off automatic requirements detection.
Update a Function
td fn update --coll examples --name <FUNCTION>
--path <PYTHON_FILE>::<PYTHON_FUNCTION>
--description <DESCRIPTION> --local-pkg <LOCAL_PACKAGE_PATH>
--requirements <REQUIREMENTS_TXT_PATH>
Use the --local-pkg option to specify the path to local packages not available in PyPi.
Use the --requirements option to specify the path to a requirements.txt file switching
off automatic requirements detection.
Show Function Info (current)
td fn info --coll <COLLECTION> --name <FUNCTION>
Show Function Info History
td fn info --coll <COLLECTION> --name <FUNCTION> --history
List Functions
td fn list --coll <COLLECTION>
Execution Management Sub-Commands
Trigger a Function
td fn trigger --coll <COLLECTION> --name <FUNCTION>
Listing Transactions
td exe list-trx
Listing Execution Plans
td exe list-plan
Listing Workers
td exe list-worker --<BY> <ID>
Where option <BY> can be (only one can be used in a single command):
--data-vermust be the data version ID the worker generated. --planmust be the execution plan ID that runs the worker. --fnmust be the function ID of the worker. --trxmust be the transaction that runs the worker.
Cancel a Transaction
td exe cancel --trx <TRX_ID>
It cancels a running or failed transaction. All workers of the transaction will be discarded,
regardless of their status and any data generated by them will be discarded as well.
All transactions that are dependent on data of the canceled transaction will be canceled as well.
Recover a Transaction
td exe recover --trx <TRX_ID>
It recovers a failed transaction. All workers in failed or hold state will be retried.
All transactions that are dependent and where on hold will be retried as well.
Viewing the logs of a Worker
td exe logs --worker <WORKER_ID>
Use the td exe list-trx, td exe list-plan, and td exe list-worker to find the desired worker ID.
View Table Data
View A Table Schema
td table schema --coll <COLLECTION> --name <TABLE>
View A Table Sample
td table sample --coll <COLLECTION> --name <TABLE>
Download A Table Data
td table download --coll <COLLECTION> --name <TABLE> --file <FILE>