Python script to automate fetching a new SSH keypair for CSCS infrastructure. It relies on credentials stored in a cloud-based password manager, like Bitwarden or 1Password.
- Python 3.11+
- One of the following installation methods:
- An account with a supported password manager. Currently: Bitwarden, 1Password
- The password manager must be configured to store the following information:
- The username of your CSCS account
- The password of your CSCS account
- The configured TOPT secret of your CSCS account
- The password manager must be configured to store the following information:
- The command-line interface (CLI) of the password manager of your choice:
- (optional) A virtual environment with
venvorpipenv(or any other similar utility of your choice)
Note
Bitwarden's free plan does not include the option to store TOTP secrets. You will need to upgrade to a paid plan to use this script with Bitwarden.
For a clean, isolated installation that's available system-wide:
pipx install git+https://github.com/empa-scientific-it/cscs-keygen.gitTo upgrade an existing installation:
pipx upgrade cscs-keygen- Clone this repository:
git clone https://github.com/empa-scientific-it/cscs-keygen.git
cd cscs-keygen- Install dependencies and the package:
uv sync- Run the package:
uv run cscs-keygen --helpIf you prefer using pip, you can install from a requirements.txt file:
# Create and activate a virtual environment (optional but recommended)
python -m venv .venv
source .venv/bin/activate # On Windows, use `.venv\Scripts\activate`
# Install dependencies
pip install -r requirements.txtUsing pipx installation:
cscs-keygen --helpUsing uv:
uv run cscs-keygen --helpUsing pip:
cscs-keygen --helpFor more details, check out the docs (🚧 WIP) of this project.
To set up the development environment:
# Install with development dependencies
uv sync --dev
# Run tests
uv run pytest
# Run linting/formatting
uv run ruff check .
uv run ruff format .