Draft
Conversation
# Conflicts: # AGENTS.md # CHANGELOG.md # README.md # internal/app/runner.go # internal/providers/types.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description: Retrieval to Plan + Execute
Intent
This PR moves
defi-clifrom a retrieval-only tool to a tool that can execute on-chain actions.The core design is an explicit two-step flow:
plan: build and persist an action without broadcastingrunorsubmit: execute immediately or execute a previously planned actionThis lets agents and humans move from quote/data discovery to deterministic planning and then controlled execution, while keeping the same automation contract:
What’s New
plan,run,submit,status.actions listandactions show.env,file,keystore, plus one-off--private-key).across,lifiaave,morphoaavetaikoswap(same interface as Univ3)This is the initial execution-capable set; more providers will be added under the same command patterns.
API Surface
Execution command matrix
swap plan|run|submit|statusbridge plan|run|submit|status(provider:across|lifi)approvals plan|run|submit|statuslend supply|withdraw|borrow|repay plan|run|submit|status(provider:aave|morpho)rewards claim|compound plan|run|submit|status(provider:aave)actions list|showRequired selectors
--providerselection.Key execution flags
--signer,--key-source,--private-key--simulate,--step-timeout,--poll-interval--gas-multiplier,--max-fee-gwei,--max-priority-fee-gwei--allow-max-approval,--unsafe-provider-tx--rpc-url(execution + on-chain quotes),--from-amount-for-gas(LiFi)Signing and Simulation
localonly (--signer local).rundoes plan + execute in one call;submitexecutes a previously planned action by--action-id.run, sender defaults to the loaded signer address when--from-addressis omitted; when provided, it must match the signer.--simulateis enabled by default and runs preflight transaction simulation before broadcast; disabling it is opt-in (--simulate=false).--step-timeoutand--poll-intervalcontrol confirmation waiting behavior during execution.Local signer precedence
When
--private-keyis not passed, auto key discovery is:DEFI_PRIVATE_KEYDEFI_PRIVATE_KEY_FILE${XDG_CONFIG_HOME:-~/.config}/defi/key.hex(if present)DEFI_KEYSTORE_PATH+ password env/fileHow to Use
Story 1: Plan now, execute later (Bridge)
Story 2: Execute immediately when speed matters (Lending)
Story 3: Plan and submit rewards in separate steps
Inspect actions