EFCoreKrub
EFCoreKrub is a VS Code extension for Entity Framework Core database reverse engineering that acts as a GUI and workflow orchestrator around the EF Core Power Tools CLI (efcpt).
Features
- Native Explorer Context Actions: Right-click any
.csproj, efcpt-config*.json, or efpt*.config.json file in the Explorer to run EFCoreKrub: Reverse Engineer, EFCoreKrub: Quick Refresh, or EFCoreKrub: Sync with efpt.config.json.
- Two-Way Sync with Visual Studio
efpt.config.json: Automatically syncs settings, object selections, excluded columns/indexes, and schema filters between efcpt-config*.json and efpt*.config.json during Reverse Engineer and Quick Refresh (while preserving Visual Studio-specific fields, formatting, and shared efpt.renaming.json).
- Reverse Engineering Wizard (Webview UI):
- Database Objects: Virtualized list supporting thousands of tables, views, stored procedures, and functions with search, schema filters, bulk selection, exclusion wildcards, and flags (
No PK, Temporal History, Migrations).
- Renaming Editor: Edit
efpt.renaming.json schema-level regex patterns, entity renames, and column renames.
- Code-Gen Options: Configure
names, file-layout, code-generation, and type-mappings with full validation against efcpt-config.schema.json.
.dacpac & Live SQL Server Discovery: Query SQL Server catalog views directly (mssql/tedious) or inspect .dacpac model.xml offline without a live DB connection, with automatic config fallback for LocalDB / Windows Integrated auth.
- Connection Discovery & Secret Protection: Reads
appsettings.json, appsettings.{Environment}.json, and .NET User Secrets (respecting precedence), or stores manual connection strings in VS Code SecretStorage. Credentials are never sent to the Webview or logged in the OutputChannel.
- JSON IntelliSense: Built-in JSON schema validation and autocomplete for
efcpt-config.json and efcpt-config.*.json.
- Lossless Config Round-Tripping: Preserves unknown keys, comments, and formatting via
jsonc-parser and checks for unsaved editor buffers before writing.
- Cross-Platform Post-Run Scripts (
efpt.postrun.*): Automatically executes post-generation scripts in the config folder after Reverse Engineer or Quick Refresh succeeds (efpt.postrun.cmd, .bat, .ps1, .sh, .mjs, .cjs, or .js, prioritized for Windows vs. macOS/Linux) with cwd set to the config folder, streamed OutputChannel logs, timeout, and cancellation support.
Prerequisites
- .NET SDK installed
- EF Core Power Tools CLI (
ErikEJ.EFCorePowerTools.Cli) matching your project's EF Core major version:
# Global install (example for EF Core 8)
dotnet tool install -g ErikEJ.EFCorePowerTools.Cli --version "8.*"
# Or local tool manifest
dotnet new tool-manifest
dotnet tool install ErikEJ.EFCorePowerTools.Cli --version "8.*"
If efcpt is missing or its major version does not match your .csproj EF Core version, EFCoreKrub offers one-click terminal installation/update prompts.
Commands
| Command |
Description |
EFCoreKrub: Reverse Engineer |
Opens the interactive Wizard for selecting objects, renaming rules, and code-gen options before running efcpt. |
EFCoreKrub: Quick Refresh |
Runs efcpt immediately using an existing efcpt-config*.json via QuickPick. |
EFCoreKrub: Manage Stored Connection String |
Sets, updates, links .dacpac, or clears credentials stored in VS Code SecretStorage. |
EFCoreKrub: Sync with efpt.config.json |
Manually pulls from or pushes to a paired Visual Studio efpt.config.json file. |
Extension Settings
efcorekrub.connectTimeoutSeconds (default 15): SQL Server connect timeout for schema discovery.
efcorekrub.requestTimeoutSeconds (default 30): SQL Server query timeout for schema discovery.
efcorekrub.efcptTimeoutSeconds (default 120): Maximum execution time for the efcpt CLI process.
efcorekrub.defaultProvider (default "mssql"): Default provider passed to efcpt.
efcorekrub.syncEfptConfig (default true): Automatically perform two-way sync with Visual Studio efpt*.config.json during Reverse Engineer and Quick Refresh.
efcorekrub.runPostRunScript (default true): Automatically run a post-run script (efpt.postrun.cmd, .bat, .ps1, .sh, .mjs, .cjs, or .js) in the config folder after Reverse Engineer or Quick Refresh succeeds.
efcorekrub.postRunTimeoutSeconds (default 120): Maximum execution time in seconds for the post-run script (efpt.postrun.*).
Development
npm install
npm --prefix webview-ui install
npm run typecheck
npm run lint
npm run build
npm test
npm run package
| |