Skip to content

Import from Vercel

jiayang import vercel:<project> reads a Vercel project with a token of yours, clones the repository it’s linked to, and sets it up here as a new app. Import from another host covers what every import does.

  1. In Vercel, open Account Settings, then Tokens.
  2. Create a token. Give it the scope of the team that owns the project, and an expiry of a day: it’s needed for a minute.
  3. Copy it.

The import asks for it at a hidden prompt, or reads VERCEL_TOKEN if it’s set, the variable Vercel’s own CLI reads. It’s sent to Vercel’s API and nowhere else, used for this import only, and never saved. Delete it in Vercel afterwards if you like.

Terminal window
jiayang import vercel:expense-tracker acme/expenses

For a team’s project, add the team’s id or slug:

Terminal window
jiayang import vercel:expense-tracker acme/expenses --team acme-finance

The project can be named by its name or its id (prj_...). Without a third argument the code is cloned into a new directory named after the project. To import code you already have, run it from the project’s directory with . as the third argument.

Two requests to Vercel’s REST API, documented at vercel.com/docs/rest-api (read 7 October 2026):

Request For
GET /v9/projects/{project} The framework, build and install commands, output directory, root directory, the linked repository and its production branch, and the cron jobs.
GET /v10/projects/{project}/env?decrypt=true The variables, with their values where Vercel shows them.

Only variables that apply to Production come over. One set for Preview, Development or a single branch stays behind. Vercel’s own system variables, like VERCEL_URL, are left out.

Vercel’s Secret variables (called Sensitive before) are write-only: nobody can read them back, including through the API. None becomes a plain environment variable here. One that’s a key for an API we know becomes a secret, and the import asks for its value at a hidden prompt once you’ve said go ahead. Any other is left for you to store, and the plan says how. Answer n to leave it for later. To give them without being asked, put them in a file and pass --env-file:

Terminal window
jiayang import vercel:expense-tracker acme/expenses --env-file prod.env

vercel env pull --environment=production prod.env writes one, though it can’t read Secret values either.

Vercel Here
Framework Detected from the code, as for any deploy. Next.js runs as a container unless it uses OpenNext, then as a Worker.
Root Directory The app’s directory inside the clone, where jiayang.json is written and deploys run.
Build Command, Install Command, Output Directory build.command, build.install and build.output in jiayang.json, when they’re set. Left empty, Vercel used the framework’s own, and so does detection.
Hugo, Jekyll, Zola and MkDocs A static site built with that program, which has to be installed where you deploy from.
vercel.json build settings Read too, and they win over the dashboard’s, as on Vercel.
Cron jobs Schedules, once the app is live.
Deployment Protection Nothing to do: only people you share the app with can open it.
rewrites, redirects and headers in vercel.json _redirects and _headers files for a static site, or the server’s own code.
Functions in api/, outside Next.js A Worker or a container’s server.
Vercel KV, Postgres, Blob and Edge Config See what doesn’t come along.
error: Vercel didn't accept the token, or it can't see project expense-tracker. Make a token with access to it and try again.

The token is wrong, expired, or scoped to another team.

error: Vercel can't find the project nope with this token. Check the name, and add --team for a team's project.
error: expense-tracker isn't linked to a git repository, so we can't fetch its code. Run this again in the project's directory, with . as DIR.

A project deployed with vercel deploy from a computer has no repository. Run the import where its code is.

In Apps, select Import, then Vercel. Enter the project, the team if it’s a team’s, and the token. See Import from another host.