Metadata-Version: 2.1
Name: azure-keyvault-cli
Version: 0.3.2
Summary: This is a CLI to show and check secrets from an Azure KeyVault
Home-page: https://github.com/mkah91/azure-keyvault-cli
License: MIT
Keywords: azure,keyvault,cli,secrets
Author: mkah91
Author-email: marius_knepper@web.de
Requires-Python: >=3.9,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: azure-identity (>=1.12.0,<2.0.0)
Requires-Dist: azure-keyvault-secrets (>=4.7.0,<5.0.0)
Requires-Dist: click (>=8.1.3,<9.0.0)
Requires-Dist: halo (>=0.0.31,<0.0.32)
Requires-Dist: inquirerpy (>=0.3.4,<0.4.0)
Requires-Dist: pydantic (>=1.10.7,<2.0.0)
Requires-Dist: pyperclip (>=1.8.2,<2.0.0)
Requires-Dist: toml (>=0.10.0,<0.11.0)
Project-URL: Repository, https://github.com/mkah91/azure-keyvault-cli
Description-Content-Type: text/markdown

[![End-to-End Test](https://github.com/mkah91/azure-keyvault-cli/actions/workflows/e2e-test.yaml/badge.svg)](https://github.com/mkah91/azure-keyvault-cli/actions/workflows/e2e-test.yaml)

# Azure KeyVault CLI

This is a CLI tool to interact with an Azure KeyVault. You can use it to easily list and show secrets. Additionally, you can use it to check the expiration date of all the secrets in your KeyVault.

## Installation

### Install with pip
To install the latest stable version from [PyPI](https://pypi.org/project/azure-keyvault-cli/), run:

```sh
pip3 install azure-keyvault-cli
```


To install the latest version (potentially not stable) from [TestPyPI](https://test.pypi.org/project/azure-keyvault-cli/), run:

```sh
pip3 install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple azure-keyvault-cli
```

If you want to have it globally available, make sure to run it in your global python environment.

## Usage

```sh
azkv --help
```

## Contributing

### Installation

1. Install [poetry](https://python-poetry.org/docs/#installation)
2. Run: `poetry install`

If you get an error `No such file or directory: 'python'`. Try settings an alias for python3:

```sh
alias python=python3
```

or activate an existing virtual environment.

### Usage

Make sure the right virtual env is activated, then you can use the local version of the cli by running, e.g.:

```sh
azkv --help
```

### Testing

To run the tests, run:

```sh
poetry run pytest
# with coverage
poetry run pytest --cov=cli --cov-report=xml --cov-report=term-missing
```

### Formatting

To format the code, run:

```sh
poetry run black .
```

### Linting

To lint the code, run:

```sh
poetry run ruff .
```

If you want to have it globally available, make sure to run it in your global python environment.

## Usage

```sh
azkv --help
```

## Contributing

### Installation

1. Install [poetry](https://python-poetry.org/docs/#installation)
2. Run: `poetry install`

If you get an error `No such file or directory: 'python'`. Try settings an alias for python3:

```sh
alias python=python3
```

or activate an existing virtual environment.

### Usage

Make sure the right virtual env is activated, then you can use the local version of the cli by running, e.g.:

```sh
azkv --help
```

### Testing

To run the tests, run:

```sh
poetry run pytest
# with coverage
poetry run pytest --cov=cli --cov-report=xml --cov-report=term-missing
```

### Formatting

To format the code, run:

```sh
poetry run black .
```

### Linting

To lint the code, run:

```sh
poetry run ruff .
```

### Releasing

#### Bump version

First, bump the version in the `pyproject.toml` file. You can do this manually or by running:

```sh
poetry version <major|minor|patch>
```

Then commit the changes and push them to the remote repository. Additionally, add a tag to the commit with the new version number. You can do this by running:

```sh
version=$(poetry version --short)
git checkout -b release-${version}
git add pyproject.toml
git commit -m "Bump version to ${version}"
git push --set-upstream origin release-${version}
git tag -a ${version} -m "Release ${version}"
git push origin ${version}
```

#### Create pull request

Create a pull request from the release branch to the main branch. The pull request will trigger the test workflow. The workflow will run the tests and check the formatting and linting of the code. You can create a pull request by running:

```sh
version=$(poetry version --short)
gh pr create --title "Release ${version}" --body "Release ${version}" --base main --head release-${version}
```

#### Create release

After the pull request has been merged, the release workflow will be triggered. The workflow will create a new release and publish the package to [PyPI](https://test.pypi.org/project/azure-keyvault-cli/). Be aware that this workflow needs to be manually approved before it will be executed.

