The command-line interface for Vercel
Develop. Preview. Ship.
Vercel's frontend cloud gives developers frameworks, workflows, and infrastructure to build a faster, more personalized web.
To install the latest version of Vercel CLI, run this command:
``bash`
npm i -g vercel
To quickly start a new project, run the following commands:
`bash`
vercel init # Pick an example project
cd
vercel # Deploy to the cloud
Finally, connect your Git repository to Vercel and deploy with git push.
For details on how to use Vercel CLI, check out our documentation.
To develop Vercel CLI, first check out the source code, install dependencies, and build all packages:
`bash`
git clone https://github.com/vercel/vercel.git
cd vercel
pnpm install
pnpm build
At this point you can make modifications to the CLI source code and test them out locally. The CLI source code is located in the packages/cli directory.
`bash`
cd packages/cli
From within the packages/cli directory, you can use the "vercel" script to quickly execute Vercel CLI from its TypeScript source code directly (without having to manually compile first). For example:
`bash`
pnpm vercel deploy
pnpm vercel whoami
pnpm vercel login
pnpm vercel switch --debug
When you are satisfied with your changes, make a commit and create a pull request!
pnpm vercel executes a locally built dist. Because this dist lives locally in this monorepo,vercel
the existence of node_modules can sometimes affect the behavior of how CLI picking
up dependencies. To test the full user experience of downloading the CLI from the npm registry:
`bashbuild the dist
monorepo_dir=$(pwd)
cd packages/cli && turbo builduse pnpm pack to create the same tarball that is uploaded to the npm registry
and store the tarball name in a variable
dist=$(pnpm pack)
npx -p $monorepo_dir/packages/cli/$dist vercel build
``