tanzu-cli icon indicating copy to clipboard operation
tanzu-cli copied to clipboard

non interactive cli

Open ysineil opened this issue 1 year ago • 5 comments

Please provide the ability to make the cli non interactive and have the ability to configure per system not only per user.

Trying to automate tasks with a ci/cd pipeline with this cli is challenging at best.

ysineil avatar Feb 02 '24 05:02 ysineil

It appears as though setting up a new context can be completed in a non-interactive way, however, the ability to set up a context system wide compared to per user would be a great addition:

$env:TANZU_API_TOKEN = "<redacted_api_token>" ; $env:TANZU_CLI_CEIP_OPT_IN_PROMPT_ANSWER = 'no' ; tanzu config eula accept ; tanzu context create --endpoint "<redacted_site>" --name "<redacted_name>"

dogseye avatar Feb 02 '24 15:02 dogseye

Hi @ysineil. Thanks for the request. The Tanzu CLI should be 100% automatable today but it’s possible some flags or environment variables needed are not well documented.

Could you provide some examples that are causing you problems?

marckhouzam avatar Feb 03 '24 13:02 marckhouzam

@dogseye do I understand correctly that you would like the CLI to be prefilled with the context? So one person creates it for the whole team for example.

This sounds interesting. Could you open a different issue for this?

marckhouzam avatar Feb 03 '24 13:02 marckhouzam

@marckhouzam - I'd say this all stems from having to set a context for each user, happy for this issue to be just for that ability. I'll open another issue should we encounter specific commands/issues with automating using the tanzu cli as we migrate from the tkg cli.

The tkg cli was a lot more user-friendly (it was not documented well either) and simple in comparison, so it was a much easier process to get things automated.

ysineil avatar Feb 06 '24 03:02 ysineil

@ysineil I don’t believe the tkg CLI allowed a shared setup, did it? Was it the login command that made things easier?

marckhouzam avatar Feb 06 '24 11:02 marckhouzam