--- /dev/null
+#+TITLE: Composing Kubectl Commands in Style with Kubed
+#+SUBTITLE: Tight integration with the command line in my new Emacs package for Kubernetes
+#+DESCRIPTION: A post by Eshel Yaron about tight integration with the command line Kubed, a new Emacs package for Kubernetes
+#+KEYWORDS: emacs,kubed,kubernetes
+#+DATE: 2024-07-31
+
+@@html:<div class="metadata">@@Created on [{{{date}}}], last updated [{{{modification-time(%Y-%m-%d, t)}}}]@@html:</div>@@
+
+Last week I [[https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg01175.html][announced]] my new Emacs interface for Kubernetes, /Kubed/,
+on the Emacs development mailing list. So far working on Kubed has
+been a lot of fun, and in this post I want to highlight a feature that
+I find especially delightful.
+
+First I should mention that Kubed uses ~kubectl~ to interact with
+Kubernetes. This is similar to how Magit uses the ~git~ program to
+interact with, well, Git. One of the design goals for Kubed is to
+provide the full power of ~kubectl~: if you can do it with ~kubectl~
+you can do it with Kubed, too. For many common operations, Kubed
+provides a much nicer experience than what you would get by running
+~kubectl~ in a terminal, but ~kubectl~ is abundant with subcommands
+and flags and options, and for some use cases the versatility of the
+command line is irreplaceable.
+
+So rather than hiding the ~kubectl~ command line deep under the hood,
+Kubed embraces and enhances it.
+
+[[file:../assets/kubed-1.png]]
+
+The command ~kubed-kubectl-command~ lets you invoke a quick ~kubectl~
+command line whenever you need it. Emacs minibuffer completion is
+hooked directly to the hidden ~kubectl~ subcommand ~__complete~ which
+gives you the same completions you get in the shell. In fact, this
+~__complete~ subcommand is not unique to ~kubectl~, it's an artifact
+of the Golang CLI framework that ~kubectl~ uses, [[https://github.com/spf13/cobra/blob/main/completions.go][Cobra]]. This
+framework is very widespread in the Go ecosystem, and since Kubed's
+command line completion uses Cobra's shell-agnostic completion
+interface, it Just Works with any Cobra program!
+
+# [[file:../assets/kubed-2.png]]
+
+[[file:../assets/kubed-docker.png]]
+
+[[file:../assets/kubed-helm.png]]
+
+You can summon ~kubed-kubectl-command~ from the menu-bar "Kubernetes"
+menu (enable ~kubed-menu-bar-mode~ to see that menu first), and if you
+have the prefix keymap ~kubed-prefix-map~ bound to e.g. ~C-c k~, then
+you can also invoke ~kubed-kubectl-command~ by typing ~C-c k !~.
+
+#+attr_html: :height 250px
+[[file:../assets/kubed-3.png]]
+
+But the real magic happens when you call this command from one of the
+Kubed /transient menus/. These keyboard-driven menus let you compose
+complex Kubernetes operations with an intuitive interface, and all
+Kubed transient menus bind the ~!~ key to ~kubed-kubectl-command~.
+When you invoke ~kubed-kubectl-command~ from a transient menu, it
+automatically populates your initial command line according to the
+transient menu you came from and the options you've set there.
+
+[[file:../assets/kubed-4.png]]
+
+[[file:../assets/kubed-5.png]]
+
+That's pretty cool, I think. In particular it means that you can
+always start by exploring the Kubed transient menus, and if the exact
+operation you want to carry out doesn't have a dedicated Kubed
+command, then you can hit ~!~ to seamlessly drop to the right
+~kubectl~ command line.
+
+That's it for now! If you feel like giving Kubed go, you can grab it
+from [[https://git.sr.ht/~eshel/kubed][here]], or clone it one of the following mirrors:
+
+- https://github.com/eshelyaron/kubed.git
+- git://git.eshelyaron.com/kubed.git