Metadata-Version: 2.4
Name: azaks-bastion
Version: 0.1.0
Summary: Open an Azure Bastion tunnel to a private AKS API server or jump host.
Project-URL: Homepage, https://github.com/NaeemH/azaks-bastion
Project-URL: Repository, https://github.com/NaeemH/azaks-bastion
Project-URL: Issues, https://github.com/NaeemH/azaks-bastion/issues
Author-email: Naeem Hossain <naeemhossain.mail@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Naeem Hossain
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: azure,cli,devops
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.10
Requires-Dist: rich>=13.7
Requires-Dist: typer>=0.12
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pre-commit>=3.7; extra == 'dev'
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
Requires-Dist: pytest-mock>=3.12; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.5; extra == 'dev'
Description-Content-Type: text/markdown

# azaks-bastion

Open an Azure Bastion tunnel to a private AKS API server or jump host.

## Install

```bash
pip install azaks-bastion
```

The package installs two console scripts that point at the same Typer app:

| Command         | Use when                              |
| --------------- | ------------------------------------- |
| `azaks-bastion`  | Long form, friendly for scripts       |
| `aksb` | Short alias for interactive shell use |

## Usage

```bash
aksb --help
aksb --version
```

### Discover Bastion hosts

```bash
# Table of Bastion hosts in the current subscription
aksb list

# Machine-readable, never truncated (good for scripts / piping)
aksb list --json
aksb list -s my-subscription
```

### Open a tunnel to a private AKS jump host or API server

`aksb tunnel` wraps `az network bastion tunnel`, forwarding a local port to a
target's port through a Standard-SKU Bastion host. The target may be a full ARM
resource id or a VM name (with `--target-rg`).

```bash
# SSH jump host: forward an OS-assigned local port to the VM's port 22
aksb tunnel --bastion prod-hub-bastion --bastion-rg prod-hub-neu-rg \
            --target jump-vm --target-rg prod-jump-rg

# Private API server: pin a local port and forward to 443
aksb tunnel -b prod-hub-bastion --bastion-rg prod-hub-neu-rg \
            -t /subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.Compute/virtualMachines/jump \
            --resource-port 443 --local-port 8443
```

The command runs in the foreground and prints the local endpoint
(`127.0.0.1:<port>`); press Ctrl-C to close the tunnel.

## Development

```bash
git clone https://github.com/NaeemH/azaks-bastion.git
cd azaks-bastion
python -m venv .venv && source .venv/bin/activate
pip install -e ".[dev]"
pre-commit install

# Run the standard checks
ruff check . && ruff format --check .
mypy src
pytest -q
```

## Release

Releases are tag-driven. Bump `src/azaks_bastion/__about__.py`, commit, then:

```bash
git tag v0.1.0
git push origin v0.1.0
```

`.github/workflows/release.yml` builds the sdist + wheel and publishes to PyPI
via Trusted Publishers (OIDC) — no API tokens involved.

## License

[MIT](LICENSE)
