
Nx Import
This handles the messy reality of consolidating repositories into an Nx monorepo while preserving git history. It covers the two main strategies: importing subdirectories one at a time (recommended for monorepos) versus whole repositories (for single-project repos only). The real value is in the gotchas it documents. Nx import doesn't merge root dependencies, targetDefaults, or namedInputs, so you'll need to manually diff and reconcile configs. It also botches pnpm workspace globs by adding literal directory names instead of glob patterns, breaking cross-package imports until you fix it. Worth having if you're migrating multiple repos into Nx, since the official docs don't cover half of these issues.
- skills.sh installs
- 2.7K
- GitHub stars
- 30
- last updated
- Aug 21, 2026
Install
$ npx -y skills add nrwl/nx-ai-agents-config --skill nx-import --agent claude-codeInstalls into .claude/skills of the current project.
Files
Quick Start
nx importbrings code from a source repository or folder into the current workspace, preserving commit history.- After nx
22.6.0,nx importresponds with .ndjson outputs and follow-up questions. For earlier versions, always run with--no-interactiveand specify all flags directly. - Run
nx import --helpfor available options. - Make sure the destination directory is empty before importing.
EXAMPLE: target has
libs/utilsandlibs/models; source haslibs/uiandlibs/data-access— you cannot importlibs/intolibs/directly. Import each source library individually.
Primary docs:
- https://nx.dev/docs/guides/adopting-nx/import-project
- https://nx.dev/docs/guides/adopting-nx/preserving-git-histories
Read the nx docs if you have the tools for it.
Import Strategy
Subdirectory-at-a-time (nx import <source> apps --source=apps):
Sponsors
Details
- Repository
- github.com/nrwl/nx-ai-agents-config
- Categories
- Git & Pull Requests, AI & Agent Building
- First seen
- Apr 16, 2026