| title | Pull from remote Inkeep instance |
|---|---|
| sidebarTitle | Pull from Remote |
| description | Pull agent configurations from remote Inkeep instance to your local TypeScript project |
| icon | LuCloudDownload |
This tutorial walks you through pulling agent configurations from an remote Inkeep instance to your local project. Use pull to bootstrap a local project from the Visual Builder, sync remote changes made by teammates, or set up a new development environment.
- Access to a remote Inkeep instance (e.g. Inkeep Enterprise or a self-hosted deployment)
- The Inkeep CLI installed globally:
npm install -g @inkeep/agents-cli- A CLI profile configured and authenticated (only needed for remote deployments). If you haven't done this yet, follow the Set up a CLI profile tutorial.
- An LLM API key set as an environment variable. The pull command uses LLM generation to produce TypeScript files. Set one of the following:
export ANTHROPIC_API_KEY=your-key # Recommended
export OPENAI_API_KEY=your-key # Alternative
export GOOGLE_GENERATIVE_AI_API_KEY=your-key # AlternativeYou have two options depending on whether the project already exists locally.
If you already have a local project directory with an index.ts file, navigate into it:
cd my-projectIf you don't have the project locally yet, you'll specify the project ID in the next step. The CLI creates a new directory for it automatically.
Run `inkeep pull` from the directory that contains your `inkeep.config.ts`, or from any subdirectory below it.From inside your project directory, run:
inkeep pullThe CLI will:
- Detect the project from your
index.tsfile - Resolve configuration — your active CLI profile overrides
inkeep.config.tsfor API URLs, API key, and tenant ID (see Configuration Priority) - Fetch the latest configuration from the remote instance
- Compare remote changes against your local files
- Generate updated TypeScript files, preserving your local code structure
Specify the project ID:
inkeep pull --project my-project-idThis creates a ./my-project-id/ directory with the full TypeScript project structure:
my-project-id/
├── index.ts # Project definition and wiring
├── agents/ # Agent definitions
│ ├── my-agent.ts
│ └── sub-agents/
│ └── my-sub-agent.ts
├── tools/ # Tool definitions
│ ├── my-tool.ts
│ └── functions/
│ └── my-function.ts
├── credentials/ # Credential references
│ └── my-credential.ts
├── environments/ # Environment-specific settings
│ ├── development.env.ts
│ └── index.ts
└── data-components/ # Data component definitions
└── my-data-component.ts
After pulling, the CLI runs a two-stage validation:
- File verification -- checks that all expected files exist with correct naming
- Round-trip validation -- loads the generated TypeScript, serializes it back to JSON, and compares with the original remote data to ensure no data loss
If validation passes, you'll see:
✓ Basic file verification passed
✓ Round-trip validation passed - generated TS matches backend data
Review the generated files to confirm they look correct. If validation fails, the CLI reports specific differences so you can investigate.
When pulling into an existing project, conflicts can occur if both you and a teammate modified the same agent, tool, or configuration. Instead of silently overwriting your local changes, the CLI presents an interactive merge conflict resolution UI.
For each conflict, you can choose to keep your local version, accept the remote version, or manually merge the two. The CLI highlights the differences side by side so you can make an informed decision before any files are written.
If you want to skip conflict resolution and always accept the remote version, use `inkeep pull --introspect` to do a full regeneration from the remote configuration.Once pulled, your project is a standard TypeScript project using @inkeep/agents-sdk builder APIs. You can:
- Edit agent configurations in code
- Push changes back with
inkeep push - Run the Visual Builder locally with
inkeep dev
To pull every project from your tenant at once:
inkeep pull --allEach project is created as a subdirectory in the current directory. The CLI handles existing and new projects differently:
- Existing projects (local
index.tsfound): Uses smart comparison to merge changes - New projects (no local directory): Generates files from scratch
To regenerate all files from scratch, ignoring local changes:
inkeep pull --introspectThis bypasses the smart comparison and rebuilds every TypeScript file from the remote configuration. Use this when your local files are in a broken state or you want a clean slate that matches the remote instance exactly.
The `--introspect` flag overwrites all local files. Commit or back up any local changes you want to keep before using it.Generate environment-specific credential files by passing the --env flag:
inkeep pull --env productionThis generates credential configurations in environments/production.env.ts instead of the default environments/development.env.ts.
To inspect the raw project data without generating TypeScript files:
inkeep pull --jsonThis outputs the project configuration as JSON, which is useful for debugging or piping into other tools.
Push local changes back to remote instance Full reference for all CLI commands and options