Skip to content

Add repository navigation option (-r) to icd command #2133

Description

@vivu001

Feature idea

Extend the icd command by introducing a repository navigation option -r that allows users to directly navigate not only to a project but also into a specific repository within that project.

The new option should enhance the current navigation behavior by supporting both explicit and implicit repository selection.

Expected behavior:

  1. Basic usage (no argument)
icd -p IDEasy -r

No repository name is provided → fallback to the <project-name>.

  1. Explicit repository selection
icd -p IDEasy -r <repository-name>

The value after -r is interpreted as the repository (folder) name within the selected project. The repository is resolved in the context of the selected workspace.

  1. Workspace resolution behavior
    If no workspace is explicitly provided, the command should:
  • First search the workspace main
  • If no match is found, search all remaining workspaces
  • Navigate to the first workspace (in this search order) containing the repository
  1. Error handling
    If no matching repository is found in any workspace, the command should fail with a clear and informative error message, e.g:
Error: Repository '<name>' not found in any workspace.

Examples:

Example A (found in main):
icd -p IDEasy -r cli
→ navigate to /workspaces/main/IDEasy/cli

Example B (not in main, found in a next workspace)
icd -p IDEasy -r backend

Search order:
/workspaces/main/IDEasy/backend
/workspaces/dev/IDEasy/backend

→ navigate to /workspaces/dev/IDEasy/backend

Example C (fallback repo via project name)
icd -p IDEasy -r
→ navigate to /workspaces/main/IDEasy

Example D (repository not found anywhere)
icd -p IDEasy -r non-existing-repo

Search:
main
dev

Error: Repository 'non-existing-repo' not found in any workspace.

Additional context

No response

Metadata

Metadata

Labels

enhancementNew feature or requesticdChanges related to our icd command.

Fields

No fields configured for Feature.

Projects

Status
🏗 In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions