gravitational / teleport

The easiest, and most secure way to access and protect all of your infrastructure.
https://goteleport.com
GNU Affero General Public License v3.0
17.37k stars 1.74k forks source link

tsh * ls output improvements with addition of columns flag. #34618

Open TeleLos opened 10 months ago

TeleLos commented 10 months ago

What would you like Teleport to do?

If the resource name is too long the *tsh ls** terminal output will truncate the resource Name column output.

teleport-gravitational-cloud-production-docke...

As an improvement to our tsh cli output we have a recommendation to support an optional column flag. For example, the customer could issue command: % tsh db ls --column=Name and the output would be just the name column of the resources

Example output

Name teleport-gravitational-cloud-production-docker-latest-mysql-node-us-east-1 workmac-docker-mysql-test

What problem does this solve?

Customer is looking for more user friendly method to get full name in the *tsh ls** output.

If a workaround exists, please include it.

Option 1: Using the json and json processor tool can be used to extract just the name fields using: tsh db ls --format=json | jq '.[].metadata.name'

Option 2: Depending on the character size used and terminal tool, you can expand the terminal tool window horizontally to get a more complete name output. This works with iterm2.

zmb3 commented 10 months ago

Alternatively, consider a --format=go-template option like kubectl does