Azure / Azure/azure-devops-cli-extension

[Feature Request] `az repos show` should auto-detect `--repository` via git config

Open
#1,397 1 comment 2 reactions 0 assignees View on GitHub
Feature
Dominant language
Python
Stars
682
Forks
278
Avg merge
3d 23h
Merged PRs (30d)
3

Description

**Related command**

`az repos show`

**Is your feature request related to a problem? Please describe.**

I work across many repos, and it's often useful to jump to the Azure DevOps repo that corresponds to a locally cloned repository.

It would be nice if I could run `az repos show --open` and have the CLI automatically detect the repository from the git config, as it does for `--org` and `--project`. Instead, I have to pass the repository name explicitly via the `--repository` parameter.

**Describe the solution you'd like**

I would like for `--repository` to be auto-detected when inside a git repo, as it already is for `--organization` and `--project`.

**Describe alternatives you've considered**

Currently I have a cumbersome PowerShell workaround like this:

```powershell
az repos show --open --repository "$(((git config --get remote.origin.url) -split '_git/')[-1])"

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.