Migrate from v1 to v2
To get started, install the latest version of the Wagmi CLI.
bash
pnpm add @wagmi/clibash
npm install @wagmi/clibash
yarn add @wagmi/clibash
bun add @wagmi/cliNot ready to migrate yet?
The Wagmi CLI v1 docs are still available at 1.x.wagmi.sh/cli.
Changed generated action and hook names
Generated action and hook names now align with Wagmi v2 naming conventions. If you want hooks to still follow Wagmi v1 naming conventions, set getActionName and getHookName to 'legacy'.
ts
import { defineConfig } from '@wagmi/cli'
import { actions, react } from '@wagmi/cli/plugins'
export default defineConfig({
plugins: [
actions({
getActionName: 'legacy',
}),
react({
getHookName: 'legacy',
}),
],
})