Skip to content

Provide two usage mode - standalone and kubectl#49

Merged
bpradipt merged 1 commit into
confidential-devhub:mainfrom
bpradipt:multi-use
Jun 8, 2026
Merged

Provide two usage mode - standalone and kubectl#49
bpradipt merged 1 commit into
confidential-devhub:mainfrom
bpradipt:multi-use

Conversation

@bpradipt

@bpradipt bpradipt commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

The binary name is cococtl for standalone.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the project to support two usage modes from a single binary: a standalone CLI (cococtl) and a kubectl plugin invocation (kubectl coco) via symlinks, aligning the documentation and build/install workflow with the new primary binary name.

Changes:

  • Renames the primary built binary to cococtl and installs kubectl-coco / kubectl_complete-coco as symlinks.
  • Updates CLI root command naming behavior based on the invoked binary name (standalone vs plugin).
  • Refreshes README installation and completion instructions for the two invocation styles.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
README.md Updates docs to describe cococtl as the primary binary and explains standalone vs kubectl plugin usage and completion setup.
Makefile Builds cococtl and installs symlinks for kubectl-coco and kubectl_complete-coco.
cmd/root.go Adjusts Cobra root command Use based on invocation name to support both modes.
cmd/completion.go Reworks completion generation to support both command names and documents plugin completion behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Makefile Outdated
@@ -1,7 +1,9 @@
.PHONY: build install clean test eval eval-offline help release release-all lint
Comment thread cmd/completion.go
Comment on lines +111 to 113
// Determine the __start_<name> function cobra registered above.
startFn := "__start_" + rootCmd.Use

Comment thread README.md Outdated
```

**Installation:**
**Step 2 — Install cococtl completion** (covers `cococtl`, `kubectl-coco`, `kubectl_coco`):
Comment thread cmd/completion.go
Comment on lines +20 to +23
There are two independent completion mechanisms:

Install bash-completion.
1. Generated script — covers 'cococtl', 'kubectl-coco', and 'kubectl_coco'.
Source this file once (see below).
Comment thread README.md Outdated
```

Install kubectl-coco completion:
**Step 2 — Install cococtl completion** (covers `cococtl`, `kubectl-coco`, `kubectl_coco`):
Comment thread cmd/completion.go Outdated
Comment on lines +78 to +80
Install completion (covers cococtl, kubectl-coco, and kubectl_coco):
$ cococtl completion zsh > "${fpath[1]}/_cococtl"

Comment thread Makefile Outdated
Comment on lines +51 to +53
@echo "Installation complete."
@echo " Standalone CLI : cococtl"
@echo " kubectl plugin : kubectl coco"
The binary name is cococtl for standalone.

Signed-off-by: Pradipta Banerjee <pradipta.banerjee@gmail.com>
@bpradipt bpradipt merged commit 4cc6e60 into confidential-devhub:main Jun 8, 2026
3 checks passed
@bpradipt bpradipt deleted the multi-use branch June 8, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants