Skip to content

#2133: add repository navigation option to icd command#2153

Open
Ali-Shariati-Najafabadi wants to merge 2 commits into
devonfw:mainfrom
Ali-Shariati-Najafabadi:feature/2133-Add-repository-navigation-option
Open

#2133: add repository navigation option to icd command#2153
Ali-Shariati-Najafabadi wants to merge 2 commits into
devonfw:mainfrom
Ali-Shariati-Najafabadi:feature/2133-Add-repository-navigation-option

Conversation

@Ali-Shariati-Najafabadi

@Ali-Shariati-Najafabadi Ali-Shariati-Najafabadi commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #2133

Implemented changes:

  • Added a new -r | --repository [<repository>] option to the icd shell function in cli/src/main/package/functions
  • If <repository> is omitted, the project name is used as the repository name (fallback)
  • If -w is not given, workspace main is searched first, then all other workspaces; icd navigates into the first workspace containing the repository
  • If -w is given explicitly, only that workspace is searched (no fallback)
  • If the repository is not found in any workspace, icd fails with Error: Repository '<name>' not found in any workspace.
  • Updated icd --help usage/options text
  • Updated documentation/cli.adoc with a description and example of the new option

Testing instructions

  1. Create a test project structure outside your real IDEasy installation:
    mkdir -p /tmp/icdtest/IDEasy/workspaces/main/cli && mkdir -p /tmp/icdtest/IDEasy/workspaces/dev/backend
  2. In a new shell, set IDE_ROOT=/tmp/icdtest and IDE_HOME="" before sourcing cli/src/main/package/functions
  3. Run icd -p IDEasy -r cli → expect cwd /tmp/icdtest/IDEasy/workspaces/main/cli (found in main)
  4. Run icd -p IDEasy -r backend → expect cwd /tmp/icdtest/IDEasy/workspaces/dev/backend (not in main, found in dev)
  5. Run icd -p IDEasy -r (no repository given) → expect cwd /tmp/icdtest/IDEasy/workspaces/main/IDEasy (fallback to project name)
  6. Run icd -p IDEasy -r nope → expect Error: Repository 'nope' not found in any workspace. and exit code 1

Checklist for this PR

  • When running mvn clean test locally all tests pass and build is successful
  • PR title is of the form #«issue-id»: «brief summary»
  • PR top-level comment summarizes what has been done and contains link to addressed issue(s)
  • PR and issue(s) have suitable labels
  • Issue is set to In Progress and assigned to you or there is no issue
  • You followed all coding conventions
  • You have added the issue implemented by your PR in CHANGELOG.adoc unless issue is labeled with internal
  • You have formulated clear instructions on how to test your contribution under "Testing instructions"

@github-project-automation github-project-automation Bot moved this to 🆕 New in IDEasy board Jul 13, 2026
@Ali-Shariati-Najafabadi Ali-Shariati-Najafabadi moved this from 🆕 New to 🏗 In progress in IDEasy board Jul 13, 2026
@Ali-Shariati-Najafabadi Ali-Shariati-Najafabadi added enhancement New feature or request icd Changes related to our icd command. labels Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request icd Changes related to our icd command.

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

Add repository navigation option (-r) to icd command

1 participant