You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I checked there isn't already an issue for the bug I encountered.
Describe the bug
Problem
Currently, the wagmi CLI generates all artifacts into a single file, including:
Contract ABIs
Contract addresses
React hooks
Other generated helpers
This creates an issue when consuming only a subset of the generated output in a different environment.
For example, when importing only the ABI into a non-React project or a separate repository, the entire file is imported, including React hooks and related code that are not needed. This introduces unnecessary dependencies, reduces clarity, and makes cross-environment usage less ergonomic.
In short: I only want the ABI, but I end up importing a whole React toolbox along with it.
Why this is problematic
Makes it harder to reuse ABIs in backend, Node, or non-React contexts
Introduces unwanted React-specific code in unrelated repositories
Reduces tree-shaking clarity
Couples UI layer artifacts with protocol layer artifacts
Proposed Improvement
The wagmi CLI could support generating separate outputs by concern. For example:
abi.ts exports ABIs only
addresses.ts exports contract addresses only
react.ts exports React hooks
optionally actions.ts exports core viem actions
Or allow configuration like:
Generate separate files by default
Or provide an option to control outputs, for example:
This discussion was converted from issue #5000 on February 13, 2026 21:47.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Check existing issues
Describe the bug
Problem
Currently, the wagmi CLI generates all artifacts into a single file, including:
This creates an issue when consuming only a subset of the generated output in a different environment.
For example, when importing only the ABI into a non-React project or a separate repository, the entire file is imported, including React hooks and related code that are not needed. This introduces unnecessary dependencies, reduces clarity, and makes cross-environment usage less ergonomic.
In short: I only want the ABI, but I end up importing a whole React toolbox along with it.
Why this is problematic
Proposed Improvement
The wagmi CLI could support generating separate outputs by concern. For example:
abi.tsexports ABIs onlyaddresses.tsexports contract addresses onlyreact.tsexports React hooksactions.tsexports core viem actionsOr allow configuration like:
{ "out": { "abi": "src/generated/abi.ts", "react": "src/generated/react.ts", "addresses": "src/generated/addresses.ts" } }Happy to help think through the DX implications or contribute if this direction makes sense.
Link to Minimal Reproducible Example
No response
Steps To Reproduce
No response
What Wagmi package(s) are you using?
@wagmi/cli
Wagmi Package(s) Version(s)
2.8.0
Viem Version
2.45.3
TypeScript Version
No response
Anything else?
No response
Beta Was this translation helpful? Give feedback.
All reactions