Skip to content

refactor: rename binary to kdn#200

Merged
feloy merged 4 commits intoopenkaiden:mainfrom
feloy:kdn1
Apr 8, 2026
Merged

refactor: rename binary to kdn#200
feloy merged 4 commits intoopenkaiden:mainfrom
feloy:kdn1

Conversation

@feloy
Copy link
Copy Markdown
Contributor

@feloy feloy commented Apr 8, 2026

  • Rename the binary generated to kdn instead of kortex-cli and adapt Makefile / goreleaser cfg
  • Replace kortex-cli with kdn in the inline help
  • change name in README, website, doc for agents (AGENTS.md, skills)

Fixes #193

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

📝 Walkthrough

Walkthrough

Renames the CLI binary and all user-facing references from kortex-cli to kdn across build/release config, Makefile, Cobra command metadata/help/examples, example parsing/adaptation, tests, docs, and CI workflow invocations.

Changes

Cohort / File(s) Summary
Build & CI
/.gitignore, /.goreleaser.yaml, /Makefile, /.github/workflows/pr-checks.yml
Changed build artifact path and GoReleaser build binary from kortex-clikdn, updated Makefile targets to build/install kdn, and CI verify step to run ./kdn version.
CLI Entry & Tests
cmd/kdn/main_test.go, pkg/cmd/root_test.go, pkg/cmd/terminal_test.go
Updated tests to expect/invoke kdn as the CLI invocation name instead of kortex-cli.
Cobra Commands
pkg/cmd/root.go, pkg/cmd/version.go, pkg/cmd/info.go, pkg/cmd/init.go, pkg/cmd/...workspace*.go
Replaced displayed CLI name in Use, Short, Long, and Example strings with kdn; updated --storage flag description to reference kdn. No runtime logic changes.
Helpers & Validation
pkg/cmd/helpers.go, pkg/cmd/testutil/example_validator.go
Adjusted example-adaptation and example-parsing to accept kdn as the binary/token; updated inline docs and error messages.
Tests: examples & validators
pkg/cmd/helpers_test.go, pkg/cmd/testutil/example_validator_test.go
Rewrote test fixtures and expectations to use kdn in example strings and parsed command binaries; assertions adjusted accordingly.
Documentation & Skills
AGENTS.md, README.md, skills/**, website/WEBSITE.md, website/mkdocs.yml
Replaced kortex-cli with kdn in README, AGENTS.md, skills guides, and site metadata/branding; updated examples and narrative references. No code changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 15.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The description directly addresses the changeset by explaining the binary rename, build configuration updates, help text changes, and documentation updates, with a clear reference to the fixed issue.
Linked Issues check ✅ Passed The pull request successfully addresses all requirements from issue #193: the binary is renamed from kortex-cli to kdn, build/release configs are updated, all code references are changed, and documentation is updated throughout.
Out of Scope Changes check ✅ Passed All changes in the pull request are directly related to renaming kortex-cli to kdn across build configs, code, tests, documentation, and examples with no extraneous modifications.
Title check ✅ Passed The PR title accurately summarizes the main change: renaming the binary from kortex-cli to kdn across the entire codebase.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
cmd/kdn/main_test.go (1)

26-32: ⚠️ Potential issue | 🟡 Minor

Add t.Parallel() as the first line of this test.

This touched test does not currently satisfy the test parallelization rule.

Suggested patch
 func TestMain_VersionSubcommand(t *testing.T) {
+	t.Parallel()
+
 	// Save original os.Args and restore after test
 	oldArgs := os.Args
 	defer func() { os.Args = oldArgs }()

As per coding guidelines, **/*_test.go: “All tests must call t.Parallel() as the first line of the test function, except tests using t.Setenv() which cannot use t.Parallel() on the parent test function”.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/kdn/main_test.go` around lines 26 - 32, The TestMain_VersionSubcommand
test must call t.Parallel() as its first statement; edit the
TestMain_VersionSubcommand function to insert t.Parallel() immediately after the
function opening (before saving/restoring os.Args and before any calls to
t.Setenv(), etc.) so the test runs under the test parallelization rule.
pkg/cmd/workspace.go (1)

25-31: ⚠️ Potential issue | 🟠 Major

Please add an Example section (and matching examples test) to workspace command.

This command currently has Args but no Example field in its Cobra definition.

As per coding guidelines: pkg/cmd/*.go: “All Go commands must include an Example field with usage examples and have a corresponding Test<Command>Cmd_Examples test function”.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/cmd/workspace.go` around lines 25 - 31, Add an Example string to the
Cobra command returned by NewWorkspaceCmd (set the Command.Example field with
one or more usage lines demonstrating common usage of the "workspace" command)
and add a matching test named TestWorkspaceCmd_Examples that verifies the
Example is present and validates the examples (e.g., asserts command.Example is
non-empty and/or runs any example snippets as appropriate for your test
harness). Update NewWorkspaceCmd to include the Example field and create the
TestWorkspaceCmd_Examples test function in the package tests to satisfy the
coding guideline.
🧹 Nitpick comments (1)
pkg/cmd/helpers.go (1)

45-47: Avoid hardcoding kdn in alias adaptation guard.

This helper is now coupled to one executable name. It will silently stop adapting examples if the binary prefix changes again or if command lines are formatted differently.

Suggested patch
-		// Only replace in command lines (starting with kdn), not in comments
-		if strings.HasPrefix(trimmed, "kdn ") {
+		// Replace only in non-comment command lines that contain the original command fragment.
+		if !strings.HasPrefix(trimmed, "#") && strings.Contains(trimmed, " "+originalCmd) {
 			line = strings.Replace(line, originalCmd, aliasCmd, 1)
 		}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/cmd/helpers.go` around lines 45 - 47, The guard currently hardcodes "kdn"
which breaks adaptation if the binary name or formatting changes; update the
condition to detect the actual command prefix dynamically (e.g., use
strings.HasPrefix(trimmed, originalCmd+" ") and also check the base executable
name via path.Base(originalCmd)+ " " to handle paths) before calling
strings.Replace; modify the code around the existing check that uses trimmed,
originalCmd and aliasCmd so it no longer relies on the literal "kdn" string.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@pkg/cmd/version.go`:
- Around line 26-34: NewVersionCmd is missing an Example usage string and the
corresponding example test; add an Example field to the returned *cobra.Command
in NewVersionCmd() (showing typical usage like "kdn version" and expected
output) and add a test named TestVersionCmd_Examples that exercises the examples
using testing.Example or verifies the Example output; ensure the Example text is
realistic, formatted exactly as shown in help, and the test asserts the example
runs without failure.

---

Outside diff comments:
In `@cmd/kdn/main_test.go`:
- Around line 26-32: The TestMain_VersionSubcommand test must call t.Parallel()
as its first statement; edit the TestMain_VersionSubcommand function to insert
t.Parallel() immediately after the function opening (before saving/restoring
os.Args and before any calls to t.Setenv(), etc.) so the test runs under the
test parallelization rule.

In `@pkg/cmd/workspace.go`:
- Around line 25-31: Add an Example string to the Cobra command returned by
NewWorkspaceCmd (set the Command.Example field with one or more usage lines
demonstrating common usage of the "workspace" command) and add a matching test
named TestWorkspaceCmd_Examples that verifies the Example is present and
validates the examples (e.g., asserts command.Example is non-empty and/or runs
any example snippets as appropriate for your test harness). Update
NewWorkspaceCmd to include the Example field and create the
TestWorkspaceCmd_Examples test function in the package tests to satisfy the
coding guideline.

---

Nitpick comments:
In `@pkg/cmd/helpers.go`:
- Around line 45-47: The guard currently hardcodes "kdn" which breaks adaptation
if the binary name or formatting changes; update the condition to detect the
actual command prefix dynamically (e.g., use strings.HasPrefix(trimmed,
originalCmd+" ") and also check the base executable name via
path.Base(originalCmd)+ " " to handle paths) before calling strings.Replace;
modify the code around the existing check that uses trimmed, originalCmd and
aliasCmd so it no longer relies on the literal "kdn" string.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c17e0dd0-bab2-4c0e-8a7c-5bcbc71fee79

📥 Commits

Reviewing files that changed from the base of the PR and between e9d481c and 7b112ad.

📒 Files selected for processing (21)
  • .gitignore
  • .goreleaser.yaml
  • Makefile
  • cmd/kdn/main.go
  • cmd/kdn/main_test.go
  • pkg/cmd/helpers.go
  • pkg/cmd/helpers_test.go
  • pkg/cmd/info.go
  • pkg/cmd/init.go
  • pkg/cmd/root.go
  • pkg/cmd/root_test.go
  • pkg/cmd/terminal_test.go
  • pkg/cmd/testutil/example_validator.go
  • pkg/cmd/testutil/example_validator_test.go
  • pkg/cmd/version.go
  • pkg/cmd/workspace.go
  • pkg/cmd/workspace_list.go
  • pkg/cmd/workspace_remove.go
  • pkg/cmd/workspace_start.go
  • pkg/cmd/workspace_stop.go
  • pkg/cmd/workspace_terminal.go

@feloy feloy requested review from benoitf, jeffmaury and slemeur April 8, 2026 06:07
feloy added 4 commits April 8, 2026 10:56
Signed-off-by: Philippe Martin <phmartin@redhat.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
Signed-off-by: Philippe Martin <phmartin@redhat.com>
@feloy feloy changed the title refactor: rename binary to kdn refactor: rename binary to kdn Apr 8, 2026
@feloy feloy changed the title refactor: rename binary to kdn refactor: rename binary to kdn Apr 8, 2026
@feloy feloy merged commit b4cb9cd into openkaiden:main Apr 8, 2026
6 checks passed
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.

rename kortex-cli command to kdn

3 participants