CLI reference

Main command

efvibe [options] [expression...]

Options

OptionDescription
-w, --workspaceSession root (default ~/.efvibe or %APPDATA%/efvibe)
-p, --projectEF Core .csproj to build
-s, --startup-projectStartup project for config / user secrets
-c, --contextDbContext type name or full name
-e, --expressionOne-shot expression; exits after run
--formattext (default) or json
--no-bannerSuppress workspace/build output (use with JSON)
--dblogEF database logging (default on)
--no-dblogDisable database logging
--about-jsonSession metadata as JSON; no REPL
--with-planWith -e --format json, include query plan (EXPLAIN)
-f, --frameworkTarget framework (e.g. net8.0)
--connection-string, -csManual connection (requires --provider)
--providersqlserver | 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. Scripts with #[Compare] or #[Benchmark(N)] add compareResults or benchmarkResult to the payload. See daemon design doc.

Script attributes

Attribute lines at the start of script blocks drive multi-variant compare or timed benchmark runs. Shared code before the first attribute is prepended to every block.

#[Compare("No tracking")]
db.Products.AsNoTracking().OrderBy(p => p.Name).Take(10).ToList();

#[Benchmark(5)]
db.Products.Count();

JSON eval responses may include:

{
  "success": true,
  "compareResults": [
    { "label": "With tracking", "totalMs": 42, "rowCount": 10, "sqlCommandCount": 1 }
  ],
  "benchmarkResult": {
    "iterations": 5,
    "samplesMs": [12, 11, 13, 12, 11],
    "minMs": 11,
    "avgMs": 12,
    "maxMs": 13,
    "p95Ms": 13
  }
}

Full reference: features.md — Script attributes.

Scan subcommand

efvibe scan lite|deep [scan options]

See LINQ scan for --fail-on, --json, and rule details.

Exit codes