{"id":20384948,"url":"https://github.com/d-e-s-o/nitrocli","last_synced_at":"2025-04-06T02:12:50.382Z","repository":{"id":19738820,"uuid":"87766830","full_name":"d-e-s-o/nitrocli","owner":"d-e-s-o","description":"A command line tool for interacting with Nitrokey devices.","archived":false,"fork":false,"pushed_at":"2024-10-23T15:27:28.000Z","size":3930,"stargazers_count":30,"open_issues_count":27,"forks_count":10,"subscribers_count":7,"default_branch":"devel","last_synced_at":"2024-10-23T17:52:07.918Z","etag":null,"topics":["librem","librem-key","nitrocli","nitrokey","nitrokey-pro","nitrokey-stick-devices","nitrokey-storage","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d-e-s-o.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSES/CC0-1.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-10T04:34:07.000Z","updated_at":"2024-10-23T15:06:55.000Z","dependencies_parsed_at":"2024-06-20T23:22:00.214Z","dependency_job_id":"381b7872-049a-4369-96a5-22bdf7ba56d2","html_url":"https://github.com/d-e-s-o/nitrocli","commit_stats":{"total_commits":480,"total_committers":5,"mean_commits":96.0,"dds":"0.31666666666666665","last_synced_commit":"7991b9cb4a8fee2ea5ffd11f6fed2bd7f5cded21"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-e-s-o%2Fnitrocli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-e-s-o%2Fnitrocli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-e-s-o%2Fnitrocli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d-e-s-o%2Fnitrocli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d-e-s-o","download_url":"https://codeload.github.com/d-e-s-o/nitrocli/tar.gz/refs/heads/devel","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423516,"owners_count":20936626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["librem","librem-key","nitrocli","nitrokey","nitrokey-pro","nitrokey-stick-devices","nitrokey-storage","rust"],"created_at":"2024-11-15T02:30:57.681Z","updated_at":"2025-04-06T02:12:50.356Z","avatar_url":"https://github.com/d-e-s-o.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![pipeline](https://github.com/d-e-s-o/nitrocli/actions/workflows/.github/workflows/test.yml/badge.svg)](https://github.com/d-e-s-o/nitrocli/commits/main)\n[![crates.io](https://img.shields.io/crates/v/nitrocli.svg)](https://crates.io/crates/nitrocli)\n[![rustc](https://img.shields.io/badge/rustc-1.56+-blue.svg)](https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html)\n\nnitrocli\n========\n\n- [Changelog](CHANGELOG.md)\n\n**nitrocli** is a program that provides a command line interface for\ninteraction with [Nitrokey Pro][nitrokey-pro], [Nitrokey\nStorage][nitrokey-storage], and [Librem Key][librem-key] devices.\n\n\nThe following commands are currently supported:\n- list: List all attached Nitrokey devices.\n- status: Report status information about the Nitrokey.\n- lock: Lock the Nitrokey.\n- config: Access the Nitrokey's configuration\n  - get: Read the current configuration.\n  - set: Change the configuration.\n- encrypted: Work with the Nitrokey Storage's encrypted volume.\n  - open: Open the encrypted volume. The user PIN needs to be entered.\n  - close: Close the encrypted volume.\n- hidden: Work with the Nitrokey Storage's hidden volume.\n  - create: Create a hidden volume.\n  - open: Open a hidden volume with a password.\n  - close: Close a hidden volume.\n- otp: Access one-time passwords (OTP).\n  - get: Generate a one-time password.\n  - set: Set an OTP slot.\n  - status: List all OTP slots.\n  - clear: Delete an OTP slot.\n- pin: Manage the Nitrokey's PINs.\n  - clear: Remove the user and admin PIN from gpg-agent's cache.\n  - set: Change the admin or the user PIN.\n  - unblock: Unblock and reset the user PIN.\n- pws: Access the password safe (PWS).\n  - get: Query the data on a PWS slot.\n  - set: Set the data on a PWS slot.\n  - status: List all PWS slots.\n  - clear: Delete a PWS slot.\n- unencrypted: Work with the Nitrokey Storage's unencrypted volume.\n  - set: Change the read-write mode of the unencrypted volume.\n\n\nUsage\n-----\n\nUsage is as simple as providing the name of the respective command as a\nparameter (note that some commands are organized through subcommands,\nwhich are required as well), e.g.:\n```sh\n# Open the nitrokey's encrypted volume.\n$ nitrocli storage open\n\n$ nitrocli status\nStatus:\n  model:             Storage\n  serial number:     0x00053141\n  firmware version:  v0.54\n  user retry count:  3\n  admin retry count: 3\n  Storage:\n    SD card ID:        0x05dcad1d\n    SD card usage:     24% .. 99% not written\n    firmware:          unlocked\n    storage keys:      created\n    volumes:\n      unencrypted:     active\n      encrypted:       active\n      hidden:          inactive\n\n# Close it again.\n$ nitrocli storage close\n```\n\nMore examples, a more detailed explanation of the purpose, the potential\nsubcommands, as well as the parameters of each command are provided in\nthe [`man` page](doc/nitrocli.1.pdf).\n\n\nInstallation\n------------\n\nIn addition to Rust itself and Cargo, its package management tool, the\nfollowing dependencies are required:\n- **hidapi**: In order to provide USB access this library is used.\n- **GnuPG**: The `gpg-connect-agent` program allows the user to enter\n             PINs.\n\n#### Via Packages\nPackages are available for:\n- Arch Linux: [`nitrocli`][nitrocli-arch]\n- Debian: [`nitrocli`][nitrocli-debian] (since Debian Buster)\n- Gentoo Linux: [`app-crypt/nitrocli`][nitrocli-gentoo] ebuild\n- NixOS: [`nitrocli`][nitrocli-nixos]\n- Ubuntu: [`nitrocli`][nitrocli-ubuntu] (since Ubuntu 19.04)\n\n#### From Crates.io\n**nitrocli** is [published][nitrocli-cratesio] on crates.io and can\ndirectly be installed from there:\n```sh\n$ cargo install nitrocli --root=$PWD/nitrocli\n```\n\n#### From Source\nAfter cloning the repository the build is as simple as running:\n```sh\n$ cargo build --release\n```\n\nIt is recommended that the resulting executable be installed in a\ndirectory accessible via the `PATH` environment variable.\n\n#### With Nix flakes\n##### Running nitrocli\nRepository comes with a `flake.nix` file, so it can be run directly:\n\n```sh\n$ nix run d-e-s-o/nitrocli\n```\n\n##### Installing system-wide\n**nitrocli** can be installed by adding the repository flake as an input:\n\n```nix\n{\n  inputs = {\n    nitrocli.url = \"github:d-e-s-o/nitrocli?dir=contrib/nix\";\n    ...\n  };\n\n  outputs = {\n    nitrocli,\n    ...\n  }: {\n    # ...\n    # Where modules are defined\n    environment.systemPackages = [ nitrocli.defaultPackage ];\n  };\n  ...\n}\n```\n\n#### Shell Completion\n**nitrocli** comes with completion support for options and arguments to\nthem (for various shells). A completion script can be generated via the\n`shell-complete` utility program and then only needs to be sourced to\nmake the current shell provide context-sensitive tab completion support.\n```sh\n$ cargo run --bin=shell-complete bash \u003e nitrocli.bash\n$ source nitrocli.bash\n```\n\nThe generated completion script (`bash` specific, in this case) can be\ninstalled system-wide as usual and sourced through Bash initialization\nfiles, such as `~/.bashrc`.\n\nCompletion scripts for other shells work in a similar manner. Please\nrefer to the help text (`--help`) of the `shell-complete` program for\nthe list of supported shells.\n\n\nKnown Problems\n--------------\n\n- Due to a problem with the default `hidapi` version on macOS, users are\n  advised to build and install [`libnitrokey`][] from source and then\n  set the `USE_SYSTEM_LIBNITROKEY` environment variable when building\n  `nitrocli` using one of the methods described above.\n- `nitrocli` cannot connect to a Nitrokey device that is currently being\n  accessed by `nitrokey-app` ([upstream issue][libnitrokey#32]). To\n  prevent this problem, quit `nitrokey-app` before using `nitrocli`.\n- Applications using the Nitrokey device (such as `nitrocli` or\n  `nitrokey-app`) cannot easily share access with an instance of\n  scdaemon/GnuPG running shortly afterwards ([upstream\n  issue][libnitrokey#137]). As a workaround, users can kill `scdaemon`\n  after calling `nitrocli` with `gpg-connect-agent 'SCD KILLSCD' /bye`.\n\n\nPublic API and Stability\n------------------------\n\n**nitrocli** follows the [Semantic Versioning specification 2.0.0][semver].\nIts public API is defined by the [nitrocli(1) `man` page](doc/nitrocli.1.pdf).\n\n\nContributing\n------------\n\nContributions are generally welcome. Please follow the guidelines\noutlined in [CONTRIBUTING.md](doc/CONTRIBUTING.md).\n\n\nAcknowledgments\n---------------\n\nRobin Krahl ([@robinkrahl](https://github.com/robinkrahl)) has been\na crucial help for the development of **nitrocli**.\n\nThe [Nitrokey GmbH][nitrokey-gmbh] has generously provided the necessary\nhardware in the form of Nitrokey Pro and Nitrokey Storage devices for\ndeveloping and testing the program.\n\n[Purism][purism] was kind enough to help development of support for\nLibrem Keys by providing the necessary hardware devices to test on.\n\n\nLicense\n-------\n**nitrocli** is made available under the terms of the\n[GPLv3][gplv3-tldr].\n\nSee the [LICENSE](LICENSE) file that accompanies this distribution for\nthe full text of the license.\n\n`nitrocli` complies with [version 3.0 of the REUSE specification][reuse].\n\n\n[`libnitrokey`]: https://github.com/nitrokey/libnitrokey\n[nitrokey-gmbh]: https://www.nitrokey.com\n[nitrokey-pro]: https://shop.nitrokey.com/shop/product/nitrokey-pro-2-3\n[nitrokey-storage]: https://shop.nitrokey.com/shop/product/nitrokey-storage-2-56\n[librem-key]: https://puri.sm/products/librem-key/\n[nitrocli-arch]: https://archlinux.org/packages/community/x86_64/nitrocli/\n[nitrocli-cratesio]: https://crates.io/crates/nitrocli\n[nitrocli-debian]: https://packages.debian.org/stable/nitrocli\n[nitrocli-gentoo]: https://packages.gentoo.org/packages/app-crypt/nitrocli\n[nitrocli-nixos]: https://search.nixos.org/packages?channel=unstable\u0026show=nitrocli\n[nitrocli-ubuntu]: https://packages.ubuntu.com/search?keywords=nitrocli\n[gplv3-tldr]: https://tldrlegal.com/license/gnu-general-public-license-v3-(gpl-3)\n[libnitrokey#32]: https://github.com/Nitrokey/libnitrokey/issues/32\n[libnitrokey#137]: https://github.com/Nitrokey/libnitrokey/issues/137\n[purism]: https://puri.sm/\n[reuse]: https://reuse.software/practices/3.0/\n[semver]: https://semver.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-e-s-o%2Fnitrocli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd-e-s-o%2Fnitrocli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd-e-s-o%2Fnitrocli/lists"}