Skip to content

feat(cli): redeploy command-line entry point (deploy/simulate/apply-config/verify/status/snapshot) (#150) - #160

Merged
robercano-ghbot merged 2 commits into
mainfrom
feat/issue-150-cli
Jul 21, 2026
Merged

feat(cli): redeploy command-line entry point (deploy/simulate/apply-config/verify/status/snapshot) (#150)#160
robercano-ghbot merged 2 commits into
mainfrom
feat/issue-150-cli

Conversation

@robercano-ghbot

Copy link
Copy Markdown
Collaborator

Summary

Adds @redeploy/cli (apps/cli) — a thin command-line entry point wrapping the existing library APIs so reDeploy is usable from a terminal and CI/CD without the studio or hand-written scripts. Introduces the new cli module (bootstrap: package skeleton + .claude/gates.json module entry + module:cli label).

Closes #150.

Subcommands (all thin wrappers)

  • deploy -> @redeploy/core deploy()
  • simulate -> @redeploy/core simulate()
  • apply-config -> @redeploy/config applyConfig()
  • verify -> @redeploy/verify verifyDeployment() / verifyConfig()
  • status -> @redeploy/reader readDeployment() (reader view)
  • snapshot -> @redeploy/reader buildSnapshot()

Contract

  • Env contract mirrors apps/deploy-server: RPC_URL, DEPLOYER_PRIVATE_KEY, FOUNDRY_OUT, DEPLOYMENT_DIR; real env wins over .env.
  • Human-readable and --json output modes; non-zero exit on any failure for CI gating.
  • Security: DEPLOYER_PRIVATE_KEY is never printed/logged/echoed — surfaced only as the derived deployer address; all output/errors funnel through a redaction pass. Locked in by tests.
  • Arg parsing is dependency-free (node:util parseArgs); no heavy CLI framework.

Bootstrap (root/shared, explicit infra step)

  • .claude/gates.json: new cli module entry (apps/cli).
  • Issue relabeled module:core (placeholder) -> module:cli (label created).
  • pnpm-lock.yaml updated as the automatic result of adding the workspace package.

Gates

build, typecheck, lint, test, coverage all green. apps/cli coverage ~99% statements / ~95% branches / ~88% functions (threshold 80).

Review

Routed through all four lenses (correctness, tests, security, performance; consensus = all). One correctness blocker was found and fixed in review: apply-config on-chain txs were broadcast with no gas limit/fee (core's jsonRpcProvider fills only nonce/chainId), which would fail on a live node — now the executor estimates gas (eth_estimateGas) and sets a legacy gasPrice (eth_gasPrice), with a test asserting non-zero gas + fee on the sent params. Re-reviewed and approved by correctness + security.

🤖 Generated with Claude Code

robercano and others added 2 commits July 20, 2026 23:35
Adds apps/cli, a dependency-free (node:util parseArgs) CLI wrapping
existing library APIs with no new business logic:
  - deploy / simulate       -> @redeploy/core
  - apply-config            -> @redeploy/config
  - verify (--target deployment|config) -> @redeploy/verify
  - status / snapshot       -> @redeploy/reader

Mirrors deploy-server's env contract (RPC_URL, DEPLOYER_PRIVATE_KEY,
FOUNDRY_OUT, DEPLOYMENT_DIR, .env precedence) and never echoes secrets
(redaction is defense-in-depth on top of never putting the raw/normalized
key into any result payload). Supports human-readable and --json output,
non-zero exit on failure, and per-command --help.

apply-config / verify --target config build the ChainReader/ConfigExecutor
required by those libraries' injectable interfaces using
foundryArtifactResolver (ABI) + readDeployment (address/contract-name
book) + viem (encode/decode, already a core dependency) — no ABI-encoding
logic is reinvented beyond that glue.

Registers the module in .claude/gates.json.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
buildConfigExecutor's execute() broadcast eth_sendTransaction with no
gas/gasPrice fields. jsonRpcProvider() (core/src/provider/jsonRpc.ts)
takes the LEGACY signing branch whenever maxFeePerGas is absent, and
that branch reads gas/gasPrice verbatim from the params -- with both
undefined the signed raw tx serialized gas=0/gasPrice=0, which real
nodes reject, so every apply-config step failed on a live chain.

Query eth_estimateGas and eth_gasPrice before sending and forward both
into the eth_sendTransaction params so the legacy branch has real,
non-zero values.
@robercano-ghbot
robercano-ghbot merged commit f747248 into main Jul 21, 2026
6 checks passed
@robercano-ghbot
robercano-ghbot deleted the feat/issue-150-cli branch July 21, 2026 08:44
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.

[wave 1] cli: redeploy command-line entry point (deploy/simulate/apply-config/verify/status)

2 participants