kubectl VS cli

Compare kubectl vs cli and see what are their differences.

kubectl

Issue tracker and mirror of kubectl code (by kubernetes)

cli

GitHub’s official command line tool (by cli)
Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
kubectl cli
13 252
2,664 34,999
2.0% 1.8%
9.2 9.7
about 17 hours ago 7 days ago
Go Go
Apache License 2.0 MIT License
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

kubectl

Posts with mentions or reviews of kubectl. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-05-02.
  • Setting kubectl context via env var
    6 projects | /r/kubernetes | 2 May 2023
    I have read this issue, and up to now it seems not possible to change the kubectl context via an env var: https://github.com/kubernetes/kubectl/issues/1154
  • Deciding between Rust or Go for desktop applications
    9 projects | /r/golang | 8 Apr 2023
    However, I would encourage people to take a look at what the code looks like before assuming the Go developer experience on this was positive. Bear in mind that's just the top level kubectl command and some helper functions, the subcommand definitions take up a several more files split into a few more packages. Then you're still not even done, because code that uses the parsed flags still has to redundantly check things that couldn't be enforced at the type level, something Go folks like to pretend is a good thing for some reason.
  • Recommendations on file/dir/module structure, common dependencies, and/or anti-patterns for writing CLI tool in Rust
    12 projects | /r/rust | 18 Mar 2023
    kubectl is for sure battle tested, but it involves very Kubernetes specific implementations and is going to be too complicated for the first pointer
  • Recommendations on building a simple DSL REPL?
    5 projects | /r/golang | 18 Mar 2023
  • Why Go and Not Rust?
    4 projects | news.ycombinator.com | 27 Jan 2023
    > context.Background() is typically only used when one doesn’t care about the result. If you did care about the result, you should be passing the parent context to preserve the circuit breaker timeout in case the operation takes too long.

    Not necessarily. You would use context.Background in a test situation. It's also commonly used for short-lived applications like a CLI invocation. You can see kubectl uses context.Background quite a lot: https://github.com/kubernetes/kubectl/search?q=context.backg...

    > I think the level of pain you experience from mutable references in Rust depends on if you’re coming from an OOP or FP background. I have a FP background and so the patterns I use to build code already greatly restrict mutation. You can usually change code that updates data immutably (creating a new copy of it) with mutable code in rust because the control flow of your program already involves passing that new version back to the caller which also satisfies the borrow checker in most situations.

    There has to be a better solution to needlessly copying data.

  • What's the number one annoyance that drives you crazy about Kubernetes?
    7 projects | /r/kubernetes | 25 Jan 2022
    Go add --no-really-all if you really want it: https://github.com/kubernetes/kubectl
  • Looking for a tutorial or a resource to write good looking CLI applications
    4 projects | /r/golang | 22 Jul 2021
    - https://github.com/kubernetes/kubectl
  • Best examples of a Go client
    13 projects | /r/golang | 1 May 2021
    I haven't looked at the code all that much, but kubectl does a heck of a lot, and you can't argue that it's not battle-tested.
  • client-go retrieve pods event
    2 projects | /r/kubernetes | 13 Mar 2021
    The canonical example client-go app you're most familiar with is kubectl. https://github.com/kubernetes/kubectl/blob/e69a10320e34fd2487b61927f69affbb52e4f0e1/pkg/describe/describe.go#L279 is the kubectl describe kind name... bit that deals with fetching events related the object with that kind/name.

cli

