Skip to content

feat(scripting): add CLI runner, script harness, and examples#691

Open
yahgwai wants to merge 8 commits intofeat/zod-schemafrom
feat/zod-scripting
Open

feat(scripting): add CLI runner, script harness, and examples#691
yahgwai wants to merge 8 commits intofeat/zod-schemafrom
feat/zod-scripting

Conversation

@yahgwai
Copy link
Copy Markdown
Contributor

@yahgwai yahgwai commented Apr 8, 2026

no-issue

Summary

Extends the zod schema (#690) work with some scripting tools

  • Adds runScript boilerplate for quickly writing schema enhanced scripts that use the sdk
  • Add a CLI for all current SDK functions, so that any SDK function can be invoked from the command line. eg:
npx tsx src/scripting/cli.ts getDefaultSequencerInboxMaxTimeVariation '{"parentChainId": 1}'
  • Adds example scripts for some common workflows (createRollup, deployNewChain, transferOwnership, etc.). These are just example right now, but we'll soon extend the CLI with more general usage scripts, like deployNewChain

Not included for now

  • Additional parsing libs. Now that we have zod schemas which will parse json, we can use existing tooling to convert yaml, env vars or cli args to json and than parse with the same schema giving scripts more options of what they expose to users.
  • Describe() - we can add documentation to the schemas to give consumers and idea of what values to put into the params. Those descriptions can be accessed via a dry-run/help command or zod can be converted into json schemas to directly expose the documentation.
  • Documentation and readme. Three sets of documentation is required: one for sdk maintainers, one for script writers and one for users of the cli.
  • Extending the CLI with some standard useful scripts to be used by SRE/other consumers

Add runScript/runCli harness for executing validated SDK operations from
the command line. Includes CLI command registry wiring all schemas to
their SDK functions, and example scripts for common workflows.
@yahgwai yahgwai closed this Apr 8, 2026
yahgwai added 4 commits April 8, 2026 14:06
Abitype's peer dep on zod ^3 caused pnpm to keep zod@3.22.4 in the tree,
creating non-portable abitype resolution paths that TypeScript couldn't
name in .d.ts output.
Abitype's peer dep on zod ^3 caused pnpm to keep zod@3.22.4 in the tree,
creating non-portable abitype resolution paths that TypeScript couldn't
name in .d.ts output.
@yahgwai yahgwai reopened this Apr 8, 2026
@yahgwai yahgwai requested a review from spsjvc April 8, 2026 14:32
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.

1 participant