CopilotKit CLI
Use the CopilotKit CLI to create apps, sign in to Cloud-Hosted Enterprise Intelligence, select projects, provision runtime API keys, import historical conversations, and install agent skills.
What is this?#
The CopilotKit CLI helps you create CopilotKit apps and connect them to Cloud-Hosted Enterprise Intelligence. It handles browser sign-in, project selection, project-scoped runtime API keys, historical thread import, and local project configuration so your app can use durable threads and hosted conversation history.
Use the CLI when you want to start a new app, connect an existing app to a cloud-hosted project, import historical ADK or LangGraph conversations, or install CopilotKit agent skills for your coding agent.
Prerequisites#
- Node.js 20+
- A CopilotKit account for Cloud-Hosted Enterprise Intelligence
- An OpenAI API key or another model provider key for the starter app you choose
Start a new app#
Run create#
npx copilotkit@latest createThe CLI prompts for the app name and framework, opens browser sign-in when needed, scaffolds the starter, and connects the app to a cloud-hosted Enterprise Intelligence project.
Sign in#
If you are not already signed in, the CLI opens a browser login flow. Complete login in the browser, then return to the terminal.
If the browser does not open, the CLI prints a login URL and supports a manual paste fallback.
Select a project#
Choose an existing cloud-hosted project or create a new one. A project is where your app's threads, messages, and platform metadata are stored.
The CLI writes the selected project to .copilotkit/project.json:
{
"projectId": "proj_...",
"projectSlug": "support-assistant",
"clerkOrgId": "org_..."
}Use the generated environment#
The CLI writes the hosted platform URLs and project-scoped runtime API key to .env.
INTELLIGENCE_API_URL=https://...
INTELLIGENCE_GATEWAY_WS_URL=wss://...
INTELLIGENCE_API_KEY=cpk_...Keep INTELLIGENCE_API_KEY on the server side. It is a runtime key for the selected project, not a frontend token.
Start development#
npm run devThe starter runs your local app and runtime while storing durable threads in the cloud-hosted project selected by the CLI.
Connect an existing app#
Use agent-assisted onboarding when you already have an application and want help finding the right CopilotKit integration points:
npx copilotkit@latest skills onboardThen select or create the cloud-hosted project for the app:
npx copilotkit@latest project selectproject select requires a CLI session. If you are signed out, run npx copilotkit@latest login first.
Import historical conversations#
Use import to bring historical Google ADK or LangGraph conversation threads into the Enterprise Intelligence project selected for your app.
npx copilotkit@latest import --source adknpx copilotkit@latest import --source langgraphThe command runs interactively by default. It discovers source agent keys and conversation counts, previews the import, asks you to map source agents, and confirms before writing to Enterprise Intelligence.
For scripted runs, pass flags for the prompts:
npx copilotkit@latest import \
--source langgraph \
--api-url "$INTELLIGENCE_API_URL" \
--api-key "$INTELLIGENCE_API_KEY" \
--agent-map ./agent-map.json \
--user-source configurable.user_id \
--yesFor ADK imports, configure the source backend and scopes with flags or environment variables:
npx copilotkit@latest import \
--source adk \
--adk-source-backend database \
--adk-import-scopes "support:user-123" \
--agent-map ./agent-map.jsonimport reads source credentials from framework-native environment variables instead of raw CLI flags. ADK uses ADK_SOURCE_BACKEND, ADK_IMPORT_SCOPES, ADK_DATABASE_CONNECTION_STRING, or ADK_VERTEX_*. LangGraph uses LANGGRAPH_API_URL plus LANGGRAPH_API_KEY or LANGSMITH_API_KEY.
Run a side-effect-free preview with --dry-run. Use --replace when you need to refresh threads that were already imported.
Auth commands#
| Command | What it does |
|---|---|
npx copilotkit@latest login | Opens the browser sign-in flow and stores a local CLI session. |
npx copilotkit@latest whoami | Shows the signed-in user and active organization. |
npx copilotkit@latest logout | Clears the local CLI session. |
Project commands#
| Command | What it does |
|---|---|
npx copilotkit@latest project select | Selects or creates a cloud-hosted Enterprise Intelligence project for the current directory. |
npx copilotkit@latest import --source adk | Imports historical Google ADK conversation threads into Enterprise Intelligence. |
npx copilotkit@latest import --source langgraph | Imports historical LangGraph conversation threads into Enterprise Intelligence. |
npx copilotkit@latest license create | Issues a CopilotKit license token for flows that require one. |
npx copilotkit@latest license list | Lists license metadata for the current user or organization. |
Re-running project select is safe when you need to move a local app to a different cloud-hosted project. The command updates .copilotkit/project.json and provisions a project-scoped API key for the selected project.
Skills commands#
| Command | What it does |
|---|---|
npx copilotkit@latest skills install | Installs CopilotKit agent skills for supported coding agents. |
npx copilotkit@latest skills onboard | Installs skills, then starts agent-assisted onboarding for an existing app. |
Next steps#
- Cloud-hosted platform: Cloud-Hosted Enterprise Intelligence — login, projects, API keys, threads, and plans in the hosted web app
- Add threads: Threads — add persistent, resumable conversations to your app
- Self-hosting: Self-Hosting Enterprise Intelligence — run the Enterprise Intelligence Platform in your own Kubernetes cluster