Migrate from v1 to v2
To get started, install the latest version of the Wagmi CLI using the rc dist-tag.
bash
pnpm add @wagmi/cli@rcpnpm add @wagmi/cli@rcbash
npm install @wagmi/cli@rcnpm install @wagmi/cli@rcbash
yarn add @wagmi/cli@rcyarn add @wagmi/cli@rcbash
bun add @wagmi/cli@rcbun add @wagmi/cli@rcWagmi CLI v2 is currently in the release candidate phase.
We recommend trying it out in your projects, but there may be breaking changes before the final release. If you find bugs or have feedback, please open an issue or reply to the discussion thread.
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',
}),
],
})import { defineConfig } from '@wagmi/cli'
import { actions, react } from '@wagmi/cli/plugins'
export default defineConfig({
plugins: [
actions({
getActionName: 'legacy',
}),
react({
getHookName: 'legacy',
}),
],
})