Skip to content

feat: add CLI subcommands for recovery agent management#329

Merged
Dzejkop merged 3 commits intomainfrom
feat/recovery-agent-cli
Mar 26, 2026
Merged

feat: add CLI subcommands for recovery agent management#329
Dzejkop merged 3 commits intomainfrom
feat/recovery-agent-cli

Conversation

@agentotto
Copy link
Copy Markdown
Contributor

@agentotto agentotto bot commented Mar 26, 2026

Summary

Adds a walletkit recovery-agent subcommand group to the CLI with three actions for managing recovery agent updates:

  • recovery-agent initiate <new_recovery_agent> — initiates a time-locked recovery agent update (14-day cooldown). Takes the checksummed hex address of the new recovery agent.
  • recovery-agent execute — executes a pending recovery agent update after the cooldown has elapsed (permissionless).
  • recovery-agent cancel — cancels a pending recovery agent update before the cooldown expires.

Each command delegates to the corresponding Authenticator method added in #320 and prints the returned gateway request ID. Supports --json output.

Changes

  • walletkit-cli/src/commands/recovery_agent.rs — new module with RecoveryAgentCommand enum and run dispatcher.
  • walletkit-cli/src/commands/mod.rs — registers the RecoveryAgent variant in Command and wires up dispatch.

Usage

# Initiate a recovery agent update
walletkit recovery-agent initiate 0xNewRecoveryAgentAddress

# Execute after cooldown
walletkit recovery-agent execute

# Cancel before cooldown expires
walletkit recovery-agent cancel

# JSON output
walletkit --json recovery-agent initiate 0xNewRecoveryAgentAddress

Note

Medium Risk
Adds new CLI flows that trigger recovery-agent update operations via Authenticator; mistakes in argument validation or the exposed command name could lead to user confusion or unintended update requests.

Overview
Adds a new recovery-agent-update command group to walletkit for managing recovery agent updates, wiring it into top-level command dispatch.

Implements initiate, execute, and cancel subcommands that call the corresponding Authenticator methods and print the resulting request_id in either human-readable form or the existing --json envelope.

Written by Cursor Bugbot for commit e77d774. This will update automatically on new commits. Configure here.

Add `walletkit recovery-agent` subcommand group with three actions:
- `initiate <new_recovery_agent>` — initiate a time-locked update
- `execute` — execute a pending update after cooldown
- `cancel` — cancel a pending update

Each delegates to the corresponding Authenticator method and prints
the returned gateway request ID.
@agentotto agentotto bot force-pushed the feat/recovery-agent-cli branch from b58d954 to 9662a05 Compare March 26, 2026 18:03
@Dzejkop
Copy link
Copy Markdown
Contributor

Dzejkop commented Mar 26, 2026

/otto resolve CI issues

kilianglas
kilianglas previously approved these changes Mar 26, 2026
@agentotto
Copy link
Copy Markdown
Contributor Author

agentotto bot commented Mar 26, 2026

Fixed CI in commit 1c042e7. Two issues were found and resolved:

  1. cargo fmt failures — formatting was off in both mod.rs and recovery_agent.rs (multi-line blocks that rustfmt wanted collapsed).

  2. Clippy enum_variant_names — all three variants of RecoveryAgentCommand shared the Update postfix, which clippy rejects under -D clippy::all. Renamed:

    • InitiateUpdateInitiate
    • ExecuteUpdateExecute
    • CancelUpdateCancel

This also aligns the actual CLI subcommand names with what the PR description advertised (recovery-agent initiate, recovery-agent execute, recovery-agent cancel). All checks passed locally (fmt, all three clippy configurations, and cargo test -p walletkit-cli).

@Dzejkop
Copy link
Copy Markdown
Contributor

Dzejkop commented Mar 26, 2026

/otto in that case let's rename it the recovery-agent commadn to recovery-agent-update

@Dzejkop Dzejkop merged commit 89f343d into main Mar 26, 2026
16 checks passed
@Dzejkop Dzejkop deleted the feat/recovery-agent-cli branch March 26, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants