Skip to content

Add WebAuthn enrollment CLI command #68

@helixclaw

Description

@helixclaw

Summary

Add a 2kc webauthn enroll CLI command that guides server operators through registering a passkey/biometric credential with the server.

Context

Before WebAuthn can be used for approvals, the operator must register at least one credential. This is a one-time setup step done via the CLI (which opens a browser for the WebAuthn ceremony).

Acceptance Criteria

  • 2kc webauthn enroll command in src/cli/webauthn.ts:
    • Requests registration options from server (POST /api/webauthn/register/options)
    • Opens a local browser to a temporary registration page (or uses a terminal-based flow)
    • Alternative: prints a URL for the operator to open manually
    • Completes registration ceremony and sends response to server
    • Prints: "Passkey enrolled successfully. You can now use WebAuthn for approvals."
  • 2kc webauthn list — lists registered credentials (ID, creation date, last used)
  • 2kc webauthn remove <credentialId> — removes a credential (with confirmation)
  • Requires server auth (session token or bearer) to access enrollment endpoints
  • Works in client-server mode only (error if standalone mode)

Dependencies

Scope Boundaries

  • Does NOT include the approval flow (separate issue)
  • Enrollment is operator-facing, not end-user-facing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions