Crates.io | kith |
lib.rs | kith |
version | 0.1.2 |
source | src |
created_at | 2024-07-11 19:53:04.193362 |
updated_at | 2024-07-11 21:24:52.982268 |
description | A TUI for accessing Teleport databases |
homepage | |
repository | |
max_upload_size | |
id | 1299965 |
size | 1,779,248 |
This is a small Terminal UI I have been wanting for some time to quickly access various PostgreSQL databases across Teleport.
This comes from a frustration that tsh
's output for database instances is a table of text and not structured data (JSON, etc.).
The program pulls down the database instances your user has access to, parses it and offers prompts to navigate through your instances. The goal is enable you to easily see the details of an instance and to connect without needing to memorize user permissions or database names.
The program's flow follows three main steps in a cyclical fashion:
Due to the single objective of the program, this simple game loop is sufficient.
Once all connection values are filled out, the program spawns a new terminal with a Teleport database session and breaks itself.
Releases are handled via GitHub Actions leveraging release-plz. Currently distribution is only done through crates.io, this is less overhead than building and zipping binaries for various architectures (this also assumes you have Rust and Cargo installed).
cargo install kith
With the full command:
KITH_TSH_PROXY="<YOUR-PROXY-VALUE>" KITH_TSH_CLUSTER="<YOUR-CLUSTER-VALUE>" kith
You can also set it and forget it with a small shell alias. Here's an example for zsh:
echo 'alias kith="KITH_TSH_PROXY="<YOUR-PROXY-VALUE>" KITH_TSH_CLUSTER="<YOUR-CLUSTER-VALUE>" kith"' >> ~/.zshrc
source ~/.zshrc
Then run with:
kith
Clone the repo and fill out your Teleport values under .env
. See .example.env
for variable names.
make run
make info
make debug
cargo uninstall kith
This small tool is barely an MVP:
rustfmt
should probably be used eventually).Once this tool is useable for my daily workflow, I will most likely stop developping it in order to move on to other miscellaneous side projects. If you wish to add any functionality, feel free to fork the repo!
Here's an example of the TUI when using fake data locally: