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
venv
orpipenv
(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.git
To 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:
poetry install
- Activate the virtual environment:
poetry shell
If 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.txt
Using pipx installation:
cscs-keygen --help
Using Poetry:
# Inside Poetry shell
cscs-keygen --help
# Or without activating the shell
poetry run cscs-keygen --help
Using pip:
cscs-keygen --help
For more details, check out the docs (🚧 WIP) of this project.
To set up the development environment:
# Install with development dependencies
poetry install --with dev
# Run tests
poetry run pytest
# Run linting/formatting
poetry run ruff check .
poetry run ruff format .