For AI agents: a documentation index is available at /llms.txt. A markdown version of this page is available at the same URL with .md appended (or via Accept: text/markdown).
Skip to main content

Use the Smart Accounts Kit CLI

Use the @metamask/create-gator-app interactive CLI to bootstrap a project with the Smart Accounts Kit in under two minutes. The CLI automatically installs the required dependencies and sets up a project structure using a selected template, allowing you to focus on building your dapp.

Run the CLI​

Run the following command to automatically install the @metamask/create-gator-app package:

npx @metamask/create-gator-app@latest

Upon installation, you'll be asked the following prompts:

? What is your project named? (my-gator-app)
? Pick a framework: (Use arrow keys)
❯ nextjs
vite-react
node
? Pick a template: (Use arrow keys)
❯ MetaMask Smart Accounts Starter
MetaMask Smart Accounts & Delegation Starter
Farcaster Mini App Delegation Starter
Advanced Permissions (ERC-7715) Starter
? Pick a package manager: (Use arrow keys)
❯ npm
yarn
pnpm

Once you've answered the prompts with the required configuration and selected a template, the CLI will create the project using the specified name and settings. See the following section to learn more about available CLI configurations.

Options​

The CLI provides the following options to display CLI details, and further customize the template configuration.

OptionDescription
-v or --versionCheck the current version of the @metamask/create-gator-app CLI.
-h or --helpDisplay the available options.
--skip-installSkip the installation of dependencies.
--add-web3authAdd MetaMask Embedded Wallets (previously Web3Auth) as a signerSigner An account that can sign transactions for a smart account. for the delegator accountDelegator account The account that creates and signs a delegation to grant limited authority to another account..

Supported templates:
- MetaMask Smart Accounts Starter
- MetaMask Smart Accounts & Delegation Starter

Examples​

MetaMask Embedded Wallets configuration​

To create a project that uses MetaMask Embedded Wallets as the signerSigner An account that can sign transactions for a smart account. for your delegator accountDelegator account The account that creates and signs a delegation to grant limited authority to another account., use the --add-web3auth option with @metamask/create-gator-app:

npx @metamask/create-gator-app --add-web3auth

You'll be prompted to provide additional Web3Auth configuration details:

? Which Web3Auth network do you want to use? (Use arrow keys)
❯ Sapphire Devnet
Sapphire Mainnet

Supported templates​

TemplateNext.jsVite ReactNode.js
MetaMask Smart Accounts Starter✅✅❌
MetaMask Smart Accounts & Delegation Starter✅✅❌
Farcaster Mini App Delegation Starter✅❌❌
Advanced Permissions (ERC-7715) Starter✅❌❌
x402 Server❌❌✅