hand auth

Authentication commands for login, logout, and status checking.

Synopsis

hand auth status
hand auth login otp <email>
hand auth otp request <email>
hand auth otp verify <email> <code>
hand auth logout
hand auth delete-account

Subcommands

auth status

Check the current authentication status.

$ hand auth status
Authenticated: true
Logged in as: user@example.com
User ID: abc123-def456-789...
Device ID: xyz789-abc123-456...

auth login otp <email>

Login using email OTP (One-Time Password). This is an interactive command that prompts for the code.

$ hand auth login otp user@example.com
OTP sent to user@example.com

Enter OTP code: 123456

Login successful!
Email: user@example.com
User ID: abc123-def456-789...

auth otp request <email>

Request an OTP code to be sent to the email address. This is a non-interactive command for automation and AI agents.

$ hand auth otp request user@example.com
OTP sent to user@example.com

auth otp verify <email> <code>

Verify an OTP code to complete authentication. Use after otp request.

$ hand auth otp verify user@example.com 123456
Login successful!
Email: user@example.com
User ID: abc123-def456-789...

auth logout

Logout and clear stored credentials.

$ hand auth logout
Logged out successfully

auth delete-account

Permanently delete your account. This action is irreversible and removes all your data from Handrive servers.

$ hand auth delete-account
WARNING: This will permanently delete your account and all associated data.
This action cannot be undone.

Type DELETE to confirm: DELETE

Account deleted successfully.

You must type "DELETE" (all caps) to confirm. This prevents accidental deletion.

Examples

Typical login flow

# Start server first
hand serve &

# Check current status
hand auth status

# Login
hand auth login otp your@email.com
# Enter the code sent to your email

# Verify login
hand auth status

Switch accounts

# Logout current user
hand auth logout

# Login as different user
hand auth login otp other@email.com

Non-interactive login (for AI agents / automation)

# Step 1: Request OTP
hand auth otp request user@example.com

# Step 2: User receives code via email, then verify
hand auth otp verify user@example.com 123456

# Verify login
hand auth status

Notes

  • The server must be running (hand serve) for auth commands to work
  • Credentials are stored locally and persist across sessions
  • OTP codes expire after 5 minutes

See Also