Skip to content

feat(cli): add --anvil-arg option to run command - #546

Draft
tuler wants to merge 2 commits into
prerelease/v2-alphafrom
feat/anvil-options
Draft

tuler wants to merge 2 commits into
prerelease/v2-alphafrom
feat/anvil-options

Conversation

@tuler

@tuler tuler commented Oct 7, 2026

Copy link
Copy Markdown
Member

Adds a repeatable --anvil-arg <arg> option to cartesi run. Each value is appended verbatim to the anvil command, in both devnet and fork modes.

cartesi run --anvil-arg=--slots-in-an-epoch=1

Why: users need anvil options such as --slots-in-an-epoch that the CLI does not expose. Anvil reads almost none of its options from environment variables, and adding a CLI flag for each anvil option does not scale. A pass-through keeps the CLI small while making every anvil option available.

Why not --anvil-<option>: the CLI cannot tell whether such an option takes a value without copying anvil's option schema. It would also need allowUnknownOption(), which turns off typo detection for every run option.

Limitation: the arguments the CLI already sets (--block-time, --fork-url, --chain-id) cannot be overridden this way, since anvil rejects most flags given twice. Use the existing run options for those.

🤖 Generated with Claude Code

Pass extra arguments verbatim to anvil (e.g. --slots-in-an-epoch)
without modeling every anvil option in the CLI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8a670e2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cartesi/cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🟢 Lines 94.74% (🎯 0%) 11242 / 11866
🔵 Statements 94.74% 11242 / 11866
🔵 Functions 82.48% 193 / 234
🔵 Branches 0% 0 / 0
📁 File Coverage (20 files)
File Lines Statements Functions Branches Uncovered Lines
apps/cli/src/base.ts 🔴 35.33% 🔴 35.33% 🟡 60% 🔴 0% 49, 70-71, 79-83, 88, 102, ...
apps/cli/src/builder/directory.ts 🟢 100% 🟢 100% 🟢 100% 🔴 0% -
apps/cli/src/builder/docker.ts 🟢 86.72% 🟢 86.72% 🟡 66.67% 🔴 0% 75-77, 79, 109-111, 169-178
apps/cli/src/builder/empty.ts 🟢 100% 🟢 100% 🟢 100% 🔴 0% -
apps/cli/src/builder/none.ts 🟢 100% 🟢 100% 🟢 100% 🔴 0% -
apps/cli/src/builder/nvram.ts 🟢 96.88% 🟢 96.88% 🟢 100% 🔴 0% 27
apps/cli/src/builder/tar.ts 🟢 100% 🟢 100% 🟢 100% 🔴 0% -
apps/cli/src/compose/anvil.ts 🟢 100% 🟢 100% 🟢 100% 🔴 0% -
apps/cli/src/compose/builder.ts 🟢 99.79% 🟢 99.79% 🟢 100% 🔴 0% 228
apps/cli/src/compose/bundler.ts 🔴 4.82% 🔴 4.82% 🔴 0% 🔴 0% 8-40, 44-75, 79-92
apps/cli/src/compose/common.ts 🟢 100% 🟢 100% 🟢 100% 🔴 0% -
apps/cli/src/compose/database.ts 🟢 100% 🟢 100% 🟢 100% 🔴 0% -
apps/cli/src/compose/explorer.ts 🔴 6.67% 🔴 6.67% 🔴 0% 🔴 0% 10-38, 43-55, 59-72
apps/cli/src/compose/node.ts 🟢 100% 🟢 100% 🟢 100% 🔴 0% -
apps/cli/src/compose/passkey.ts 🔴 8.33% 🔴 8.33% 🔴 0% 🔴 0% 9-18, 23-42, 46-59
apps/cli/src/compose/paymaster.ts 🔴 7.69% 🔴 7.69% 🔴 0% 🔴 0% 8-21, 25-44, 48-61
apps/cli/src/compose/proxy.ts 🟢 100% 🟢 100% 🟢 100% 🔴 0% -
apps/cli/src/config.ts 🟢 95.19% 🟢 95.19% 🟢 96.3% 🔴 0% 90-91, 310, 319, 328, 422, ...
apps/cli/src/contracts.ts 🟢 100% 🟢 100% 🟢 100% 🔴 0% -
...rc/errors/ForkChainValidationError.ts 🟢 100% 🟢 100% 🟢 100% 🔴 0% -

The first build pulls the riscv64 base image on a cold docker cache,
which can exceed bun's default 5s timeout on CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Todo
Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant