Skip to content

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@rc
pnpm add @wagmi/cli@rc
bash
npm install @wagmi/cli@rc
npm install @wagmi/cli@rc
bash
yarn add @wagmi/cli@rc
yarn add @wagmi/cli@rc
bash
bun add @wagmi/cli@rc
bun add @wagmi/cli@rc

Wagmi 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', 
    }),
  ],
})

Released under the MIT License.