TimescaleDB CLI is a command-line tool designed to simplify some operations within TimescaleDB instances. This unofficial tool is built to make the developers life easier. It does that by providing a terminal-based interface for common operations and automation tasks.
It is pretty simple to use it.
Add the configuration to the config file pointing to your DB instances
timescale config add staging --host db.timescale.staging --database tsdb --port 5433 --password pass --user postgres
List configurated environments
timescale config ls
Check if the configuration is valid and connect the database
timescale config check
Remove configured environment
timescale config rm staging
List aggregations from specified timescale instance
timescale aggregation ls
timescale aggregation ls --hypertable metrics
timescale aggregation ls --view-name %hourly
timescale aggregation ls --hypertable metrics --view-name %hourly
Refreshes hypertables from start to end using filters for view or hypertable.
timescale aggregation refresh --env staging --start 2023-01-01 --end 2023-02-01
# Refreshes all continuous aggregations from hypertable metrics from 2023-01-01 to 2023-02-01
timescale aggregation refresh --start 2023-01-01 --end 2023-02-01 --hypertable metrics
# Refreshes all continuous aggregations ending with hourly from 2023-01-01 to 2023-02-01
timescale aggregation refresh --start 2023-01-01 --end 2023-02-01 --view-name %hourly
# Refreshes all continuous aggregations ending with hourly from 2023-01-01 to 2023-02-01
# incrementing 7 days each call
timescale aggregation refresh --start 2023-01-01 --end 2023-02-01 --view-name %hourly --pace 7
List the hypertables, giving the main information about it.
timescale hypertable ls
timescale hypertable ls --name %hourly
Compress chunks manually from a start to end. (TODO)
timescale hypertable compress --from 2023-01-01 --to 2024-01-01
timescale hypertable compress --name %_metrics --from 2023-01-01 --to 2024-01-01
Give detailed information about the hypertable, like how many chunks it has. (TODO)
timescale hypertable inspect metrics