credctl init
Synopsis
Section titled “Synopsis”credctl init [flags]Description
Section titled “Description”credctl init generates a hardware-bound ECDSA P-256 key pair in the macOS Secure Enclave and writes the initial configuration to ~/.credctl/. The private key never leaves the Secure Enclave hardware. The public key is exported as a PEM file to ~/.credctl/device.pub.
Touch ID prompts you to authorise key creation. By default, Touch ID is also required for all future signing operations (e.g., credctl auth). Use the --biometric flag to control this behaviour.
This command creates:
~/.credctl/config.json— device identity configuration (0600permissions)~/.credctl/device.pub— public key in PEM format (0644permissions)
| Flag | Type | Default | Description |
|---|---|---|---|
--force | boolean | false | Delete existing key and reinitialise. The old key is permanently destroyed. |
--biometric | string | any | Biometric policy for signing operations. any — Touch ID with passcode fallback (kSecAccessControlUserPresence). fingerprint — Touch ID only, no passcode fallback; key is invalidated if fingerprints change (kSecAccessControlBiometryCurrentSet). none — no user verification; signing happens silently when the device is unlocked. |
--key-tag | string | com.crzy.credctl.device-key | Override the Keychain application tag for the Secure Enclave key. |
Examples
Section titled “Examples”Basic initialisation
Section titled “Basic initialisation”credctl initGenerating Secure Enclave key pair...
✓ Device identity created (Secure Enclave) Fingerprint: SHA256:aBcDeFg... Public key: ~/.credctl/device.pub
Next: Register this public key with your cloud provider or credctl broker.Force reinitialisation
Section titled “Force reinitialisation”If you need to replace an existing device identity:
credctl init --forceDeleting existing key...Generating Secure Enclave key pair...
✓ Device identity created (Secure Enclave) Fingerprint: SHA256:xYzAbCd... Public key: ~/.credctl/device.pub
Next: Register this public key with your cloud provider or credctl broker.Disable Touch ID (headless or clamshell environments)
Section titled “Disable Touch ID (headless or clamshell environments)”For Mac minis, CI runners, or laptops in clamshell mode where Touch ID is not available:
credctl init --biometric=noneExit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
| 0 | Device identity created successfully |
| 1 | Error (Secure Enclave not available, permission failure, or other error) |
See also
Section titled “See also”credctl status— check device identity healthcredctl setup aws— set up AWS infrastructure after initialisation- Configuration reference —
~/.credctl/config.jsonschema