Posts with mentions or reviews of cli. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-02-16.
  • pyaction 4.28.0 Released
    3 projects | dev.to | 16 Feb 2024
    GitHub CLI 2.44.1
    3 projects | dev.to | 16 Feb 2024
    This Docker image is designed to support implementing Github Actions with Python. As of version 4.0.0., it starts with the official python docker image as the base which is a Debian OS. It specifically uses python:3-slim to keep the image size down for faster loading of Github Actions that use pyaction. On top of the base, we've installed curl gpg, git, and the GitHub CLI. We added curl and gpg because they are needed to install the GitHub CLI, and they may come in handy anyway (especially curl) when implementing a GitHub Action.
  • The Ladybird Browser Project
    8 projects | news.ycombinator.com | 6 Feb 2024
    You might be interested in GitHub's cli tool, which is open source, if you want to access GitHub without running their proprietary JS code.

    https://cli.github.com/

  • Essential Command Line Tools for Developers
    29 projects | dev.to | 15 Jan 2024
    View on GitHub
  • NixOS has one fatal flaw
    3 projects | news.ycombinator.com | 15 Dec 2023
    (Context: I'm pretty thick into Nix, and have been for about four years. Most of this post is focussed on the NixOS desktop experience, so DevOps nerds, ymmv.)

    Unpopular opinion: Nix is not that hard.

    What's "hard" from a nix-promotion strategy is motivating people to understand why they would want the benefits it offers. Mostly because Nix, especially with home-manager, dramatically worsens UX for several day-to-day tasks, simply by violating the Law of Least Surprise every couple of hours in normal use.

    I want a fully idempotent, version-locked, rewindable user environment, with a version-controlled central config, because I have half a dozen devices that, for reasons, I need to keep perfectly interchangeable with one another. Most users do not want this, for the simple fact that mutating their configs and differentiating them locally on specific machines is not a bug, but a feature.

    Even more than that, it's an expectation that most software developers share as well.

    Case in point: I filed a bug against the GitHub CLI last week. If any org has the scope and motivation to build software that's compatible with NixOS, an OS most of whose users are developers, it should be GitHub, which is, at least notionally, all about developers, developers, developers. A change in GH required a config format migration, which was sensibly done by opening the config .yml and rewriting it.

    Of course, this breaks NixOS not just in practice but in principle. NixOS/home-manager makes config files read-only. Surprise! https://github.com/cli/cli/issues/8462

    The response from GitHub was basically, "yeah, we knew this was going to happen, we mentioned it to the packagers at NixOS, but we did it anyway, because it was still the best way to proceed for us." (And they weren't wrong.)

    Now, once a month is an annoyance, but I run into these problems daily. I can't imagine any sane person -- which I am not -- would persist with using it.

    Why do I keep using NixOS, then? Because I am terribly and disproprotionately annoyed by small changes in my user experience, which I find disruptive to my workflow and hence threaten my success. For me, forbidding apps from mutating the config files I established for them is a selling point. Being able to version-control an idempotent declarative config for all of them at once is heaven.

    Unless you're like me, you'll hate NixOS. But some were meant for Nix.

    Because

  • pyaction 4.27.0 Released
    2 projects | dev.to | 8 Dec 2023
    GitHub CLI 2.40.0
    2 projects | dev.to | 8 Dec 2023
    This Docker image is designed to support implementing Github Actions with Python. As of version 4.0.0., it starts with the official python docker image as the base which is a Debian OS. It specifically uses python:3-slim to keep the image size down for faster loading of Github Actions that use pyaction. On top of the base, we've installed curl gpg, git, and the GitHub CLI. We added curl and gpg because they are needed to install the GitHub CLI, and they may come in handy anyway (especially curl) when implementing a GitHub Action.
  • Everything I install and set up on a new MacBook as a web developer
    6 projects | dev.to | 5 Dec 2023
    Two CLI tools I install right away are the GitHub CLI (via brew) and the Netlify CLI (via npm).
  • I (kind of) killed Mercurial at Mozilla
    12 projects | news.ycombinator.com | 21 Nov 2023
    From the second article, a minor point but possibly helpful to other here, he contrasts doing everything in the terminal with stacked commits vs going to the Github UI. If people aren't aware, Github offers a cli tool[1]. I've been using it for a few months now and am finding it does make me more productive -- it's nice to be able to open up a PR directly from my terminal. I do still use the GH UI for a lot of things, but I'll often at least start in the terminal, and it also makes the transition from terminal to browser easy as many commands support the `--web` flag open up the right page for you (eg `gh repo view --web`).

    [1] https://cli.github.com/

  • Getting Started with GitHub Copilot in the CLI🚀
    3 projects | dev.to | 17 Nov 2023
    To install copilot in the cli, you must first install GitHub CLI and complete authentication in an OAuth browser window. Since I'm on macOS, I used homebrew as my package manager:

What are some alternatives?

When comparing kubectl and cli you can also consider the following projects:

cobra - A Commander for modern Go CLI interactions

helm - The Kubernetes Package Manager

gh.vim - Vim/Neovim plugin for GitHub

glab - The GitLab CLI tool. Archived: now officially adopted by GitLab as the official CLI tool and maintained at https://gitlab.com/gitlab-org/cli. See https://github.com/profclems/glab/issues/983

vscode-dev-containers - NOTE: Most of the contents of this repository have been migrated to the new devcontainers GitHub org (https://github.com/devcontainers). See https://github.com/devcontainers/template-starter and https://github.com/devcontainers/feature-starter for information on creating your own!

octo.nvim - Edit and review GitHub issues and pull requests from the comfort of your favorite editor

cockroach - CockroachDB - the open source, cloud-native distributed SQL database.

dnSpy - .NET debugger and assembly editor [Moved to: https://github.com/dnSpy/dnSpy]

canarytokens - Canarytokens helps track activity and actions on your network.

mitchellh/cli - A Go library for implementing command-line interfaces.

elvish - Powerful scripting language & Versatile interactive shell

gqlgen - go generate based graphql server library