This project uses uv for development. Follow the uv Getting Started guide to install and configure it.
Make sure the swig executable is in your PATH.
brew install swig
sudo apt install swig libu2f-udev pcscd libpcsclite-dev
Tested on Fedora 34 sudo dnf install pcsc-lite-devel python3-devel swig
Clone the repository:
git clone https://github.com/Yubico/yubikey-manager.git cd yubikey-manager
To run ykman from source, use the uv run
command:
uv run ykman
Show available commands:
uv run ykman --help
Show information about inserted YubiKey:
uv run ykman info
Run ykman in DEBUG mode:
uv run ykman --log-level DEBUG info
This project uses ruff for code style, and security linting. mypy and pyright are used for static type checking. These are invoked with a pre-commit hook.
To use these:
uv tool install pre-commit pre-commit install
To run unit tests:
uv run pytest
Warning
|
ONLY run these on dedicated developer keys, as it will permanently delete data on the device(s)! |
To run integration tests, indicate the serial number (given by ykman list
) of
the YubiKey to test with. Make sure no other YubiKey is connected when running
the test!
uv run pytest --device 123456
To run the tests over NFC, place the YubiKey to test on an NFC reader, and indicate both the reader and the serial number of the YubiKey:
uv run pytest --reader HID --device 123456
The integration test suite will automatically identify which test cases can be run with the attached YubiKey.
For third-party packaging, use the source releases and signatures available here. These artifacts are also published on Github on the Releases page.