CLI reference
Main command
efvibe [options] [expression...]
Options
| Option | Description |
|---|---|
-w, --workspace | Session root (default ~/.efvibe or %APPDATA%/efvibe) |
-p, --project | EF Core .csproj to build |
-s, --startup-project | Startup project for config / user secrets |
-c, --context | DbContext type name or full name |
-e, --expression | One-shot expression; exits after run |
--format | text (default) or json |
--no-banner | Suppress workspace/build output (use with JSON) |
--dblog | EF database logging (default on) |
--no-dblog | Disable database logging |
--about-json | Session metadata as JSON; no REPL |
--with-plan | With -e --format json, include query plan (EXPLAIN) |
-f, --framework | Target framework (e.g. net8.0) |
--connection-string, -cs | Manual connection (requires --provider) |
--provider | sqlserver | npgsql | sqlite | oracle | mysql | mariadb |
JSON one-shot output
efvibe -p ./MyApp.Persistence.csproj -c AppDbContext \
-e "db.Products.Count()" --format json --no-banner
With query plan:
efvibe -p ... -e "db.Products.Take(5).ToList()" \
--format json --no-banner --with-plan
Example payload shape:
{
"success": true,
"value": "42",
"sql": ["SELECT COUNT(*) FROM ..."],
"queryPlan": "... EXPLAIN output ...",
"metrics": { "totalMs": 12, "rowCount": 1 },
"warnings": []
}
efvibe serve (editor daemon)
Long-running mode for fast repeated evaluation (VS Code uses this by default):
efvibe serve -p ./MyApp.Persistence.csproj -s ./MyApp.Api.csproj -c AppDbContext
# stdout: {"type":"ready","dbContext":"AppDbContext",...}
# stdin (one JSON line per request):
{"type":"eval","expression":"db.Products.Count()"}
{"type":"eval","expression":"db.Orders.Take(5).ToList()","withPlan":true}
{"type":"ping"}
{"type":"shutdown"}
Each eval line returns the same JSON as -e --format json. See daemon design doc.
Scan subcommand
efvibe scan lite|deep [scan options]
See LINQ scan for --fail-on, --json, and rule details.
Exit codes
0— success1— parse / format error3— provider required with connection string10— workspace / build failure14— DbContext resolution failure20— evaluation / compilation error