Skip to main content

CLI command reference

Vendor CLI tools tend to list commands alphabetically, which is fine when you know exactly what you're looking for and useless when you don't. This reference organizes commands by what you can accomplish with them, grouped by the applet they affect.

The examples below use a generic cli binary name. Substitute your vendor's actual executable.

Common options

These flags are supported on most commands:

OptionShortDescription
--pin <pin>-pPIN for authentication
--xauth-key <key>-xExternal auth key for authentication
--token <id>-tToken identifier (index or reader name)
--verbose-vEnable verbose (debug) logging
--log-level <level>DEBUG / INFO / WARN / ERROR / SILENT
--log-sensitiveLog sensitive data (use with extreme caution)
--help-hDisplay command-specific help

For PINs and keys, env reads the value from an environment variable, and on Windows INTERACTIVE opens a secure dialog.

Token / device info

CommandPurposeDestructive?
token-infoList all connected tokens with reader names, ATR stringsNo
token-cuidGet the unique hardware ID of a specific tokenNo

Token lifecycle

CommandPurposeDestructive?
token-resetReset the token to factory defaults⚠ Wipes everything
token-newOne-shot reprovision: reset, set PIN, default PIN properties, generate PIV personal data⚠ Wipes everything

PIN management (smart card / ACA)

CommandPurposeDestructive?
pin-verifyTest a PIN; reveals retries remaining on failureBurns 1 retry on wrong PIN
pin-changeChange PIN (requires the current PIN)No
pin-reset-triesReset PIN try counter using PUK; also sets a new PINBurns 1 PUK retry on wrong PUK
pin-props-updateUpdate PIN min/max length, counters, etc.No
puk-putInstall a PUK on the tokenNo (additive)
logoutLog out of the current ACA sessionNo

External authentication

CommandPurposeDestructive?
xauth-key-putStore an external auth key on the tokenNo
xauth-key-deleteDelete the external auth keyYes (key only)
xauthPerform external authentication (static or dynamic mode)No
xauth-mode-changeSwitch between static and dynamic challenge modesNo
xauth-get-challengeRetrieve a dynamic challenge from the tokenNo

OATH / OTP configuration

CommandPurposeDestructive?
otp-props-getList configured OATH slots and propertiesNo
otp-slot-configureConfigure an OATH slot with key and config; updates the PSKC fileNo
otp-slot-deleteDelete an OATH slot and remove from PSKC fileYes (slot only)
otp-pass-configureConfigure a static password slotNo
otp-generateGenerate an OTP from a configured slotNo

OCRA (challenge/response)

CommandPurposeDestructive?
ocra-slot-configureConfigure an OCRA slot for challenge-responseNo
ocra-authenticatePerform a challenge-response or digital signature operationNo

PIV — properties and discovery

CommandPurposeDestructive?
piv-props-getList all PIV objects and properties in JSONNo
piv-personal-info-getReturn PIV personal informationNo

PIV — keys and certificates

CommandPurposeDestructive?
piv-key-pair-genGenerate an asymmetric key pair on the tokenOverwrites slot
piv-pki-putUpload a private key, certificate, or bothOverwrites slot
piv-key-deleteDelete a key object by Key ReferenceYes
piv-cert-getRetrieve a certificate from a containerNo
piv-cert-deleteRemove a certificate (preserves derived public key)Yes (cert only)

PIV — generic container data

CommandPurposeDestructive?
piv-data-putStore data under a tag in a containerModifies container
piv-data-getRead data from a container by BER-TLV tagNo
piv-data-deleteDelete data under a tag (or wipe the container)Yes

PIV — cryptographic operations

CommandPurposeDestructive?
piv-data-signSign data with a private key (CLI handles hashing)No
piv-data-raw-cryptoRaw crypto operation (no padding — you handle it)No

PIV — access control

CommandPurposeDestructive?
piv-pki-acrChange the access rule of an empty PKI slotSlot must be empty
piv-data-acrChange the access rule of an empty containerContainer must be empty

SKI (secure key import)

CommandPurposeDestructive?
ski-key-getGenerate or read the RSA-3072 transport keyNo
ski-data-encryptEncrypt key and data with a session KEK for secure importNo

FIDO

FIDO commands require elevation

Run your terminal as Administrator. FIDO operations use USB HID, not the CCID smart card interface, and need elevated privileges to access.

CommandPurposeDestructive?
fido-props-getList FIDO authenticator info, retries, AAGUIDNo
fido-pin-setSet the initial FIDO PINNo (first-time only)
fido-pin-changeChange the FIDO PIN (requires the current PIN)No
fido-cred-listList discoverable FIDO credentialsNo
fido-cred-deleteDelete a specific FIDO credentialYes (one cred)
fido-token-resetWipe all FIDO credentials and the FIDO PIN⚠ Wipes FIDO only

Exit codes

For scripting and automation:

CodeStatus
0Success
-1General failure
-2Exception
-3Invalid parameters
-4No tokens found

Output separation

The CLI separates streams cleanly:

  • STDOUT — actual command output (the cert, the OTP, the JSON)
  • STDERR — diagnostic logs and error messages

This lets you redirect cleanly:

# Save just the cert to a file, logs to a trace file
.\cli piv-cert-get --ber-tlv-tag 5FC105 -v > cert.pem 2> trace.txt

If you're seeing log output in PowerShell when piping to a variable, that's STDERR — redirect it explicitly.