Skip to content

Actions CLI - Initial scaffolding#421

Merged
its-everdred merged 45 commits intomainfrom
feat/cli-scaffolding
May 5, 2026
Merged

Actions CLI - Initial scaffolding#421
its-everdred merged 45 commits intomainfrom
feat/cli-scaffolding

Conversation

@its-everdred
Copy link
Copy Markdown
Collaborator

@its-everdred its-everdred commented Apr 23, 2026

Implements #408. Scaffolds packages/cli/ (npm actions-cli, bin actions): agent-first subprocess that emits JSON on stdout and JSON error envelopes on stderr, with five exit-code categories. Next up: #409 (lend), #410 (swap), #422 (smart wallet + periphery).

What's in

  • packages/cli/ wired into the pnpm workspace
  • commander tree: assets, chains, wallet address, wallet balance
  • writeJson (bigint-aware) + writeError with CliError taxonomy and safeDetails redaction
  • Lazy requireEnv - cleanEnv never runs at import time, enforced by spy test
  • EOA wallet via actions.wallet.toActionsWallet(localAccount) - no bundler, no UserOps, signer pays gas
  • Demo config mirrors backend (USDC_DEMO, OP_DEMO, ETH; GauntletUSDCDemo, AaveETH; Base Sepolia, OP Sepolia, Unichain)
  • --chain <shortname> / --chain-id <id> flags on wallet balance, mutually exclusive via the shared resolveChainFlags resolver
  • SKILL.md (Agent Skills spec) + README.md
  • picocolors scoped to --help only; stdout JSON stays ANSI-free
  • 78 tests pass (71 unit + 7 spawn-based system tests against built dist/index.js)

SDK -> CLI mapping

actions.getSupportedAssets()                -> actions assets
config.chains                               -> actions chains
wallet.address (EOA from PRIVATE_KEY)       -> actions wallet address
wallet.getBalance()                         -> actions wallet balance [--chain <name> | --chain-id <id>]

# coming in #409 / #410:
actions.lend.getMarkets()                   -> actions lend markets
actions.lend.openPosition({marketId, ...})  -> actions wallet lend open --market GauntletUSDCDemo --amount 10
actions.lend.closePosition({marketId, ...}) -> actions wallet lend close --market GauntletUSDCDemo --amount 10
actions.swap.getQuote({...})                -> actions swap quote --in USDC_DEMO --out OP_DEMO --chain base-sepolia --amount 5
wallet.swap.execute({...})                  -> actions wallet swap execute --in USDC_DEMO --out OP_DEMO --chain base-sepolia --amount 5

Wallet model

EOA only in this PR. actions.wallet.toActionsWallet(localAccount) wraps the signer in a LocalWallet; transactions are signed and submitted directly (no bundler, no UserOps, signer pays gas from its own ETH balance on Base Sepolia). Lend and swap dispatch through wallet.sendBatch, which EOAWallet implements as sequential sends with nonce confirmations - approvals + calls become multiple transactions instead of one batched UserOp.

#422 re-adds the ERC-4337 smart wallet path + the direct wallet commands (wallet send, send-batch, transfer from #413) once bundlers are wired.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 23, 2026

Deploy Preview for actions-ui ready!

Name Link
🔨 Latest commit 0e3c56c
🔍 Latest deploy log https://app.netlify.com/projects/actions-ui/deploys/69f945609687ca0008622cd4
😎 Deploy Preview https://deploy-preview-421--actions-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@its-everdred its-everdred changed the title Feat/cli scaffolding cli: scaffolding, --help, smoke tests (#408) Apr 23, 2026
This was referenced Apr 24, 2026
Comment thread packages/cli/src/index.ts Outdated
Comment on lines +6 to +11
const SHORTNAMES: Record<string, SupportedChainId> = {
base: base.id,
'base-sepolia': baseSepolia.id,
optimism: optimism.id,
'op-sepolia': optimismSepolia.id,
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since actions sdk will need to retain a list of supported chains anyway, id prefer this moved to the sdk in a future PR

Comment on lines +7 to +8
BASE_SEPOLIA_RPC_URL: string | undefined
OP_SEPOLIA_RPC_URL: string | undefined
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a future PR will abstract these away and simply use the values set in the ActionsConfig.chains object

*/
export async function walletContext(): Promise<WalletContext> {
const base = baseContext()
const signer = parseSigner(requireEnv('PRIVATE_KEY'))
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a future PR, we wont be so opinionated about wallet setup

Comment on lines +21 to +35
export function getDemoConfig(): NodeActionsConfig<never> {
return {
wallet: {
smartWalletConfig: {
provider: { type: 'default', attributionSuffix: 'actions' },
},
},
lend: {
morpho: { marketAllowlist: [GauntletUSDCDemo] },
aave: { marketAllowlist: [AaveETH] },
},
assets: { allow: [USDC_DEMO, OP_DEMO, ETH] },
chains: getDemoChains(),
}
}
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A future PR moves this config and the other demo files out of the CLI into opie, the example consumer of the CLI.

@its-everdred its-everdred marked this pull request as ready for review May 4, 2026 20:43
@its-everdred its-everdred requested review from a team as code owners May 4, 2026 20:43
@its-everdred its-everdred requested a review from lucasmoore May 4, 2026 20:43
@its-everdred its-everdred changed the title cli: scaffolding, --help, smoke tests (#408) Actions CLI - Initial scaffolding May 4, 2026
Comment thread packages/cli/src/context/walletContext.ts Outdated
Comment thread packages/cli/src/output/errors.ts Outdated
Comment thread packages/cli/src/output/errors.ts Outdated
@its-everdred its-everdred merged commit 2a73b8d into main May 5, 2026
11 checks passed
@its-everdred its-everdred deleted the feat/cli-scaffolding branch May 5, 2026 01:43
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