Pull from remote Inkeep instance
Copy page
Pull agent configurations from a remote Inkeep instance, resolve merge conflicts interactively, and sync your local TypeScript project
This tutorial walks you through pulling agent configurations from a 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.
Prerequisites
- Access to a remote Inkeep instance (e.g. Inkeep Enterprise or a self-hosted deployment)
- The Inkeep CLI installed globally:
- 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:
Step 1: Choose your pull target
You have two options depending on whether the project already exists locally.
Option A: Pull into an existing project
If you already have a local project directory with an index.ts file, navigate into it:
Option B: Pull a new project from the remote instance
If 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.
Step 2: Run the pull command
Run inkeep pull from the directory that contains your inkeep.config.ts, or from any subdirectory below it.
For an existing project
From inside your project directory, run:
The 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
The pull command uses smart comparison to detect what changed. If nothing has changed remotely, it tells you the project is already up to date.
For a new project
Specify the project ID:
This creates a ./my-project-id/ directory with the full TypeScript project structure:
Step 3: Resolve merge conflicts
When your local state has diverged from the remote instance, inkeep pull detects conflicts and launches an interactive terminal UI so that you can resolve them.
Interactive conflict resolution
The resolver presents conflicts one at a time. Each conflict shows the entity type, entity ID, and what each side did (added, modified, or deleted).
Row-level default
You can set a row level default to either ours or theirs. Ours refers to your local state, and theirs refers to the remote state. This default will be applied to all columns on the entity.
Column-level overrides
When both sides modified the same entity, you can resolve at a per-column granularity. Set a row default, then optionally override individual columns using the arrow keys.
Keyboard controls
| Key | Action |
|---|---|
↑ / k | Move focus up towards the row default |
↓ / j | Move focus down through columns |
← / 1 | Pick ours for the focused row or column |
→ / 2 | Pick theirs for the focused row or column |
Enter / n | Next conflict |
p | Previous conflict |
Esc / q | Cancel the pull |
Review and confirm
After resolving all conflicts, a summary screen shows your choices:
Press Enter to apply the resolutions and continue the pull, p to go back and adjust, or Esc/q to cancel.
Auto-resolve conflicts
To skip the interactive UI and resolve all conflicts automatically, use the --conflict-strategy flag:
Step 4: Review the generated files
After pulling (and resolving any conflicts), 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:
Review the generated files to confirm they look correct. If validation fails, the CLI reports specific differences so you can investigate.
Step 5: Use the pulled project
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
Additional options
Pull all projects
To pull every project from your tenant at once:
Each 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
Force a full regeneration
To regenerate all files from scratch, ignoring local changes:
This 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.
Pull for a specific environment
Generate environment-specific credential files by passing the --env flag:
This generates credential configurations in environments/production.env.ts instead of the default environments/development.env.ts.
Export as JSON
To inspect the raw project data without generating TypeScript files:
This outputs the project configuration as JSON, which is useful for debugging or piping into other tools.