Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab completion should also look at the Kargo API #1860

Open
3 tasks done
christianh814 opened this issue Apr 17, 2024 · 3 comments
Open
3 tasks done

Tab completion should also look at the Kargo API #1860

christianh814 opened this issue Apr 17, 2024 · 3 comments

Comments

@christianh814
Copy link
Member

Checklist

  • I've searched the issue queue to verify this is not a duplicate feature request.
  • I've pasted the output of kargo version, if applicable.
  • I've pasted logs, if applicable.

Proposed Feature

When using kargo cli, the tab completion should also look at the API that the CLI auth'ed against. Similar to Kubernetes.

Currently:

$ kargo get projects kargo<TAB>
kargo/             kargo-render.yaml 

^ These are local files.

Where as in Kubernetes

$ kubectl get namespaces kargo<tab>
kargo       kargo-demo

^ Those are namespaces (what I actually want)

It would be nice if I could get this.

$ kargo get projects kargo<tab>
kargo-demo

^ tabs out to just show the current projects.

All subcommands should follow this.

Motivation

Make it act more like Kubernetes and other CLI tools.

Suggested Implementation

A good place to look is the kubectl code. Not sure what's involved

@krancour
Copy link
Member

krancour commented Apr 18, 2024

@christianh814 I've wanted this as well. Thanks for opening the issue.

@hiddeco or @jessesuen in case you know what's involved. I do not.

This definitely won't get into v0.6.0.

@hiddeco
Copy link
Contributor

hiddeco commented Apr 18, 2024

This is done through "dynamic completion" in Cobra (https://github.com/spf13/cobra/blob/v1.6.x/shell_completions.md#dynamic-completion-of-nouns).

@krancour
Copy link
Member

@hiddeco tried that just now to satisfy my own curiosity and wasn't able to get it working. Maybe when time permits, you can show me what I am doing wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants