diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index a7f3162..364aabf 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -48,7 +48,7 @@ jobs: run: make build - name: Verify binary - run: ./kortex-cli version + run: ./kdn version - name: Generate coverage report if: matrix.os == 'ubuntu-24.04' diff --git a/.gitignore b/.gitignore index 10916d6..1a86370 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ coverage.html go.work # Build artifacts -/kortex-cli +/kdn dist/ # MkDocs build output diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 3b1eb78..f220571 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -21,8 +21,8 @@ before: - go mod tidy builds: - - main: ./cmd/kortex-cli - binary: kortex-cli + - main: ./cmd/kdn + binary: kdn ldflags: - -s -w - -X github.com/kortex-hub/kortex-cli/pkg/version.Version={{.Version}} diff --git a/AGENTS.md b/AGENTS.md index 7485168..275b0dd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,7 +4,7 @@ This file provides guidance to AI agents when working with code in this reposito ## Project Overview -kortex-cli is a command-line interface for launching and managing AI agents (Claude Code, Goose, Cursor) with custom configurations. It provides a unified way to start different agents with specific settings including skills, MCP server connections, and LLM integrations. +kdn is a command-line interface for launching and managing AI agents (Claude Code, Goose, Cursor) with custom configurations. It provides a unified way to start different agents with specific settings including skills, MCP server connections, and LLM integrations. ## Build and Test Commands @@ -16,14 +16,14 @@ make build ``` ### Execute -After building, the `kortex-cli` binary will be created in the current directory: +After building, the `kdn` binary will be created in the current directory: ```bash # Display help and available commands -./kortex-cli --help +./kdn --help # Execute a specific command -./kortex-cli [flags] +./kdn [flags] ``` ### Run Tests @@ -73,7 +73,7 @@ make install ## Architecture ### Command Structure (Cobra-based) -- Entry point: `cmd/kortex-cli/main.go` → calls `cmd.NewRootCmd().Execute()` and handles errors with `os.Exit(1)` +- Entry point: `cmd/kdn/main.go` → calls `cmd.NewRootCmd().Execute()` and handles errors with `os.Exit(1)` - Root command: `pkg/cmd/root.go` exports `NewRootCmd()` which creates and configures the root command - Subcommands: Each command is in `pkg/cmd/.go` with a `NewCmd()` factory function - Commands use a factory pattern: each command exports a `NewCmd()` function that returns `*cobra.Command` @@ -84,7 +84,7 @@ make install Global flags are defined as persistent flags in `pkg/cmd/root.go` and are available to all commands. #### Accessing the --storage Flag -The `--storage` flag specifies the directory where kortex-cli stores all its files. The default path is computed at runtime using `os.UserHomeDir()` and `filepath.Join()` to ensure cross-platform compatibility (Linux, macOS, Windows). The default is `$HOME/.kortex-cli` with a fallback to `.kortex-cli` in the current directory if the home directory cannot be determined. +The `--storage` flag specifies the directory where kdn stores all its files. The default path is computed at runtime using `os.UserHomeDir()` and `filepath.Join()` to ensure cross-platform compatibility (Linux, macOS, Windows). The default is `$HOME/.kortex-cli` with a fallback to `.kortex-cli` in the current directory if the home directory cannot be determined. **Environment Variable**: The `KORTEX_CLI_STORAGE` environment variable can be used to set the storage directory path. The flag `--storage` will override the environment variable if both are specified. diff --git a/Makefile b/Makefile index e121cc3..4651f60 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ .PHONY: help build test test-coverage fmt vet clean install check-fmt check-vet ci-checks all # Binary name -BINARY_NAME=kortex-cli +BINARY_NAME=kdn # Build output directory BUILD_DIR=. # Go command @@ -31,14 +31,14 @@ all: build help: ## Display this help message @awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) -build: ## Build the kortex-cli binary +build: ## Build the kdn binary build: @echo "Building $(BINARY_NAME)..." - $(GO) build -o $(BUILD_DIR)/$(BINARY_NAME) ./cmd/kortex-cli + $(GO) build -o $(BUILD_DIR)/$(BINARY_NAME) ./cmd/kdn install: ## Install the binary to GOPATH/bin @echo "Installing $(BINARY_NAME)..." - $(GO) install ./cmd/kortex-cli + $(GO) install ./cmd/kdn test: ## Run all tests @echo "Running tests..." diff --git a/README.md b/README.md index d2ceb97..9f51967 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# kortex-cli +# kdn [![codecov](https://codecov.io/gh/kortex-hub/kortex-cli/branch/main/graph/badge.svg)](https://codecov.io/gh/kortex-hub/kortex-cli) [![Documentation](https://img.shields.io/badge/documentation-blue)](https://kortex-hub.github.io/kortex-cli/) -kortex-cli is a command-line interface for launching and managing AI agents in isolated, reproducible workspaces. It creates runtime-based environments (containers, VMs, or other backends) where agents run with your project source code mounted, automatically configured and ready to use — no manual onboarding or setup required. +kdn is a command-line interface for launching and managing AI agents in isolated, reproducible workspaces. It creates runtime-based environments (containers, VMs, or other backends) where agents run with your project source code mounted, automatically configured and ready to use — no manual onboarding or setup required. The architecture is built around pluggable runtimes. The first supported runtime is **Podman**, which creates container-based workspaces using a custom Fedora image. Additional runtimes (e.g., MicroVM, Kubernetes) can be added to support other execution environments. @@ -36,16 +36,16 @@ The architecture is built around pluggable runtimes. The first supported runtime make build ``` -This creates the `kortex-cli` binary in the current directory. +This creates the `kdn` binary in the current directory. ### Run ```bash # Display help and available commands -./kortex-cli --help +./kdn --help # Execute a specific command -./kortex-cli [flags] +./kdn [flags] ``` ### Install @@ -69,7 +69,7 @@ make test-coverage ## Glossary ### Agent -An AI assistant that can perform tasks autonomously. In kortex-cli, agents are the different AI tools (Claude Code, Goose, Cursor) that can be launched and configured. +An AI assistant that can perform tasks autonomously. In kdn, agents are the different AI tools (Claude Code, Goose, Cursor) that can be launched and configured. ### LLM (Large Language Model) The underlying AI model that powers the agents. Examples include Claude (by Anthropic), GPT (by OpenAI), and other language models. @@ -78,13 +78,13 @@ The underlying AI model that powers the agents. Examples include Claude (by Anth A standardized protocol for connecting AI agents to external data sources and tools. MCP servers provide agents with additional capabilities like database access, API integrations, or file system operations. ### Runtime -The environment where workspaces run. kortex-cli supports multiple runtimes (e.g., Podman containers), allowing workspaces to be hosted on different backends depending on your needs. +The environment where workspaces run. kdn supports multiple runtimes (e.g., Podman containers), allowing workspaces to be hosted on different backends depending on your needs. ### Skills Pre-configured capabilities or specialized functions that can be enabled for an agent. Skills extend what an agent can do, such as code review, testing, or specific domain knowledge. ### Workspace -A registered directory containing your project source code and its configuration. Each workspace is tracked by kortex-cli with a unique ID and a human-readable name. Workspaces can be accessed using either their ID or name in all commands (start, stop, remove, terminal). +A registered directory containing your project source code and its configuration. Each workspace is tracked by kdn with a unique ID and a human-readable name. Workspaces can be accessed using either their ID or name in all commands (start, stop, remove, terminal). ## Scenarios @@ -136,13 +136,13 @@ Create or edit `~/.kortex-cli/config/agents.json` to add the required environmen ```bash # Register a workspace with the Podman runtime and Claude agent -kortex-cli init /path/to/project --runtime podman --agent claude +kdn init /path/to/project --runtime podman --agent claude # Start the workspace (using name or ID) -kortex-cli start my-project +kdn start my-project # Connect to the workspace — Claude Code will use Vertex AI automatically -kortex-cli terminal my-project +kdn terminal my-project ``` When Claude Code starts, it detects `ANTHROPIC_VERTEX_PROJECT_ID` and `CLOUD_ML_REGION` and routes all requests to Vertex AI using the mounted application default credentials. @@ -188,11 +188,11 @@ To reuse your host Claude Code settings (preferences, custom instructions, etc.) ### Starting Claude with Default Settings -This scenario demonstrates how to pre-configure Claude Code's settings so that when it starts inside a workspace, it skips the interactive onboarding flow and uses your preferred defaults. kortex-cli automatically handles the onboarding flags, and you can optionally customize other settings like theme preferences. +This scenario demonstrates how to pre-configure Claude Code's settings so that when it starts inside a workspace, it skips the interactive onboarding flow and uses your preferred defaults. kdn automatically handles the onboarding flags, and you can optionally customize other settings like theme preferences. **Automatic Onboarding Skip** -When you register a workspace with the Claude agent, kortex-cli automatically: +When you register a workspace with the Claude agent, kdn automatically: - Sets `hasCompletedOnboarding: true` to skip the first-run wizard - Sets `hasTrustDialogAccepted: true` for the workspace sources directory (the exact path is determined by the runtime) @@ -222,22 +222,22 @@ EOF - `theme` - The UI theme for Claude Code (e.g., `"dark"`, `"light"`, `"dark-daltonized"`) -You don't need to set `hasCompletedOnboarding` or `hasTrustDialogAccepted` — kortex-cli adds these automatically when creating the workspace. +You don't need to set `hasCompletedOnboarding` or `hasTrustDialogAccepted` — kdn adds these automatically when creating the workspace. **Step 3: Register and start the workspace** ```bash # Register a workspace — the settings file is embedded in the container image -kortex-cli init /path/to/project --runtime podman --agent claude +kdn init /path/to/project --runtime podman --agent claude # Start the workspace (using name or ID) -kortex-cli start my-project +kdn start my-project # Connect — Claude Code starts directly without onboarding -kortex-cli terminal my-project +kdn terminal my-project ``` -When `init` runs, kortex-cli: +When `init` runs, kdn: 1. Reads all files from `~/.kortex-cli/config/claude/` (e.g., your theme preferences) 2. Automatically adds `hasCompletedOnboarding: true` and marks the workspace sources directory as trusted (the path is determined by the runtime) 3. Copies the final merged settings into the container image at `/home/agent/.claude.json` @@ -246,15 +246,15 @@ Claude Code finds this file on startup and skips onboarding. **Notes:** -- **Onboarding is skipped automatically** — even if you don't create any settings files, kortex-cli ensures Claude starts without prompts +- **Onboarding is skipped automatically** — even if you don't create any settings files, kdn ensures Claude starts without prompts - The settings are baked into the container image at `init` time, not mounted at runtime — changes to the files on the host require re-registering the workspace to take effect - Any file placed under `~/.kortex-cli/config/claude/` is copied into the container home directory, preserving the directory structure (e.g., `~/.kortex-cli/config/claude/.some-tool/config` becomes `/home/agent/.some-tool/config` inside the container) - This approach keeps your workspace self-contained — other developers using the same project are not affected, and your local `~/.claude` directory is not exposed inside the container -- To apply changes to the settings, remove and re-register the workspace: `kortex-cli remove ` then `kortex-cli init` again +- To apply changes to the settings, remove and re-register the workspace: `kdn remove ` then `kdn init` again ### Using Goose Agent with a Model from Vertex AI -This scenario demonstrates how to configure the Goose agent in a kortex-cli workspace using Vertex AI as the backend, covering credential injection, sharing your local gcloud configuration, and pre-configuring the default model. +This scenario demonstrates how to configure the Goose agent in a kdn workspace using Vertex AI as the backend, covering credential injection, sharing your local gcloud configuration, and pre-configuring the default model. #### Authenticating with Vertex AI @@ -292,13 +292,13 @@ Then register and start the workspace: ```bash # Register a workspace with the Podman runtime and Goose agent -kortex-cli init /path/to/project --runtime podman --agent goose +kdn init /path/to/project --runtime podman --agent goose # Start the workspace -kortex-cli start my-project +kdn start my-project # Connect — Goose starts with Vertex AI configured -kortex-cli terminal my-project +kdn terminal my-project ``` #### Sharing Local Goose Settings @@ -340,7 +340,7 @@ If you want to pre-configure Goose with default settings without exposing your l **Automatic Onboarding Skip** -When you register a workspace with the Goose agent, kortex-cli automatically sets `GOOSE_TELEMETRY_ENABLED` to `false` in the Goose config file if it is not already defined, so Goose skips its telemetry prompt on first launch. +When you register a workspace with the Goose agent, kdn automatically sets `GOOSE_TELEMETRY_ENABLED` to `false` in the Goose config file if it is not already defined, so Goose skips its telemetry prompt on first launch. **Step 1: Create the agent settings directory** @@ -362,22 +362,22 @@ EOF **Fields:** - `GOOSE_MODEL` - The model identifier Goose uses for its AI interactions. Alternatively, use `--model` flag during `init` to set this (the flag takes precedence over this setting) -- `GOOSE_TELEMETRY_ENABLED` - Whether Goose sends usage telemetry; set to `true` to opt in, or omit to have kortex-cli default it to `false` +- `GOOSE_TELEMETRY_ENABLED` - Whether Goose sends usage telemetry; set to `true` to opt in, or omit to have kdn default it to `false` **Step 3: Register and start the workspace** ```bash # Register a workspace — the settings file is embedded in the container image -kortex-cli init /path/to/project --runtime podman --agent goose +kdn init /path/to/project --runtime podman --agent goose # Start the workspace -kortex-cli start my-project +kdn start my-project # Connect — Goose starts with the configured provider and model -kortex-cli terminal my-project +kdn terminal my-project ``` -When `init` runs, kortex-cli: +When `init` runs, kdn: 1. Reads all files from `~/.kortex-cli/config/goose/` (e.g., your provider and model settings) 2. Automatically sets `GOOSE_TELEMETRY_ENABLED: false` in `.config/goose/config.yaml` if the key is not already defined 3. Copies the final settings into the container image at `/home/agent/.config/goose/config.yaml` @@ -386,16 +386,16 @@ Goose finds this file on startup and uses the pre-configured settings without pr **Notes:** -- **Telemetry is disabled automatically** — even if you don't create any settings files, kortex-cli ensures Goose starts without the telemetry prompt +- **Telemetry is disabled automatically** — even if you don't create any settings files, kdn ensures Goose starts without the telemetry prompt - If you prefer to enable telemetry, set `GOOSE_TELEMETRY_ENABLED: true` in `~/.kortex-cli/config/goose/.config/goose/config.yaml` - The settings are baked into the container image at `init` time, not mounted at runtime — changes to the files on the host require re-registering the workspace to take effect - Any file placed under `~/.kortex-cli/config/goose/` is copied into the container home directory, preserving the directory structure (e.g., `~/.kortex-cli/config/goose/.config/goose/config.yaml` becomes `/home/agent/.config/goose/config.yaml` inside the container) - This approach keeps your workspace self-contained — other developers using the same project are not affected, and your local `~/.config/goose` directory is not exposed inside the container -- To apply changes to the settings, remove and re-register the workspace: `kortex-cli remove ` then `kortex-cli init` again +- To apply changes to the settings, remove and re-register the workspace: `kdn remove ` then `kdn init` again ### Using Cursor CLI Agent -This scenario demonstrates how to configure the Cursor agent in a kortex-cli workspace, covering API key injection, sharing your local Cursor settings, and pre-configuring the default model. +This scenario demonstrates how to configure the Cursor agent in a kdn workspace, covering API key injection, sharing your local Cursor settings, and pre-configuring the default model. #### Defining the Cursor API Key via a Secret @@ -430,16 +430,16 @@ Create or edit `~/.kortex-cli/config/agents.json` to inject the secret as an env ```bash # Register a workspace with the Podman runtime and Cursor agent -kortex-cli init /path/to/project --runtime podman --agent cursor +kdn init /path/to/project --runtime podman --agent cursor # Start the workspace -kortex-cli start my-project +kdn start my-project # Connect — Cursor starts with the API key available -kortex-cli terminal my-project +kdn terminal my-project ``` -The secret name (`cursor-api-key`) must match the `secret` field value in your configuration. At workspace creation time, kortex-cli passes the secret to Podman, which injects it as the `CURSOR_API_KEY` environment variable inside the container. +The secret name (`cursor-api-key`) must match the `secret` field value in your configuration. At workspace creation time, kdn passes the secret to Podman, which injects it as the `CURSOR_API_KEY` environment variable inside the container. #### Sharing Local Cursor Settings @@ -471,7 +471,7 @@ If you want to pre-configure Cursor with default settings without exposing your **Automatic Onboarding Skip** -When you register a workspace with the Cursor agent, kortex-cli automatically creates a `.workspace-trusted` file in the Cursor projects directory for the workspace sources path, so Cursor skips its workspace trust dialog on first launch. +When you register a workspace with the Cursor agent, kdn automatically creates a `.workspace-trusted` file in the Cursor projects directory for the workspace sources path, so Cursor skips its workspace trust dialog on first launch. **Step 1: Configure the agent environment** @@ -528,19 +528,19 @@ EOF ```bash # Register a workspace with a specific model using the --model flag (recommended) -kortex-cli init /path/to/project --runtime podman --agent cursor --model my-model-id +kdn init /path/to/project --runtime podman --agent cursor --model my-model-id # Or register without --model to use settings from cli-config.json -kortex-cli init /path/to/project --runtime podman --agent cursor +kdn init /path/to/project --runtime podman --agent cursor # Start the workspace -kortex-cli start my-project +kdn start my-project # Connect — Cursor starts with the configured model -kortex-cli terminal my-project +kdn terminal my-project ``` -When `init` runs, kortex-cli: +When `init` runs, kdn: 1. Reads all files from `~/.kortex-cli/config/cursor/` (e.g., your settings) 2. If `--model` is specified, updates `cli-config.json` with the model configuration (takes precedence over any existing model in settings files) 3. Automatically creates the workspace trust file so Cursor skips its trust dialog @@ -553,7 +553,7 @@ Cursor finds this file on startup and uses the pre-configured model without prom - **Model configuration**: Use `--model` flag during `init` to set the model (e.g., `--model my-model-id`). This takes precedence over any model defined in settings files - The settings are baked into the container image at `init` time, not mounted at runtime — changes to the files on the host require re-registering the workspace to take effect - Any file placed under `~/.kortex-cli/config/cursor/` is copied into the container home directory, preserving the directory structure (e.g., `~/.kortex-cli/config/cursor/.cursor/cli-config.json` becomes `/home/agent/.cursor/cli-config.json` inside the container) -- To apply changes to the settings, remove and re-register the workspace: `kortex-cli remove ` then `kortex-cli init` again +- To apply changes to the settings, remove and re-register the workspace: `kdn remove ` then `kdn init` again - This approach keeps your workspace self-contained — other developers using the same project are not affected, and your local `~/.cursor` directory is not exposed inside the container - Do not combine this approach with the `~/.cursor` mount from the previous section — the mounted directory would override the baked-in defaults at runtime @@ -585,7 +585,7 @@ The `GH_TOKEN` variable is automatically picked up by the `gh` CLI and other Git **For a specific project** -Use the project identifier as the key instead. The identifier is the git remote URL (without `.git`) as detected by kortex-cli during `init`: +Use the project identifier as the key instead. The identifier is the git remote URL (without `.git`) as detected by kdn during `init`: ```json { @@ -641,15 +641,15 @@ echo "$GITHUB_TOKEN" | podman secret create github-token - podman secret create github-token /path/to/token-file ``` -The secret name (`github-token` here) must match the `secret` field value in your configuration. At workspace creation time, kortex-cli passes `--secret github-token,type=env,target=GH_TOKEN` to Podman, which injects the secret value as the `GH_TOKEN` environment variable inside the container. +The secret name (`github-token` here) must match the `secret` field value in your configuration. At workspace creation time, kdn passes `--secret github-token,type=env,target=GH_TOKEN` to Podman, which injects the secret value as the `GH_TOKEN` environment variable inside the container. Podman secrets are stored locally on the host and never written to the container image. **Notes:** - The `secret` field references a secret by name rather than embedding the token value directly, keeping credentials out of the configuration file -- The project identifier used as the key must match what kortex-cli detected during `init` — run `kortex-cli list -o json` to see the project field for each registered workspace -- Configuration changes in `projects.json` take effect the next time you run `kortex-cli init` for that workspace; already-registered workspaces need to be removed and re-registered +- The project identifier used as the key must match what kdn detected during `init` — run `kdn list -o json` to see the project field for each registered workspace +- Configuration changes in `projects.json` take effect the next time you run `kdn init` for that workspace; already-registered workspaces need to be removed and re-registered ### Working with Git Worktrees @@ -698,20 +698,20 @@ If you want the agents to have access to the main branch (e.g., to compare chang **Step 4: Register a workspace for each worktree** ```bash -kortex-cli init /path/to/my-project/feature-a --runtime podman --agent claude -kortex-cli init /path/to/my-project/feature-b --runtime podman --agent claude +kdn init /path/to/my-project/feature-a --runtime podman --agent claude +kdn init /path/to/my-project/feature-b --runtime podman --agent claude ``` **Step 5: Start and connect to each workspace independently** ```bash # Start both workspaces (using names or IDs) -kortex-cli start feature-a -kortex-cli start feature-b +kdn start feature-a +kdn start feature-b # Connect to each agent in separate terminals -kortex-cli terminal feature-a -kortex-cli terminal feature-b +kdn terminal feature-a +kdn terminal feature-b ``` Each agent runs independently in its own container, operating on its own branch without interfering with the other. @@ -728,7 +728,7 @@ This scenario demonstrates how to manage workspaces programmatically using JSON **Step 1: Check existing workspaces** ```bash -$ kortex-cli workspace list -o json +$ kdn workspace list -o json ``` ```json @@ -742,7 +742,7 @@ Exit code: `0` (success, but no workspaces registered) **Step 2: Register a new workspace** ```bash -$ kortex-cli init /path/to/project --runtime podman --agent claude -o json +$ kdn init /path/to/project --runtime podman --agent claude -o json ``` ```json @@ -756,7 +756,7 @@ Exit code: `0` (success) **Step 3: Register with verbose output to get full details** ```bash -$ kortex-cli init /path/to/another-project --runtime podman --agent claude -o json -v +$ kdn init /path/to/another-project --runtime podman --agent claude -o json -v ``` ```json @@ -778,7 +778,7 @@ Exit code: `0` (success) **Step 3a: Register and start immediately with auto-start flag** ```bash -$ kortex-cli init /path/to/third-project --runtime podman --agent claude -o json --start +$ kdn init /path/to/third-project --runtime podman --agent claude -o json --start ``` ```json @@ -792,7 +792,7 @@ Exit code: `0` (success, workspace is running) **Step 4: List all workspaces** ```bash -$ kortex-cli workspace list -o json +$ kdn workspace list -o json ``` ```json @@ -829,7 +829,7 @@ Exit code: `0` (success) **Step 5: Start a workspace** ```bash -$ kortex-cli workspace start 2c5f16046476be368fcada501ac6cdc6bbd34ea80eb9ceb635530c0af64681ea -o json +$ kdn workspace start 2c5f16046476be368fcada501ac6cdc6bbd34ea80eb9ceb635530c0af64681ea -o json ``` ```json @@ -843,7 +843,7 @@ Exit code: `0` (success) **Step 6: Stop a workspace** ```bash -$ kortex-cli workspace stop 2c5f16046476be368fcada501ac6cdc6bbd34ea80eb9ceb635530c0af64681ea -o json +$ kdn workspace stop 2c5f16046476be368fcada501ac6cdc6bbd34ea80eb9ceb635530c0af64681ea -o json ``` ```json @@ -857,7 +857,7 @@ Exit code: `0` (success) **Step 7: Remove a workspace** ```bash -$ kortex-cli workspace remove 2c5f16046476be368fcada501ac6cdc6bbd34ea80eb9ceb635530c0af64681ea -o json +$ kdn workspace remove 2c5f16046476be368fcada501ac6cdc6bbd34ea80eb9ceb635530c0af64681ea -o json ``` ```json @@ -871,7 +871,7 @@ Exit code: `0` (success) **Step 8: Verify removal** ```bash -$ kortex-cli workspace list -o json +$ kdn workspace list -o json ``` ```json @@ -901,7 +901,7 @@ All errors are returned in JSON format when using `--output json`, with the erro **Error: Non-existent directory** ```bash -$ kortex-cli init /tmp/no-exist --runtime podman --agent claude -o json +$ kdn init /tmp/no-exist --runtime podman --agent claude -o json ``` ```json @@ -915,7 +915,7 @@ Exit code: `1` (error) **Error: Workspace not found** ```bash -$ kortex-cli workspace remove unknown-id -o json +$ kdn workspace remove unknown-id -o json ``` ```json @@ -941,7 +941,7 @@ Exit code: `1` (error) #!/bin/bash # Register a workspace -output=$(kortex-cli init /path/to/project --runtime podman --agent claude -o json) +output=$(kdn init /path/to/project --runtime podman --agent claude -o json) exit_code=$? if [ $exit_code -eq 0 ]; then @@ -956,7 +956,7 @@ fi ## Environment Variables -kortex-cli supports environment variables for configuring default behavior. +kdn supports environment variables for configuring default behavior. ### `KORTEX_CLI_DEFAULT_RUNTIME` @@ -966,7 +966,7 @@ Sets the default runtime to use when registering a workspace with the `init` com ```bash export KORTEX_CLI_DEFAULT_RUNTIME=fake -kortex-cli init /path/to/project --agent claude +kdn init /path/to/project --agent claude ``` **Priority:** @@ -984,10 +984,10 @@ The runtime is determined in the following order (highest to lowest priority): export KORTEX_CLI_DEFAULT_RUNTIME=fake # Register a workspace using the environment variable -kortex-cli init /path/to/project --agent claude +kdn init /path/to/project --agent claude # Override the environment variable with the flag -kortex-cli init /path/to/another-project --agent claude --runtime podman +kdn init /path/to/another-project --agent claude --runtime podman ``` **Notes:** @@ -1005,7 +1005,7 @@ Sets the default agent to use when registering a workspace with the `init` comma ```bash export KORTEX_CLI_DEFAULT_AGENT=claude -kortex-cli init /path/to/project --runtime podman +kdn init /path/to/project --runtime podman ``` **Priority:** @@ -1023,10 +1023,10 @@ The agent is determined in the following order (highest to lowest priority): export KORTEX_CLI_DEFAULT_AGENT=claude # Register a workspace using the environment variable -kortex-cli init /path/to/project --runtime podman +kdn init /path/to/project --runtime podman # Override the environment variable with the flag -kortex-cli init /path/to/another-project --runtime podman --agent goose +kdn init /path/to/another-project --runtime podman --agent goose ``` **Notes:** @@ -1039,13 +1039,13 @@ kortex-cli init /path/to/another-project --runtime podman --agent goose ### `KORTEX_CLI_STORAGE` -Sets the default storage directory where kortex-cli stores its data files. +Sets the default storage directory where kdn stores its data files. **Usage:** ```bash export KORTEX_CLI_STORAGE=/custom/path/to/storage -kortex-cli init /path/to/project --runtime podman --agent claude +kdn init /path/to/project --runtime podman --agent claude ``` **Priority:** @@ -1063,11 +1063,11 @@ The storage directory is determined in the following order (highest to lowest pr export KORTEX_CLI_STORAGE=/var/lib/kortex # All commands will use this storage directory -kortex-cli init /path/to/project --runtime podman --agent claude -kortex-cli list +kdn init /path/to/project --runtime podman --agent claude +kdn list # Override the environment variable with the flag -kortex-cli list --storage /tmp/kortex-storage +kdn list --storage /tmp/kortex-storage ``` ### `KORTEX_CLI_INIT_AUTO_START` @@ -1078,7 +1078,7 @@ Automatically starts a workspace after registration when using the `init` comman ```bash export KORTEX_CLI_INIT_AUTO_START=1 -kortex-cli init /path/to/project --runtime podman --agent claude +kdn init /path/to/project --runtime podman --agent claude ``` **Priority:** @@ -1105,12 +1105,12 @@ Any other value (including `0`, `false`, `no`, or empty string) will not trigger export KORTEX_CLI_INIT_AUTO_START=1 # Register and start a workspace automatically -kortex-cli init /path/to/project --runtime podman --agent claude +kdn init /path/to/project --runtime podman --agent claude # Workspace is now running # Override the environment variable with the flag export KORTEX_CLI_INIT_AUTO_START=0 -kortex-cli init /path/to/another-project --runtime podman --agent claude --start +kdn init /path/to/another-project --runtime podman --agent claude --start # Workspace is started despite env var being 0 ``` @@ -1197,7 +1197,7 @@ The container's working directory is set to `/workspace/sources`, which is where ```bash # Register a workspace with the Podman runtime -kortex-cli init /path/to/project --runtime podman --agent claude +kdn init /path/to/project --runtime podman --agent claude ``` **User Experience:** @@ -1225,7 +1225,7 @@ After registration, you can start the workspace: ```bash # Start the workspace -kortex-cli start +kdn start ``` **Note:** When using `--output json`, all progress spinners are hidden to avoid polluting the JSON output. @@ -1369,14 +1369,14 @@ Configuration changes take effect when you **register a new workspace with `init 2. Register a new workspace (this creates the Containerfile and builds the image): ```bash # Using Claude agent - kortex-cli init /path/to/project --runtime podman --agent claude + kdn init /path/to/project --runtime podman --agent claude # or using Goose agent - kortex-cli init /path/to/project --runtime podman --agent goose + kdn init /path/to/project --runtime podman --agent goose ``` 3. Start the workspace: ```bash - kortex-cli start + kdn start ``` **Notes:** @@ -1500,11 +1500,11 @@ Paths can also be absolute (e.g., `/absolute/path`). ### Configuration Validation -When you register a workspace with `kortex-cli init`, the configuration is automatically validated. If `workspace.json` exists and contains invalid data, the registration will fail with a descriptive error message. +When you register a workspace with `kdn init`, the configuration is automatically validated. If `workspace.json` exists and contains invalid data, the registration will fail with a descriptive error message. **Example - Invalid configuration (both value and secret set):** ```bash -$ kortex-cli init /path/to/project --runtime podman --agent claude +$ kdn init /path/to/project --runtime podman --agent claude ``` ```text Error: workspace configuration validation failed: invalid workspace configuration: @@ -1513,7 +1513,7 @@ environment variable "API_KEY" (index 0) has both value and secret set **Example - Invalid configuration (missing host in mount):** ```bash -$ kortex-cli init /path/to/project --runtime podman --agent claude +$ kdn init /path/to/project --runtime podman --agent claude ``` ```text Error: workspace configuration validation failed: invalid workspace configuration: @@ -1601,7 +1601,7 @@ mount at index 0 is missing host ## Multi-Level Configuration -kortex-cli supports configuration at multiple levels, allowing you to customize workspace settings for different contexts. Configurations are automatically merged with proper precedence, making it easy to share common settings while still allowing project and agent-specific customization. +kdn supports configuration at multiple levels, allowing you to customize workspace settings for different contexts. Configurations are automatically merged with proper precedence, making it easy to share common settings while still allowing project and agent-specific customization. ### Configuration Levels @@ -1642,7 +1642,7 @@ When registering a workspace, configurations are merged in this order (later con ### Storage Location -User-specific configurations are stored in the kortex-cli storage directory: +User-specific configurations are stored in the kdn storage directory: - **Default location**: `~/.kortex-cli/config/` - **Custom location**: Set via `--storage` flag or `KORTEX_CLI_STORAGE` environment variable @@ -1773,12 +1773,12 @@ This enables debug mode only when using the Claude agent. **Register workspace with agent-specific config:** ```bash -kortex-cli init --runtime podman --agent claude +kdn init --runtime podman --agent claude ``` **Register workspace with custom project:** ```bash -kortex-cli init --runtime podman --project my-custom-project --agent goose +kdn init --runtime podman --project my-custom-project --agent goose ``` **Note:** The `--agent` flag is required (or set `KORTEX_CLI_DEFAULT_AGENT` environment variable) when registering a workspace. @@ -1849,32 +1849,32 @@ The system works without any configuration files and merges only the ones that e } ``` -**Result when running** `kortex-cli init --runtime podman --agent claude`: +**Result when running** `kdn init --runtime podman --agent claude`: - Environment: `NODE_ENV=development`, `DEBUG=true`, `CLAUDE_VERBOSE=true` - Mounts: `$HOME/.gitconfig`, `$HOME/.ssh` ## Commands -### `info` - Display Information About kortex-cli +### `info` - Display Information About kdn Displays version, available agents, and supported runtimes. #### Usage ```bash -kortex-cli info [flags] +kdn info [flags] ``` #### Flags - `--output, -o ` - Output format (supported: `json`) -- `--storage ` - Storage directory for kortex-cli data (default: `$HOME/.kortex-cli`) +- `--storage ` - Storage directory for kdn data (default: `$HOME/.kortex-cli`) #### Examples **Show info (human-readable format):** ```bash -kortex-cli info +kdn info ``` Output: ```text @@ -1885,7 +1885,7 @@ Runtimes: fake, podman **Show info in JSON format:** ```bash -kortex-cli info --output json +kdn info --output json ``` Output: ```json @@ -1903,7 +1903,7 @@ Output: **Show info using short flag:** ```bash -kortex-cli info -o json +kdn info -o json ``` #### Notes @@ -1914,12 +1914,12 @@ kortex-cli info -o json ### `init` - Register a New Workspace -Registers a new workspace with kortex-cli, making it available for agent launch and configuration. +Registers a new workspace with kdn, making it available for agent launch and configuration. #### Usage ```bash -kortex-cli init [sources-directory] [flags] +kdn init [sources-directory] [flags] ``` #### Arguments @@ -1938,57 +1938,57 @@ kortex-cli init [sources-directory] [flags] - `--verbose, -v` - Show detailed output including all workspace information - `--output, -o ` - Output format (supported: `json`) - `--show-logs` - Show stdout and stderr from runtime commands (cannot be combined with `--output json`) -- `--storage ` - Storage directory for kortex-cli data (default: `$HOME/.kortex-cli`) +- `--storage ` - Storage directory for kdn data (default: `$HOME/.kortex-cli`) #### Examples **Register the current directory:** ```bash -kortex-cli init --runtime podman --agent claude +kdn init --runtime podman --agent claude ``` Output: `a1b2c3d4e5f6...` (workspace ID) **Register a specific directory:** ```bash -kortex-cli init /path/to/myproject --runtime podman --agent claude +kdn init /path/to/myproject --runtime podman --agent claude ``` **Register with a custom name:** ```bash -kortex-cli init /path/to/myproject --runtime podman --agent claude --name "my-awesome-project" +kdn init /path/to/myproject --runtime podman --agent claude --name "my-awesome-project" ``` **Register with a custom project identifier:** ```bash -kortex-cli init /path/to/myproject --runtime podman --agent claude --project "my project" +kdn init /path/to/myproject --runtime podman --agent claude --project "my project" ``` **Register with custom configuration location:** ```bash -kortex-cli init /path/to/myproject --runtime podman --agent claude --workspace-configuration /path/to/config +kdn init /path/to/myproject --runtime podman --agent claude --workspace-configuration /path/to/config ``` **Register with a specific model:** ```bash -kortex-cli init /path/to/myproject --runtime podman --agent claude --model claude-sonnet-4-20250514 +kdn init /path/to/myproject --runtime podman --agent claude --model claude-sonnet-4-20250514 ``` **Register and start immediately:** ```bash -kortex-cli init /path/to/myproject --runtime podman --agent claude --start +kdn init /path/to/myproject --runtime podman --agent claude --start ``` Output: `a1b2c3d4e5f6...` (workspace ID, workspace is now running) **Register and start using environment variable:** ```bash export KORTEX_CLI_INIT_AUTO_START=1 -kortex-cli init /path/to/myproject --runtime podman --agent claude +kdn init /path/to/myproject --runtime podman --agent claude ``` Output: `a1b2c3d4e5f6...` (workspace ID, workspace is now running) **View detailed output:** ```bash -kortex-cli init --runtime podman --agent claude --verbose +kdn init --runtime podman --agent claude --verbose ``` Output: ```text @@ -2004,7 +2004,7 @@ Registered workspace: **JSON output (default - ID only):** ```bash -kortex-cli init /path/to/myproject --runtime podman --agent claude --output json +kdn init /path/to/myproject --runtime podman --agent claude --output json ``` Output: ```json @@ -2015,7 +2015,7 @@ Output: **JSON output with verbose flag (full workspace details):** ```bash -kortex-cli init /path/to/myproject --runtime podman --agent claude --output json --verbose +kdn init /path/to/myproject --runtime podman --agent claude --output json --verbose ``` Output: ```json @@ -2034,37 +2034,37 @@ Output: **JSON output with short flags:** ```bash -kortex-cli init -r fake -a claude -o json -v +kdn init -r fake -a claude -o json -v ``` **Show runtime command output (e.g., image build logs):** ```bash -kortex-cli init --runtime podman --agent claude --show-logs +kdn init --runtime podman --agent claude --show-logs ``` #### Workspace Naming - If `--name` is not provided, the name is automatically generated from the last component of the sources directory path -- If a workspace with the same name already exists, kortex-cli automatically appends an increment (`-2`, `-3`, etc.) to ensure uniqueness +- If a workspace with the same name already exists, kdn automatically appends an increment (`-2`, `-3`, etc.) to ensure uniqueness **Examples:** ```bash # First workspace in /home/user/project -kortex-cli init /home/user/project --runtime podman --agent claude +kdn init /home/user/project --runtime podman --agent claude # Name: "project" # Second workspace with the same directory name -kortex-cli init /home/user/another-location/project --runtime podman --agent claude --name "project" +kdn init /home/user/another-location/project --runtime podman --agent claude --name "project" # Name: "project-2" # Third workspace with the same name -kortex-cli init /tmp/project --runtime podman --agent claude --name "project" +kdn init /tmp/project --runtime podman --agent claude --name "project" # Name: "project-3" ``` #### Project Detection -When registering a workspace, kortex-cli automatically detects and stores a project identifier. This allows grouping workspaces that belong to the same project, even across different branches, forks, or subdirectories. +When registering a workspace, kdn automatically detects and stores a project identifier. This allows grouping workspaces that belong to the same project, even across different branches, forks, or subdirectories. **The project is determined using the following rules:** @@ -2087,11 +2087,11 @@ The project is the repository remote URL (without `.git` suffix) plus the worksp # origin: https://github.com/myuser/kortex-cli.git (fork) # Workspace at repository root -kortex-cli init /home/user/kortex-cli --runtime podman --agent claude +kdn init /home/user/kortex-cli --runtime podman --agent claude # Project: https://github.com/kortex-hub/kortex-cli/ # Workspace in subdirectory -kortex-cli init /home/user/kortex-cli/pkg/git --runtime podman --agent claude +kdn init /home/user/kortex-cli/pkg/git --runtime podman --agent claude # Project: https://github.com/kortex-hub/kortex-cli/pkg/git ``` @@ -2107,11 +2107,11 @@ The project is the repository root directory path plus the workspace's relative **Example - Local repository:** ```bash # Workspace at repository root -kortex-cli init /home/user/local-repo --runtime podman --agent claude +kdn init /home/user/local-repo --runtime podman --agent claude # Project: /home/user/local-repo # Workspace in subdirectory -kortex-cli init /home/user/local-repo/pkg/utils --runtime podman --agent claude +kdn init /home/user/local-repo/pkg/utils --runtime podman --agent claude # Project: /home/user/local-repo/pkg/utils ``` @@ -2121,7 +2121,7 @@ The project is the workspace source directory path: **Example - Regular directory:** ```bash -kortex-cli init /tmp/workspace --runtime podman --agent claude +kdn init /tmp/workspace --runtime podman --agent claude # Project: /tmp/workspace ``` @@ -2152,25 +2152,25 @@ kortex-cli init /tmp/workspace --runtime podman --agent claude ### `workspace list` - List All Registered Workspaces -Lists all workspaces that have been registered with kortex-cli. Also available as the shorter alias `list`. +Lists all workspaces that have been registered with kdn. Also available as the shorter alias `list`. #### Usage ```bash -kortex-cli workspace list [flags] -kortex-cli list [flags] +kdn workspace list [flags] +kdn list [flags] ``` #### Flags - `--output, -o ` - Output format (supported: `json`) -- `--storage ` - Storage directory for kortex-cli data (default: `$HOME/.kortex-cli`) +- `--storage ` - Storage directory for kdn data (default: `$HOME/.kortex-cli`) #### Examples **List all workspaces (human-readable format):** ```bash -kortex-cli workspace list +kdn workspace list ``` Output: ```text @@ -2193,12 +2193,12 @@ ID: f6e5d4c3b2a1... **Use the short alias:** ```bash -kortex-cli list +kdn list ``` **List workspaces in JSON format:** ```bash -kortex-cli workspace list --output json +kdn workspace list --output json ``` Output: ```json @@ -2232,7 +2232,7 @@ Output: **List with short flag:** ```bash -kortex-cli list -o json +kdn list -o json ``` #### Notes @@ -2249,8 +2249,8 @@ Starts a registered workspace by its name or ID. Also available as the shorter a #### Usage ```bash -kortex-cli workspace start NAME|ID [flags] -kortex-cli start NAME|ID [flags] +kdn workspace start NAME|ID [flags] +kdn start NAME|ID [flags] ``` #### Arguments @@ -2261,39 +2261,39 @@ kortex-cli start NAME|ID [flags] - `--output, -o ` - Output format (supported: `json`) - `--show-logs` - Show stdout and stderr from runtime commands (cannot be combined with `--output json`) -- `--storage ` - Storage directory for kortex-cli data (default: `$HOME/.kortex-cli`) +- `--storage ` - Storage directory for kdn data (default: `$HOME/.kortex-cli`) #### Examples **Start a workspace by ID:** ```bash -kortex-cli workspace start a1b2c3d4e5f6... +kdn workspace start a1b2c3d4e5f6... ``` Output: `a1b2c3d4e5f6...` (ID of started workspace) **Start a workspace by name:** ```bash -kortex-cli workspace start my-project +kdn workspace start my-project ``` Output: `a1b2c3d4e5f6...` (ID of started workspace) **Use the short alias:** ```bash -kortex-cli start my-project +kdn start my-project ``` **View workspace names and IDs before starting:** ```bash # First, list all workspaces to find the name or ID -kortex-cli list +kdn list # Then start the desired workspace (using either name or ID) -kortex-cli start my-project +kdn start my-project ``` **JSON output:** ```bash -kortex-cli workspace start a1b2c3d4e5f6... --output json +kdn workspace start a1b2c3d4e5f6... --output json ``` Output: ```json @@ -2304,19 +2304,19 @@ Output: **JSON output with short flag:** ```bash -kortex-cli start a1b2c3d4e5f6... -o json +kdn start a1b2c3d4e5f6... -o json ``` **Show runtime command output:** ```bash -kortex-cli workspace start a1b2c3d4e5f6... --show-logs +kdn workspace start a1b2c3d4e5f6... --show-logs ``` #### Error Handling **Workspace not found (text format):** ```bash -kortex-cli start invalid-id +kdn start invalid-id ``` Output: ```text @@ -2326,7 +2326,7 @@ Use 'workspace list' to see available workspaces **Workspace not found (JSON format):** ```bash -kortex-cli start invalid-id --output json +kdn start invalid-id --output json ``` Output: ```json @@ -2352,8 +2352,8 @@ Stops a running workspace by its name or ID. Also available as the shorter alias #### Usage ```bash -kortex-cli workspace stop NAME|ID [flags] -kortex-cli stop NAME|ID [flags] +kdn workspace stop NAME|ID [flags] +kdn stop NAME|ID [flags] ``` #### Arguments @@ -2364,39 +2364,39 @@ kortex-cli stop NAME|ID [flags] - `--output, -o ` - Output format (supported: `json`) - `--show-logs` - Show stdout and stderr from runtime commands (cannot be combined with `--output json`) -- `--storage ` - Storage directory for kortex-cli data (default: `$HOME/.kortex-cli`) +- `--storage ` - Storage directory for kdn data (default: `$HOME/.kortex-cli`) #### Examples **Stop a workspace by ID:** ```bash -kortex-cli workspace stop a1b2c3d4e5f6... +kdn workspace stop a1b2c3d4e5f6... ``` Output: `a1b2c3d4e5f6...` (ID of stopped workspace) **Stop a workspace by name:** ```bash -kortex-cli workspace stop my-project +kdn workspace stop my-project ``` Output: `a1b2c3d4e5f6...` (ID of stopped workspace) **Use the short alias:** ```bash -kortex-cli stop my-project +kdn stop my-project ``` **View workspace names and IDs before stopping:** ```bash # First, list all workspaces to find the name or ID -kortex-cli list +kdn list # Then stop the desired workspace (using either name or ID) -kortex-cli stop my-project +kdn stop my-project ``` **JSON output:** ```bash -kortex-cli workspace stop a1b2c3d4e5f6... --output json +kdn workspace stop a1b2c3d4e5f6... --output json ``` Output: ```json @@ -2407,19 +2407,19 @@ Output: **JSON output with short flag:** ```bash -kortex-cli stop a1b2c3d4e5f6... -o json +kdn stop a1b2c3d4e5f6... -o json ``` **Show runtime command output:** ```bash -kortex-cli workspace stop a1b2c3d4e5f6... --show-logs +kdn workspace stop a1b2c3d4e5f6... --show-logs ``` #### Error Handling **Workspace not found (text format):** ```bash -kortex-cli stop invalid-id +kdn stop invalid-id ``` Output: ```text @@ -2429,7 +2429,7 @@ Use 'workspace list' to see available workspaces **Workspace not found (JSON format):** ```bash -kortex-cli stop invalid-id --output json +kdn stop invalid-id --output json ``` Output: ```json @@ -2455,8 +2455,8 @@ Connects to a running workspace with an interactive terminal session. Also avail #### Usage ```bash -kortex-cli workspace terminal NAME|ID [COMMAND...] [flags] -kortex-cli terminal NAME|ID [COMMAND...] [flags] +kdn workspace terminal NAME|ID [COMMAND...] [flags] +kdn terminal NAME|ID [COMMAND...] [flags] ``` #### Arguments @@ -2466,56 +2466,56 @@ kortex-cli terminal NAME|ID [COMMAND...] [flags] #### Flags -- `--storage ` - Storage directory for kortex-cli data (default: `$HOME/.kortex-cli`) +- `--storage ` - Storage directory for kdn data (default: `$HOME/.kortex-cli`) #### Examples **Connect using the default agent command (by ID):** ```bash -kortex-cli workspace terminal a1b2c3d4e5f6... +kdn workspace terminal a1b2c3d4e5f6... ``` **Connect using the default agent command (by name):** ```bash -kortex-cli workspace terminal my-project +kdn workspace terminal my-project ``` This starts an interactive session with the default agent (typically Claude Code) inside the running workspace container. **Use the short alias:** ```bash -kortex-cli terminal my-project +kdn terminal my-project ``` **Run a bash shell:** ```bash -kortex-cli terminal my-project bash +kdn terminal my-project bash ``` -**Run a command with flags (use -- to prevent kortex-cli from parsing them):** +**Run a command with flags (use -- to prevent kdn from parsing them):** ```bash -kortex-cli terminal a1b2c3d4e5f6... -- bash -c 'echo hello' +kdn terminal a1b2c3d4e5f6... -- bash -c 'echo hello' ``` -The `--` separator tells kortex-cli to stop parsing flags and pass everything after it directly to the container. This is useful when your command includes flags that would otherwise be interpreted by kortex-cli. +The `--` separator tells kdn to stop parsing flags and pass everything after it directly to the container. This is useful when your command includes flags that would otherwise be interpreted by kdn. **List workspaces and connect to a running one:** ```bash # First, list all workspaces to find the ID -kortex-cli list +kdn list # Start a workspace if it's not running -kortex-cli start a1b2c3d4e5f6... +kdn start a1b2c3d4e5f6... # Then connect with a terminal -kortex-cli terminal a1b2c3d4e5f6... +kdn terminal a1b2c3d4e5f6... ``` #### Error Handling **Workspace not found:** ```bash -kortex-cli terminal invalid-id +kdn terminal invalid-id ``` Output: ```text @@ -2525,7 +2525,7 @@ Use 'workspace list' to see available workspaces **Workspace not running:** ```bash -kortex-cli terminal a1b2c3d4e5f6... +kdn terminal a1b2c3d4e5f6... ``` Output: ```text @@ -2534,8 +2534,8 @@ Error: instance is not running (current state: created) In this case, you need to start the workspace first: ```bash -kortex-cli start a1b2c3d4e5f6... -kortex-cli terminal a1b2c3d4e5f6... +kdn start a1b2c3d4e5f6... +kdn terminal a1b2c3d4e5f6... ``` #### Notes @@ -2546,7 +2546,7 @@ kortex-cli terminal a1b2c3d4e5f6... - For example, if the workspace was created with `--agent claude`, it will use the command defined in `claude.json` (typically `["claude"]`) - This ensures you connect directly to the configured agent - You can override the default by providing a custom command (e.g., `bash`, `python`, or any executable available in the container) -- Use the `--` separator when your command includes flags to prevent kortex-cli from trying to parse them +- Use the `--` separator when your command includes flags to prevent kdn from trying to parse them - The terminal session is fully interactive with stdin/stdout/stderr connected to your terminal - The command execution happens inside the workspace's container/runtime environment - JSON output is **not supported** for this command as it's inherently interactive @@ -2559,8 +2559,8 @@ Removes a registered workspace by its name or ID. Also available as the shorter #### Usage ```bash -kortex-cli workspace remove NAME|ID [flags] -kortex-cli remove NAME|ID [flags] +kdn workspace remove NAME|ID [flags] +kdn remove NAME|ID [flags] ``` #### Arguments @@ -2572,45 +2572,45 @@ kortex-cli remove NAME|ID [flags] - `--force, -f` - Stop the workspace if it is running before removing it - `--output, -o ` - Output format (supported: `json`) - `--show-logs` - Show stdout and stderr from runtime commands (cannot be combined with `--output json`) -- `--storage ` - Storage directory for kortex-cli data (default: `$HOME/.kortex-cli`) +- `--storage ` - Storage directory for kdn data (default: `$HOME/.kortex-cli`) #### Examples **Remove a workspace by ID:** ```bash -kortex-cli workspace remove a1b2c3d4e5f6... +kdn workspace remove a1b2c3d4e5f6... ``` Output: `a1b2c3d4e5f6...` (ID of removed workspace) **Remove a workspace by name:** ```bash -kortex-cli workspace remove my-project +kdn workspace remove my-project ``` Output: `a1b2c3d4e5f6...` (ID of removed workspace) **Use the short alias:** ```bash -kortex-cli remove my-project +kdn remove my-project ``` **View workspace names and IDs before removing:** ```bash # First, list all workspaces to find the name or ID -kortex-cli list +kdn list # Then remove the desired workspace (using either name or ID) -kortex-cli remove my-project +kdn remove my-project ``` **Remove a running workspace (stops it first):** ```bash -kortex-cli workspace remove a1b2c3d4e5f6... --force +kdn workspace remove a1b2c3d4e5f6... --force ``` Output: `a1b2c3d4e5f6...` (ID of removed workspace) **JSON output:** ```bash -kortex-cli workspace remove a1b2c3d4e5f6... --output json +kdn workspace remove a1b2c3d4e5f6... --output json ``` Output: ```json @@ -2621,19 +2621,19 @@ Output: **JSON output with short flag:** ```bash -kortex-cli remove a1b2c3d4e5f6... -o json +kdn remove a1b2c3d4e5f6... -o json ``` **Show runtime command output:** ```bash -kortex-cli workspace remove a1b2c3d4e5f6... --show-logs +kdn workspace remove a1b2c3d4e5f6... --show-logs ``` #### Error Handling **Workspace not found (text format):** ```bash -kortex-cli remove invalid-id +kdn remove invalid-id ``` Output: ```text @@ -2643,7 +2643,7 @@ Use 'workspace list' to see available workspaces **Workspace not found (JSON format):** ```bash -kortex-cli remove invalid-id --output json +kdn remove invalid-id --output json ``` Output: ```json @@ -2658,18 +2658,18 @@ Attempting to remove a running workspace without `--force` will fail because the ```bash # Stop first, then remove -kortex-cli stop a1b2c3d4e5f6... -kortex-cli remove a1b2c3d4e5f6... +kdn stop a1b2c3d4e5f6... +kdn remove a1b2c3d4e5f6... # Or remove in one step -kortex-cli remove a1b2c3d4e5f6... --force +kdn remove a1b2c3d4e5f6... --force ``` #### Notes - You can specify the workspace using either its name or ID (both can be obtained using the `workspace list` or `list` command) - The command always outputs the workspace ID, even when removed by name -- Removing a workspace only unregisters it from kortex-cli; it does not delete any files from the sources or configuration directories +- Removing a workspace only unregisters it from kdn; it does not delete any files from the sources or configuration directories - If the workspace name or ID is not found, the command will fail with a helpful error message - Use `--force` to automatically stop a running workspace before removing it; without this flag, removing a running workspace will fail - Tab completion for this command suggests only non-running workspaces by default; when `--force` is specified, all workspaces are suggested diff --git a/cmd/kortex-cli/main.go b/cmd/kdn/main.go similarity index 100% rename from cmd/kortex-cli/main.go rename to cmd/kdn/main.go diff --git a/cmd/kortex-cli/main_test.go b/cmd/kdn/main_test.go similarity index 96% rename from cmd/kortex-cli/main_test.go rename to cmd/kdn/main_test.go index c3d508d..e85f4b0 100644 --- a/cmd/kortex-cli/main_test.go +++ b/cmd/kdn/main_test.go @@ -29,7 +29,7 @@ func TestMain_VersionSubcommand(t *testing.T) { defer func() { os.Args = oldArgs }() // Set os.Args to call the version subcommand - os.Args = []string{"kortex-cli", "version"} + os.Args = []string{"kdn", "version"} // Call main() - test passes if it doesn't panic main() diff --git a/pkg/cmd/helpers.go b/pkg/cmd/helpers.go index 2f131b1..eef59d5 100644 --- a/pkg/cmd/helpers.go +++ b/pkg/cmd/helpers.go @@ -24,26 +24,26 @@ import "strings" // Example: // // original := `# List all workspaces -// kortex-cli workspace list +// kdn workspace list // // # List in JSON format -// kortex-cli workspace list --output json` +// kdn workspace list --output json` // // adapted := AdaptExampleForAlias(original, "workspace list", "list") // // Result: // // `# List all workspaces -// // kortex-cli list +// // kdn list // // // // # List in JSON format -// // kortex-cli list --output json` +// // kdn list --output json` func AdaptExampleForAlias(example, originalCmd, aliasCmd string) string { lines := strings.Split(example, "\n") var result []string for _, line := range lines { trimmed := strings.TrimSpace(line) - // Only replace in command lines (starting with kortex-cli), not in comments - if strings.HasPrefix(trimmed, "kortex-cli ") { + // Only replace in command lines (starting with kdn), not in comments + if strings.HasPrefix(trimmed, "kdn ") { line = strings.Replace(line, originalCmd, aliasCmd, 1) } result = append(result, line) diff --git a/pkg/cmd/helpers_test.go b/pkg/cmd/helpers_test.go index 72dc004..2af44b7 100644 --- a/pkg/cmd/helpers_test.go +++ b/pkg/cmd/helpers_test.go @@ -29,59 +29,59 @@ func TestAdaptExampleForAlias(t *testing.T) { { name: "replaces command in simple example", example: `# List all workspaces -kortex-cli workspace list`, +kdn workspace list`, originalCmd: "workspace list", aliasCmd: "list", want: `# List all workspaces -kortex-cli list`, +kdn list`, }, { name: "replaces command with flags", example: `# List workspaces in JSON format -kortex-cli workspace list --output json`, +kdn workspace list --output json`, originalCmd: "workspace list", aliasCmd: "list", want: `# List workspaces in JSON format -kortex-cli list --output json`, +kdn list --output json`, }, { name: "replaces multiple occurrences", example: `# List all workspaces -kortex-cli workspace list +kdn workspace list # List in JSON format -kortex-cli workspace list --output json +kdn workspace list --output json # List using short flag -kortex-cli workspace list -o json`, +kdn workspace list -o json`, originalCmd: "workspace list", aliasCmd: "list", want: `# List all workspaces -kortex-cli list +kdn list # List in JSON format -kortex-cli list --output json +kdn list --output json # List using short flag -kortex-cli list -o json`, +kdn list -o json`, }, { name: "does not replace in comments", example: `# Use workspace list to see all workspaces -kortex-cli workspace list`, +kdn workspace list`, originalCmd: "workspace list", aliasCmd: "list", want: `# Use workspace list to see all workspaces -kortex-cli list`, +kdn list`, }, { name: "replaces remove command", example: `# Remove workspace by ID -kortex-cli workspace remove abc123`, +kdn workspace remove abc123`, originalCmd: "workspace remove", aliasCmd: "remove", want: `# Remove workspace by ID -kortex-cli remove abc123`, +kdn remove abc123`, }, { name: "handles empty example", @@ -93,17 +93,17 @@ kortex-cli remove abc123`, { name: "preserves indentation", example: `# List all workspaces -kortex-cli workspace list +kdn workspace list # Another example - kortex-cli workspace list --output json`, + kdn workspace list --output json`, originalCmd: "workspace list", aliasCmd: "list", want: `# List all workspaces -kortex-cli list +kdn list # Another example - kortex-cli list --output json`, + kdn list --output json`, }, } diff --git a/pkg/cmd/info.go b/pkg/cmd/info.go index 1f80d8c..50e1fee 100644 --- a/pkg/cmd/info.go +++ b/pkg/cmd/info.go @@ -107,15 +107,15 @@ func NewInfoCmd() *cobra.Command { cmd := &cobra.Command{ Use: "info", - Short: "Display information about kortex-cli", + Short: "Display information about kdn", Example: `# Show info -kortex-cli info +kdn info # Show info in JSON format -kortex-cli info --output json +kdn info --output json # Show info using short flag -kortex-cli info -o json`, +kdn info -o json`, Args: cobra.NoArgs, PreRunE: c.preRun, RunE: c.run, diff --git a/pkg/cmd/init.go b/pkg/cmd/init.go index c42088e..faf8441 100644 --- a/pkg/cmd/init.go +++ b/pkg/cmd/init.go @@ -301,28 +301,28 @@ func NewInitCmd() *cobra.Command { The sources directory defaults to the current directory (.) if not specified. The workspace configuration directory defaults to .kaiden/ inside the sources directory if not specified.`, Example: `# Register current directory as workspace -kortex-cli init --runtime podman --agent claude +kdn init --runtime podman --agent claude # Register specific directory as workspace -kortex-cli init --runtime podman --agent claude /path/to/project +kdn init --runtime podman --agent claude /path/to/project # Register with custom workspace name -kortex-cli init --runtime podman --agent claude --name my-project +kdn init --runtime podman --agent claude --name my-project # Register with custom project identifier -kortex-cli init --runtime podman --agent goose --project my-custom-project +kdn init --runtime podman --agent goose --project my-custom-project # Register with a specific model -kortex-cli init --runtime podman --agent claude --model claude-sonnet-4-20250514 +kdn init --runtime podman --agent claude --model claude-sonnet-4-20250514 # Register and start workspace -kortex-cli init --runtime podman --agent claude --start +kdn init --runtime podman --agent claude --start # Show detailed output -kortex-cli init --runtime podman --agent claude --verbose +kdn init --runtime podman --agent claude --verbose # Show runtime command output -kortex-cli init --runtime podman --agent claude --show-logs`, +kdn init --runtime podman --agent claude --show-logs`, Args: cobra.MaximumNArgs(1), PreRunE: c.preRun, RunE: c.run, diff --git a/pkg/cmd/root.go b/pkg/cmd/root.go index 671a1a8..5041c44 100644 --- a/pkg/cmd/root.go +++ b/pkg/cmd/root.go @@ -39,7 +39,7 @@ func NewRootCmd() *cobra.Command { } rootCmd := &cobra.Command{ - Use: "kortex-cli", + Use: "kdn", Short: "Launch and manage AI agent workspaces with custom configurations", Args: cobra.NoArgs, SilenceUsage: true, @@ -89,7 +89,7 @@ func NewRootCmd() *cobra.Command { rootCmd.AddCommand(NewInfoCmd()) // Global flags - rootCmd.PersistentFlags().String("storage", defaultStoragePath, "Directory where kortex-cli will store all its files") + rootCmd.PersistentFlags().String("storage", defaultStoragePath, "Directory where kdn will store all its files") return rootCmd } diff --git a/pkg/cmd/root_test.go b/pkg/cmd/root_test.go index b7e5c23..117071b 100644 --- a/pkg/cmd/root_test.go +++ b/pkg/cmd/root_test.go @@ -29,8 +29,8 @@ func TestRootCmd_Initialization(t *testing.T) { t.Parallel() rootCmd := NewRootCmd() - if rootCmd.Use != "kortex-cli" { - t.Errorf("Expected Use to be 'kortex-cli', got '%s'", rootCmd.Use) + if rootCmd.Use != "kdn" { + t.Errorf("Expected Use to be 'kdn', got '%s'", rootCmd.Use) } if rootCmd.Short == "" { diff --git a/pkg/cmd/terminal_test.go b/pkg/cmd/terminal_test.go index cd2a8cd..eb5d855 100644 --- a/pkg/cmd/terminal_test.go +++ b/pkg/cmd/terminal_test.go @@ -68,12 +68,12 @@ func TestTerminalCmd_ExamplesAdapted(t *testing.T) { terminalCmd := NewTerminalCmd() // Verify examples are adapted - if !strings.Contains(terminalCmd.Example, "kortex-cli terminal") { - t.Error("Expected examples to contain 'kortex-cli terminal'") + if !strings.Contains(terminalCmd.Example, "kdn terminal") { + t.Error("Expected examples to contain 'kdn terminal'") } - if strings.Contains(terminalCmd.Example, "kortex-cli workspace terminal") { - t.Error("Examples should not contain 'kortex-cli workspace terminal'") + if strings.Contains(terminalCmd.Example, "kdn workspace terminal") { + t.Error("Examples should not contain 'kdn workspace terminal'") } } diff --git a/pkg/cmd/testutil/example_validator.go b/pkg/cmd/testutil/example_validator.go index 8704414..714a569 100644 --- a/pkg/cmd/testutil/example_validator.go +++ b/pkg/cmd/testutil/example_validator.go @@ -25,16 +25,16 @@ import ( // ExampleCommand represents a parsed command from an Example string type ExampleCommand struct { Raw string // Original command line - Binary string // Binary name (should be "kortex-cli") + Binary string // Binary name (should be "kdn") Args []string // Subcommands and positional arguments FlagPresent map[string]bool // Flags that were present in the command FlagValues map[string]string // Values for flags (empty string if no value provided) Flags map[string]string // Deprecated: use FlagPresent and FlagValues instead } -// ParseExampleCommands extracts kortex-cli commands from Example string +// ParseExampleCommands extracts kdn commands from Example string // - Ignores empty lines and comment lines (starting with #) -// - Returns error if non-comment, non-kortex-cli lines exist +// - Returns error if non-comment, non-kdn lines exist func ParseExampleCommands(example string) ([]ExampleCommand, error) { var commands []ExampleCommand lines := strings.Split(example, "\n") @@ -72,9 +72,9 @@ func parseCommandLine(line string) (ExampleCommand, error) { return ExampleCommand{}, fmt.Errorf("empty command line") } - // First part should be kortex-cli - if parts[0] != "kortex-cli" { - return ExampleCommand{}, fmt.Errorf("command must start with 'kortex-cli', got '%s'", parts[0]) + // First part should be kdn + if parts[0] != "kdn" { + return ExampleCommand{}, fmt.Errorf("command must start with 'kdn', got '%s'", parts[0]) } cmd := ExampleCommand{ diff --git a/pkg/cmd/testutil/example_validator_test.go b/pkg/cmd/testutil/example_validator_test.go index 12adaa0..719eb33 100644 --- a/pkg/cmd/testutil/example_validator_test.go +++ b/pkg/cmd/testutil/example_validator_test.go @@ -32,11 +32,11 @@ func TestParseExampleCommands(t *testing.T) { }{ { name: "single command", - example: `kortex-cli init`, + example: `kdn init`, wantCount: 1, checkCommands: func(t *testing.T, commands []ExampleCommand) { - if commands[0].Binary != "kortex-cli" { - t.Errorf("Expected binary 'kortex-cli', got '%s'", commands[0].Binary) + if commands[0].Binary != "kdn" { + t.Errorf("Expected binary 'kdn', got '%s'", commands[0].Binary) } if len(commands[0].Args) != 1 || commands[0].Args[0] != "init" { t.Errorf("Expected args [init], got %v", commands[0].Args) @@ -46,10 +46,10 @@ func TestParseExampleCommands(t *testing.T) { { name: "multiple commands with comments", example: `# Initialize workspace -kortex-cli init +kdn init # List workspaces -kortex-cli workspace list`, +kdn workspace list`, wantCount: 2, checkCommands: func(t *testing.T, commands []ExampleCommand) { if len(commands[0].Args) != 1 || commands[0].Args[0] != "init" { @@ -62,7 +62,7 @@ kortex-cli workspace list`, }, { name: "command with long flag using equals", - example: `kortex-cli workspace list --output=json`, + example: `kdn workspace list --output=json`, wantCount: 1, checkCommands: func(t *testing.T, commands []ExampleCommand) { if commands[0].Flags["output"] != "json" { @@ -72,7 +72,7 @@ kortex-cli workspace list`, }, { name: "command with long flag using space", - example: `kortex-cli workspace list --output json`, + example: `kdn workspace list --output json`, wantCount: 1, checkCommands: func(t *testing.T, commands []ExampleCommand) { if commands[0].Flags["output"] != "json" { @@ -82,7 +82,7 @@ kortex-cli workspace list`, }, { name: "command with short flag", - example: `kortex-cli workspace list -o json`, + example: `kdn workspace list -o json`, wantCount: 1, checkCommands: func(t *testing.T, commands []ExampleCommand) { if commands[0].Flags["o"] != "json" { @@ -92,7 +92,7 @@ kortex-cli workspace list`, }, { name: "command with positional argument", - example: `kortex-cli workspace remove abc123`, + example: `kdn workspace remove abc123`, wantCount: 1, checkCommands: func(t *testing.T, commands []ExampleCommand) { if len(commands[0].Args) != 3 { @@ -105,7 +105,7 @@ kortex-cli workspace list`, }, { name: "command with path argument", - example: `kortex-cli init /path/to/project`, + example: `kdn init /path/to/project`, wantCount: 1, checkCommands: func(t *testing.T, commands []ExampleCommand) { if len(commands[0].Args) != 2 { @@ -118,7 +118,7 @@ kortex-cli workspace list`, }, { name: "command with boolean flag", - example: `kortex-cli init --verbose`, + example: `kdn init --verbose`, wantCount: 1, checkCommands: func(t *testing.T, commands []ExampleCommand) { if _, exists := commands[0].Flags["verbose"]; !exists { @@ -146,7 +146,7 @@ kortex-cli workspace list`, }, { name: "command with multiple flags", - example: `kortex-cli init --name my-project --verbose`, + example: `kdn init --name my-project --verbose`, wantCount: 1, checkCommands: func(t *testing.T, commands []ExampleCommand) { if commands[0].Flags["name"] != "my-project" { @@ -159,11 +159,11 @@ kortex-cli workspace list`, }, { name: "command with -- separator", - example: `kortex-cli terminal abc123 -- bash -c 'echo hello'`, + example: `kdn terminal abc123 -- bash -c 'echo hello'`, wantCount: 1, checkCommands: func(t *testing.T, commands []ExampleCommand) { - if commands[0].Binary != "kortex-cli" { - t.Errorf("Expected binary 'kortex-cli', got '%s'", commands[0].Binary) + if commands[0].Binary != "kdn" { + t.Errorf("Expected binary 'kdn', got '%s'", commands[0].Binary) } // Should have: terminal, abc123, bash, -c, echo hello expectedArgs := []string{"terminal", "abc123", "bash", "-c", "echo hello"} @@ -183,7 +183,7 @@ kortex-cli workspace list`, }, { name: "command with flags before -- separator", - example: `kortex-cli terminal --storage /tmp abc123 -- bash -l`, + example: `kdn terminal --storage /tmp abc123 -- bash -l`, wantCount: 1, checkCommands: func(t *testing.T, commands []ExampleCommand) { // Should have flag before -- @@ -238,7 +238,7 @@ func TestValidateExampleCommand(t *testing.T) { // Helper function to create a fresh command tree for each test createTestCommandTree := func() *cobra.Command { rootCmd := &cobra.Command{ - Use: "kortex-cli", + Use: "kdn", } workspaceCmd := &cobra.Command{ @@ -281,8 +281,8 @@ func TestValidateExampleCommand(t *testing.T) { { name: "valid command - init", exampleCmd: ExampleCommand{ - Raw: "kortex-cli init", - Binary: "kortex-cli", + Raw: "kdn init", + Binary: "kdn", Args: []string{"init"}, FlagPresent: map[string]bool{}, FlagValues: map[string]string{}, @@ -292,8 +292,8 @@ func TestValidateExampleCommand(t *testing.T) { { name: "valid command - workspace list", exampleCmd: ExampleCommand{ - Raw: "kortex-cli workspace list", - Binary: "kortex-cli", + Raw: "kdn workspace list", + Binary: "kdn", Args: []string{"workspace", "list"}, FlagPresent: map[string]bool{}, FlagValues: map[string]string{}, @@ -303,8 +303,8 @@ func TestValidateExampleCommand(t *testing.T) { { name: "valid command with flag", exampleCmd: ExampleCommand{ - Raw: "kortex-cli workspace list --output json", - Binary: "kortex-cli", + Raw: "kdn workspace list --output json", + Binary: "kdn", Args: []string{"workspace", "list"}, FlagPresent: map[string]bool{"output": true}, FlagValues: map[string]string{"output": "json"}, @@ -314,8 +314,8 @@ func TestValidateExampleCommand(t *testing.T) { { name: "valid command with short flag", exampleCmd: ExampleCommand{ - Raw: "kortex-cli workspace list -f json", - Binary: "kortex-cli", + Raw: "kdn workspace list -f json", + Binary: "kdn", Args: []string{"workspace", "list"}, FlagPresent: map[string]bool{"f": true}, FlagValues: map[string]string{"f": "json"}, @@ -325,8 +325,8 @@ func TestValidateExampleCommand(t *testing.T) { { name: "valid command with persistent flag", exampleCmd: ExampleCommand{ - Raw: "kortex-cli init --storage /tmp/storage", - Binary: "kortex-cli", + Raw: "kdn init --storage /tmp/storage", + Binary: "kdn", Args: []string{"init"}, FlagPresent: map[string]bool{"storage": true}, FlagValues: map[string]string{"storage": "/tmp/storage"}, @@ -336,8 +336,8 @@ func TestValidateExampleCommand(t *testing.T) { { name: "invalid command - non-existent", exampleCmd: ExampleCommand{ - Raw: "kortex-cli nonexistent", - Binary: "kortex-cli", + Raw: "kdn nonexistent", + Binary: "kdn", Args: []string{"nonexistent"}, FlagPresent: map[string]bool{}, FlagValues: map[string]string{}, @@ -347,8 +347,8 @@ func TestValidateExampleCommand(t *testing.T) { { name: "invalid flag", exampleCmd: ExampleCommand{ - Raw: "kortex-cli init --nonexistent-flag value", - Binary: "kortex-cli", + Raw: "kdn init --nonexistent-flag value", + Binary: "kdn", Args: []string{"init"}, FlagPresent: map[string]bool{"nonexistent-flag": true}, FlagValues: map[string]string{"nonexistent-flag": "value"}, @@ -358,8 +358,8 @@ func TestValidateExampleCommand(t *testing.T) { { name: "valid command with multiple flags", exampleCmd: ExampleCommand{ - Raw: "kortex-cli init --name test --verbose", - Binary: "kortex-cli", + Raw: "kdn init --name test --verbose", + Binary: "kdn", Args: []string{"init"}, FlagPresent: map[string]bool{"name": true, "verbose": true}, FlagValues: map[string]string{"name": "test", "verbose": ""}, @@ -369,8 +369,8 @@ func TestValidateExampleCommand(t *testing.T) { { name: "string flag missing value", exampleCmd: ExampleCommand{ - Raw: "kortex-cli init --name", - Binary: "kortex-cli", + Raw: "kdn init --name", + Binary: "kdn", Args: []string{"init"}, FlagPresent: map[string]bool{"name": true}, FlagValues: map[string]string{"name": ""}, @@ -380,8 +380,8 @@ func TestValidateExampleCommand(t *testing.T) { { name: "boolean flag without value is valid", exampleCmd: ExampleCommand{ - Raw: "kortex-cli init --verbose", - Binary: "kortex-cli", + Raw: "kdn init --verbose", + Binary: "kdn", Args: []string{"init"}, FlagPresent: map[string]bool{"verbose": true}, FlagValues: map[string]string{"verbose": ""}, @@ -391,8 +391,8 @@ func TestValidateExampleCommand(t *testing.T) { { name: "extra positional to leaf command", exampleCmd: ExampleCommand{ - Raw: "kortex-cli workspace list extra", - Binary: "kortex-cli", + Raw: "kdn workspace list extra", + Binary: "kdn", Args: []string{"workspace", "list", "extra"}, FlagPresent: map[string]bool{}, FlagValues: map[string]string{}, @@ -429,7 +429,7 @@ func TestValidateCommandExamples(t *testing.T) { // Helper function to create a fresh command tree for each test createTestCommandTree := func() *cobra.Command { rootCmd := &cobra.Command{ - Use: "kortex-cli", + Use: "kdn", } initCmd := &cobra.Command{ @@ -452,28 +452,28 @@ func TestValidateCommandExamples(t *testing.T) { { name: "valid examples", example: `# Initialize workspace -kortex-cli init +kdn init # Initialize with name -kortex-cli init --name my-project +kdn init --name my-project # Verbose output -kortex-cli init --verbose`, +kdn init --verbose`, wantErr: false, }, { name: "invalid command in examples", example: `# Valid command -kortex-cli init +kdn init # Invalid command -kortex-cli nonexistent`, +kdn nonexistent`, wantErr: true, }, { name: "invalid flag in examples", example: `# Invalid flag -kortex-cli init --invalid-flag value`, +kdn init --invalid-flag value`, wantErr: true, }, { diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go index aed561c..74bd03d 100644 --- a/pkg/cmd/version.go +++ b/pkg/cmd/version.go @@ -26,10 +26,10 @@ import ( func NewVersionCmd() *cobra.Command { return &cobra.Command{ Use: "version", - Short: "Print the version number of kortex-cli", + Short: "Print the version number of kdn", Args: cobra.NoArgs, Run: func(cmd *cobra.Command, args []string) { - cmd.Printf("kortex-cli version %s\n", version.Version) + cmd.Printf("kdn version %s\n", version.Version) }, } } diff --git a/pkg/cmd/workspace.go b/pkg/cmd/workspace.go index 686af2f..b4ec0df 100644 --- a/pkg/cmd/workspace.go +++ b/pkg/cmd/workspace.go @@ -26,7 +26,7 @@ func NewWorkspaceCmd() *cobra.Command { cmd := &cobra.Command{ Use: "workspace", Short: "Manage workspaces", - Long: "Manage workspaces registered with kortex-cli init", + Long: "Manage workspaces registered with kdn init", Args: cobra.NoArgs, } diff --git a/pkg/cmd/workspace_list.go b/pkg/cmd/workspace_list.go index 024992f..2ea4b17 100644 --- a/pkg/cmd/workspace_list.go +++ b/pkg/cmd/workspace_list.go @@ -197,15 +197,15 @@ func NewWorkspaceListCmd() *cobra.Command { cmd := &cobra.Command{ Use: "list", Short: "List all registered workspaces", - Long: "List all workspaces registered with kortex-cli init", + Long: "List all workspaces registered with kdn init", Example: `# List all workspaces -kortex-cli workspace list +kdn workspace list # List workspaces in JSON format -kortex-cli workspace list --output json +kdn workspace list --output json # List using short flag -kortex-cli workspace list -o json`, +kdn workspace list -o json`, Args: cobra.NoArgs, PreRunE: c.preRun, RunE: c.run, diff --git a/pkg/cmd/workspace_remove.go b/pkg/cmd/workspace_remove.go index 6f77e79..ad36b44 100644 --- a/pkg/cmd/workspace_remove.go +++ b/pkg/cmd/workspace_remove.go @@ -179,16 +179,16 @@ func NewWorkspaceRemoveCmd() *cobra.Command { Short: "Remove a workspace", Long: "Remove a workspace by its name or ID", Example: `# Remove workspace by ID -kortex-cli workspace remove abc123 +kdn workspace remove abc123 # Remove workspace by name -kortex-cli workspace remove my-project +kdn workspace remove my-project # Remove workspace and show runtime command output -kortex-cli workspace remove abc123 --show-logs +kdn workspace remove abc123 --show-logs # Remove a running workspace (stops it first) -kortex-cli workspace remove abc123 --force`, +kdn workspace remove abc123 --force`, Args: cobra.ExactArgs(1), ValidArgsFunction: completeRemoveWorkspaceID, PreRunE: c.preRun, diff --git a/pkg/cmd/workspace_start.go b/pkg/cmd/workspace_start.go index 67de62f..c73601d 100644 --- a/pkg/cmd/workspace_start.go +++ b/pkg/cmd/workspace_start.go @@ -166,16 +166,16 @@ func NewWorkspaceStartCmd() *cobra.Command { Short: "Start a workspace", Long: "Start a workspace by its name or ID", Example: `# Start workspace by ID -kortex-cli workspace start abc123 +kdn workspace start abc123 # Start workspace by name -kortex-cli workspace start my-project +kdn workspace start my-project # Start workspace with JSON output -kortex-cli workspace start abc123 --output json +kdn workspace start abc123 --output json # Start workspace and show runtime command output -kortex-cli workspace start abc123 --show-logs`, +kdn workspace start abc123 --show-logs`, Args: cobra.ExactArgs(1), ValidArgsFunction: completeNonRunningWorkspaceID, PreRunE: c.preRun, diff --git a/pkg/cmd/workspace_stop.go b/pkg/cmd/workspace_stop.go index 78c8d71..b0bea64 100644 --- a/pkg/cmd/workspace_stop.go +++ b/pkg/cmd/workspace_stop.go @@ -166,16 +166,16 @@ func NewWorkspaceStopCmd() *cobra.Command { Short: "Stop a workspace", Long: "Stop a workspace by its name or ID", Example: `# Stop workspace by ID -kortex-cli workspace stop abc123 +kdn workspace stop abc123 # Stop workspace by name -kortex-cli workspace stop my-project +kdn workspace stop my-project # Stop workspace with JSON output -kortex-cli workspace stop abc123 --output json +kdn workspace stop abc123 --output json # Stop workspace and show runtime command output -kortex-cli workspace stop abc123 --show-logs`, +kdn workspace stop abc123 --show-logs`, Args: cobra.ExactArgs(1), ValidArgsFunction: completeRunningWorkspaceID, PreRunE: c.preRun, diff --git a/pkg/cmd/workspace_terminal.go b/pkg/cmd/workspace_terminal.go index 6bf672a..28d7dfb 100644 --- a/pkg/cmd/workspace_terminal.go +++ b/pkg/cmd/workspace_terminal.go @@ -112,16 +112,16 @@ this by providing a custom command. The workspace must be in a running state. Use 'workspace start' to start a workspace before connecting.`, Example: `# Connect using the default agent command (by ID) -kortex-cli workspace terminal abc123 +kdn workspace terminal abc123 # Connect using the default agent command (by name) -kortex-cli workspace terminal my-project +kdn workspace terminal my-project # Run a bash shell -kortex-cli workspace terminal abc123 bash +kdn workspace terminal abc123 bash -# Run a command with flags (use -- to prevent kortex-cli from parsing them) -kortex-cli workspace terminal abc123 -- bash -c 'echo hello'`, +# Run a command with flags (use -- to prevent kdn from parsing them) +kdn workspace terminal abc123 -- bash -c 'echo hello'`, Args: cobra.MinimumNArgs(1), ValidArgsFunction: completeRunningWorkspaceID, PreRunE: c.preRun, diff --git a/skills/README.md b/skills/README.md index e2460e6..8bb6e01 100644 --- a/skills/README.md +++ b/skills/README.md @@ -20,8 +20,8 @@ Each skill is contained in its own subdirectory with a `SKILL.md` file that defi - **implementing-command-patterns**: Advanced patterns for implementing commands including flag binding, JSON output, and interactive sessions ### Runtime Development -- **add-runtime**: Add a new runtime implementation to the kortex-cli runtime system -- **working-with-runtime-system**: Guide to understanding and working with the kortex-cli runtime system architecture +- **add-runtime**: Add a new runtime implementation to the kdn runtime system +- **working-with-runtime-system**: Guide to understanding and working with the kdn runtime system architecture ### Configuration & Integration - **working-with-config-system**: Guide to workspace configuration for environment variables and mount points at multiple levels diff --git a/skills/add-alias-command/SKILL.md b/skills/add-alias-command/SKILL.md index 5cfeb77..4a987fa 100644 --- a/skills/add-alias-command/SKILL.md +++ b/skills/add-alias-command/SKILL.md @@ -85,7 +85,7 @@ func NewListCmd() *cobra.Command { The `AdaptExampleForAlias()` helper function (from `pkg/cmd/helpers.go`) automatically adapts examples for the alias: **What it does:** -- Replaces the target command with the alias **only in command lines** (lines starting with `kortex-cli`) +- Replaces the target command with the alias **only in command lines** (lines starting with `kdn`) - **Preserves comments unchanged** (lines starting with `#`) - Maintains formatting and indentation @@ -93,17 +93,17 @@ The `AdaptExampleForAlias()` helper function (from `pkg/cmd/helpers.go`) automat ```bash # Original (from workspace list): # List all workspaces -kortex-cli workspace list +kdn workspace list # List in JSON format -kortex-cli workspace list --output json +kdn workspace list --output json # After AdaptExampleForAlias(..., "workspace list", "list"): # List all workspaces -kortex-cli list +kdn list # List in JSON format -kortex-cli list --output json +kdn list --output json ``` ### 3. Register the Alias Command diff --git a/skills/add-command-simple/SKILL.md b/skills/add-command-simple/SKILL.md index 4f9f43e..c97e59a 100644 --- a/skills/add-command-simple/SKILL.md +++ b/skills/add-command-simple/SKILL.md @@ -48,13 +48,13 @@ func NewCmd() *cobra.Command { Short: "Short description of the command", Long: `Long description of what the command does.`, Example: `# Basic usage -kortex-cli arg1 +kdn arg1 # With verbose output -kortex-cli arg1 --verbose +kdn arg1 --verbose # With other flags -kortex-cli arg1 --flag value`, +kdn arg1 --flag value`, Args: cobra.ExactArgs(1), // Or NoArgs, MinimumNArgs(1), MaximumNArgs(1), etc. PreRunE: c.preRun, RunE: c.run, diff --git a/skills/add-command-with-json/SKILL.md b/skills/add-command-with-json/SKILL.md index 328ad9e..e75ed35 100644 --- a/skills/add-command-with-json/SKILL.md +++ b/skills/add-command-with-json/SKILL.md @@ -50,13 +50,13 @@ func NewCmd() *cobra.Command { Short: "Short description of the command", Long: `Long description of what the command does.`, Example: `# Basic usage -kortex-cli arg1 +kdn arg1 # With JSON output -kortex-cli arg1 --output json +kdn arg1 --output json # With other flags -kortex-cli arg1 --flag value`, +kdn arg1 --flag value`, Args: cobra.ExactArgs(1), // Or NoArgs, MinimumNArgs(1), MaximumNArgs(1), etc. PreRunE: c.preRun, RunE: c.run, diff --git a/skills/add-parent-command/SKILL.md b/skills/add-parent-command/SKILL.md index 7aed97b..605b9ea 100644 --- a/skills/add-parent-command/SKILL.md +++ b/skills/add-parent-command/SKILL.md @@ -33,10 +33,10 @@ func NewCmd() *cobra.Command { Short: "Short description of the parent command category", Long: `Long description explaining what this command category does and what subcommands are available.`, Example: `# Show available subcommands -kortex-cli --help +kdn --help # Execute a subcommand -kortex-cli `, +kdn `, Args: cobra.NoArgs, // Parent commands typically don't accept args directly } @@ -66,13 +66,13 @@ func NewWorkspaceCmd() *cobra.Command { Use these commands to initialize, list, and remove workspace configurations.`, Example: `# Show available workspace subcommands -kortex-cli workspace --help +kdn workspace --help # List all workspaces -kortex-cli workspace list +kdn workspace list # Remove a workspace -kortex-cli workspace remove `, +kdn workspace remove `, Args: cobra.NoArgs, } @@ -113,10 +113,10 @@ func NewWorkspaceListCmd() *cobra.Command { Short: "List all workspaces", Long: `List all initialized workspace instances with their details.`, Example: `# List all workspaces -kortex-cli workspace list +kdn workspace list # List with JSON output -kortex-cli workspace list --output json`, +kdn workspace list --output json`, Args: cobra.NoArgs, PreRunE: c.preRun, RunE: c.run, @@ -357,16 +357,16 @@ func NewWorkspaceCmd() *cobra.Command { Use these commands to initialize new workspaces, list existing ones, and remove workspaces that are no longer needed.`, Example: `# Show available workspace subcommands -kortex-cli workspace --help +kdn workspace --help # List all workspaces -kortex-cli workspace list +kdn workspace list # Remove a workspace -kortex-cli workspace remove +kdn workspace remove # Initialize a new workspace -kortex-cli workspace init /path/to/project`, +kdn workspace init /path/to/project`, Args: cobra.NoArgs, } diff --git a/skills/add-runtime/SKILL.md b/skills/add-runtime/SKILL.md index 2497111..428a6b1 100644 --- a/skills/add-runtime/SKILL.md +++ b/skills/add-runtime/SKILL.md @@ -1,12 +1,12 @@ --- name: add-runtime -description: Add a new runtime implementation to the kortex-cli runtime system +description: Add a new runtime implementation to the kdn runtime system argument-hint: --- # Add Runtime Skill -This skill guides you through adding a new runtime implementation to the kortex-cli runtime system. +This skill guides you through adding a new runtime implementation to the kdn runtime system. ## What are Runtimes? @@ -394,7 +394,7 @@ make test make build # Test with CLI (if runtime is available on your system) -./kortex-cli init --runtime +./kdn init --runtime ``` ## Required Interfaces @@ -597,16 +597,16 @@ After implementing a Podman runtime: ```bash # Initialize workspace with Podman runtime -./kortex-cli init --runtime podman +./kdn init --runtime podman # Start workspace -./kortex-cli workspace start +./kdn workspace start # Stop workspace -./kortex-cli workspace stop +./kdn workspace stop # Remove workspace -./kortex-cli workspace remove +./kdn workspace remove ``` ## Notes diff --git a/skills/testing-best-practices/SKILL.md b/skills/testing-best-practices/SKILL.md index 3089f64..48c7c85 100644 --- a/skills/testing-best-practices/SKILL.md +++ b/skills/testing-best-practices/SKILL.md @@ -6,7 +6,7 @@ argument-hint: "" # Testing Best Practices -This skill covers general testing best practices for the kortex-cli project, including parallel test execution and using fake objects for testability. +This skill covers general testing best practices for the kdn project, including parallel test execution and using fake objects for testability. ## Parallel Test Execution diff --git a/skills/working-with-config-system/SKILL.md b/skills/working-with-config-system/SKILL.md index 50eaa0a..22bb55c 100644 --- a/skills/working-with-config-system/SKILL.md +++ b/skills/working-with-config-system/SKILL.md @@ -29,7 +29,7 @@ These configurations control what gets injected **into** workspaces (environment ## Agent Default Settings Files -In addition to the env/mount configuration above, kortex-cli supports **default settings files** that are baked directly into the workspace image at `init` time. +In addition to the env/mount configuration above, kdn supports **default settings files** that are baked directly into the workspace image at `init` time. **Location:** `~/.kortex-cli/config//` (one directory per agent name) @@ -46,18 +46,18 @@ This is distinct from `agents.json`: **Automatic Onboarding Configuration:** -For supported agents (e.g., Claude), kortex-cli automatically modifies settings files to skip onboarding prompts: +For supported agents (e.g., Claude), kdn automatically modifies settings files to skip onboarding prompts: 1. Files are read from `config//` (e.g., `config/claude/.claude.json`) 2. If the agent is registered, its `SkipOnboarding()` method is called 3. The agent automatically adds necessary flags (e.g., `hasCompletedOnboarding`, `hasTrustDialogAccepted`) 4. Modified settings are embedded into the container image -This means you can optionally customize agent preferences (theme, etc.) in the settings files, and kortex-cli will automatically add the onboarding flags. +This means you can optionally customize agent preferences (theme, etc.) in the settings files, and kdn will automatically add the onboarding flags. **Model Configuration:** -When the `--model` flag is provided during `init`, kortex-cli calls the agent's `SetModel()` method to configure the model in the settings files: +When the `--model` flag is provided during `init`, kdn calls the agent's `SetModel()` method to configure the model in the settings files: 1. After `SkipOnboarding()` is called, if a model ID is specified, `SetModel()` is called 2. The agent sets the appropriate model field in its settings: @@ -86,7 +86,7 @@ All user-specific configuration files are stored under the storage directory (de - **Agent configs**: `/config/agents.json` - **Project configs**: `/config/projects.json` - **Workspace configs**: `.kaiden/workspace.json` (in workspace directory) - - Created/configured via `kortex-cli init --workspace-configuration ` + - Created/configured via `kdn init --workspace-configuration ` ## Configuration Precedence @@ -129,7 +129,7 @@ Use the `--workspace-configuration` flag with the `init` command to specify a di ```bash # Create workspace with custom configuration directory -kortex-cli init /path/to/workspace --workspace-configuration /path/to/config-dir +kdn init /path/to/workspace --workspace-configuration /path/to/config-dir # This will look for /path/to/config-dir/workspace.json ``` diff --git a/skills/working-with-runtime-system/SKILL.md b/skills/working-with-runtime-system/SKILL.md index 604f8fb..e7e42db 100644 --- a/skills/working-with-runtime-system/SKILL.md +++ b/skills/working-with-runtime-system/SKILL.md @@ -1,6 +1,6 @@ --- name: working-with-runtime-system -description: Guide to understanding and working with the kortex-cli runtime system architecture +description: Guide to understanding and working with the kdn runtime system architecture argument-hint: "" --- @@ -10,7 +10,7 @@ The runtime system provides a pluggable architecture for managing workspaces on ## Overview -The runtime system enables kortex-cli to support multiple backend platforms through a common interface. Each runtime implementation handles the platform-specific details of creating, starting, stopping, and managing workspace instances. +The runtime system enables kdn to support multiple backend platforms through a common interface. Each runtime implementation handles the platform-specific details of creating, starting, stopping, and managing workspace instances. ## Key Components diff --git a/website/WEBSITE.md b/website/WEBSITE.md index 4330a40..309dc30 100644 --- a/website/WEBSITE.md +++ b/website/WEBSITE.md @@ -1,6 +1,6 @@ # Website Documentation -This directory contains the MkDocs configuration for automatically generating the kortex-cli documentation website from the repository's README.md. +This directory contains the MkDocs configuration for automatically generating the kdn documentation website from the repository's README.md. ## How It Works diff --git a/website/mkdocs.yml b/website/mkdocs.yml index 484bf4c..f5c7f09 100644 --- a/website/mkdocs.yml +++ b/website/mkdocs.yml @@ -15,7 +15,7 @@ # SPDX-License-Identifier: Apache-2.0 # Site metadata -site_name: kortex-cli Documentation +site_name: kdn Documentation site_description: Command-line interface for launching and managing AI agents (Claude Code, Goose, Cursor) with custom configurations site_author: Red Hat site_url: https://kortex-hub.github.io/kortex-cli/ @@ -129,7 +129,7 @@ extra: social: - icon: fontawesome/brands/github link: https://github.com/kortex-hub/kortex-cli - name: kortex-cli on GitHub + name: kdn on GitHub generator: false # Don't show "Made with Material for MkDocs" # Additional CSS and JavaScript (if needed in future)