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

Add PowerShell friendly CLI #1139

Closed
soroshsabz opened this issue Oct 29, 2021 · 7 comments
Closed

Add PowerShell friendly CLI #1139

soroshsabz opened this issue Oct 29, 2021 · 7 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@soroshsabz
Copy link

soroshsabz commented Oct 29, 2021

ITNOA

Description of the new feature/enhancement

As you can know PowerShell is great Scripting Language for Automation and Administration of system. and it is built for Object-oriented scripting.

Kubernetes API, on the other hand, is also completely object-oriented, so I think it is very good for kubectl to get compatible with PowerShell and make native PowerShell Cmdlet.

In this area we can see below command instead of Linux legacy CLI style like kubectl get node

  • Get-Node

And all of them is object and we can work with them in OOP area with modern and great and consistent experience in PowerShell World.

Proposed technical implementation details (optional)

I think PowerShell has many guideline and documentation about writing and designing great Cmdlet and modules that winget-cli teams have to follow it for example

Windows PowerShell Cmdlet Concepts
Writing a Windows PowerShell Module
PowerShell Script Module Design: Building Tools to Automate the Process
Powershell: DSL design patterns

VMWare PowerCLI is an example for similar large scale software that use PowerShell for CLI.

@soroshsabz soroshsabz added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 29, 2021
@k8s-ci-robot
Copy link
Contributor

@soroshsabz: This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Oct 29, 2021
@soroshsabz
Copy link
Author

soroshsabz commented Oct 29, 2021

I found a good work for doing this in Native Commands in PowerShell – A New Approach

As you can see in above, author of blog post can build many of kubectl commands in PowerShell with very clean approach

https://www.powershellgallery.com/packages/Microsoft.PowerShell.KubeCtl/0.0.3

Announcing PowerShell Crescendo

@eddiezane
Copy link
Member

All of the autocomplete functionality (and cli bits) for kubectl is provided through the Go library Cobra.

It doesn't look like this is something Cobra provides yet https://github.com/spf13/cobra/blob/master/shell_completions.md#powershell-completions - or would it need to be separate entirely?

QOL improvements for Powershell users are certainly something we'd consider merging if a PR surfaced.

Might be worth tagging @JamesWTruher.

cc @marckhouzam

@marckhouzam
Copy link
Member

IIUC this is something different than command completion. I'm not very familiar with PowerShell but it may be an improvement than could possibly be generic enough to be done on Cobra so that it would be available to many clis. Having something working in kubectl or another project would be a good proof that such a feature works well.

Someone would need to step up and do the work however.

@soroshsabz
Copy link
Author

@eddiezane It is very beyond than just auto complete, it is about new culture of CLI.

@eddiezane
Copy link
Member

Thanks for explaining!

I'd recommend opening this in Cobra if you want to get the ball rolling.

/close

@k8s-ci-robot
Copy link
Contributor

@eddiezane: Closing this issue.

In response to this:

Thanks for explaining!

I'd recommend opening this in Cobra if you want to get the ball rolling.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

4 participants