pub struct Cli {Show 24 fields
pub max_concurrency: Option<usize>,
pub wait_lock: Option<u64>,
pub skip_memory_guard: bool,
pub strict_env_clear: bool,
pub dry_run_backend: bool,
pub lang: Option<Language>,
pub tz: Option<Tz>,
pub verbose: u8,
pub extraction_backend: Option<String>,
pub embedding_dim: Option<u64>,
pub llm_backend: LlmBackendChoice,
pub llm_model: Option<String>,
pub claude_binary: Option<PathBuf>,
pub codex_binary: Option<PathBuf>,
pub opencode_binary: Option<PathBuf>,
pub llm_fallback: String,
pub skip_embedding_on_failure: bool,
pub llm_max_host_concurrency: Option<u32>,
pub llm_slot_wait_secs: Option<u64>,
pub llm_slot_no_wait: bool,
pub embedding_backend: EmbeddingBackendChoice,
pub embedding_model: Option<String>,
pub openrouter_api_key: Option<String>,
pub command: Option<Commands>,
}Fields§
§max_concurrency: Option<usize>Maximum number of simultaneous CLI invocations allowed (default: 4).
Caps the counting semaphore used for CLI concurrency slots. The value must stay within [1, 2×nCPUs]. Values above the ceiling are rejected with exit 2.
wait_lock: Option<u64>Wait up to SECONDS for a free concurrency slot before giving up (exit 75).
Useful in retrying agent pipelines: the process polls every 500 ms until a slot opens or the timeout expires. Default: 300s (5 minutes).
skip_memory_guard: boolSkip the available-memory check before loading the model.
Exclusive use in automated tests where real allocation does not occur.
strict_env_clear: boolv1.0.83 (ADR-0041): strict env-clear mode for compliance environments.
When enabled, the LLM subprocess receives ONLY PATH — no
ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL, OPENAI_BASE_URL
or other custom-provider credentials are forwarded. Defaults to
the standard v1.0.83 whitelist that preserves custom-provider
credentials (ADR-0041). Honors env var
SQLITE_GRAPHRAG_STRICT_ENV_CLEAR=1 when set.
dry_run_backend: boolv1.0.84 (ADR-0042 / GAP-002): resolve and print the LLM backend that
WOULD be invoked for embedding (binary path + model + flavour),
then exit 0 without executing the subprocess. Useful for CI
audit and sanity-check of --llm-backend before long sessions.
Honors env var SQLITE_GRAPHRAG_DRY_RUN_BACKEND=1 when set.
lang: Option<Language>Language for human-facing stderr messages. Accepts en or pt.
Without the flag, detection falls back to SQLITE_GRAPHRAG_LANG and then
LC_ALL/LANG. JSON stdout stays deterministic and identical across
languages; only human-facing strings are affected.
tz: Option<Tz>Time zone for *_iso fields in JSON output (for example America/Sao_Paulo).
Accepts any IANA time zone name. Without the flag, it falls back to
SQLITE_GRAPHRAG_DISPLAY_TZ; if unset, UTC is used. Integer epoch fields
are not affected.
verbose: u8Increase logging verbosity (-v=info, -vv=debug, -vvv=trace).
Overrides SQLITE_GRAPHRAG_LOG_LEVEL env var when present. Logs are emitted
to stderr; JSON stdout is unaffected.
extraction_backend: Option<String>v1.0.75 (G21 solution): extraction backend selector. Accepts
llm (default), embedding (legacy), none, or both (composite).
The llm backend invokes claude code / codex CLI headless to extract
entities and relationships; embedding is a permanent stub since
v1.0.79 (legacy fastembed pipeline removed) that returns a clear
migration error.
embedding_dim: Option<u64>v1.0.79 (G42/S1): embedding dimensionality override (default 64).
Precedence: this flag > SQLITE_GRAPHRAG_EMBEDDING_DIM env var >
the dim recorded in the database schema_meta > 64. Existing
databases keep their recorded dimensionality automatically; use
this flag only to migrate a corpus to a new dimensionality
(followed by enrich --operation re-embed). Range: [8, 4096].
llm_backend: LlmBackendChoicev1.0.82 (GAP-003) / v1.0.84 (ADR-0042): backend LLM para embedding.
Aceita auto (detecta via PATH, codex-first), codex (força
codex exec), claude (força claude -p; desde v1.0.84 NÃO cai em
codex — emite AppError::Validation se claude ausente),
opencode (força opencode run), ou none
(skip-a embedding; útil para testes). Honra env var
SQLITE_GRAPHRAG_LLM_BACKEND.
llm_model: Option<String>v1.0.82 (GAP-003): modelo a invocar no backend escolhido.
Honra env var SQLITE_GRAPHRAG_LLM_MODEL. Default depende
do backend (codex: gpt-5.5; claude: claude-sonnet-4-6).
claude_binary: Option<PathBuf>v1.0.82 (GAP-003): path para o binário claude (override de
detecção via PATH). Honra env var SQLITE_GRAPHRAG_CLAUDE_BINARY.
codex_binary: Option<PathBuf>v1.0.89 (GAP-1): path para o binário codex (override de
detecção via PATH). Honra env var SQLITE_GRAPHRAG_CODEX_BINARY.
opencode_binary: Option<PathBuf>v1.0.90 (GAP-OPENCODE-001): path para o binário opencode (override de
detecção via PATH). Honra env var SQLITE_GRAPHRAG_OPENCODE_BINARY.
llm_fallback: Stringv1.0.82 (GAP-005): cadeia de backends LLM tentados em ordem
quando o primário falha. Default codex,claude,none. Honra
env var SQLITE_GRAPHRAG_LLM_FALLBACK.
skip_embedding_on_failure: boolv1.0.82 (GAP-005): persiste com embedding NULL quando todos
os backends da cadeia falham. Memória fica em pending_embeddings
para reprocessamento via embedding retry. Honra env var
SQLITE_GRAPHRAG_SKIP_EMBEDDING_ON_FAILURE.
llm_max_host_concurrency: Option<u32>v1.0.82 (GAP-004): limite host-wide de subprocessos LLM
simultâneos. Default derivado de ncpus. Honra env var
SQLITE_GRAPHRAG_LLM_MAX_HOST_CONCURRENCY.
llm_slot_wait_secs: Option<u64>v1.0.82 (GAP-004): segundos para aguardar slot LLM livre
antes de falhar com exit 75. Default 30s. Honra env var
SQLITE_GRAPHRAG_LLM_SLOT_WAIT_SECS.
llm_slot_no_wait: boolv1.0.82 (GAP-004): se setado, falha imediatamente (exit 75)
quando nenhum slot LLM está livre. Honra env var
SQLITE_GRAPHRAG_LLM_SLOT_NO_WAIT.
embedding_backend: EmbeddingBackendChoicev1.0.93: embedding backend selector. auto tries OpenRouter API if key
available, falls back to LLM subprocess. openrouter requires API key.
llm forces subprocess. Honra env var SQLITE_GRAPHRAG_EMBEDDING_BACKEND.
embedding_model: Option<String>v1.0.93: embedding model for OpenRouter API. OBRIGATORIO quando
--embedding-backend openrouter. Honra env var SQLITE_GRAPHRAG_EMBEDDING_MODEL.
openrouter_api_key: Option<String>v1.0.93: OpenRouter API key (prefer env var or config.toml over CLI flag
to avoid shell history exposure). Honra env var OPENROUTER_API_KEY.
command: Option<Commands>Implementations§
Source§impl Cli
impl Cli
Sourcepub fn validate_flags(&self) -> Result<(), String>
pub fn validate_flags(&self) -> Result<(), String>
Validates concurrency flags and returns a localised descriptive error if invalid.
Requires that crate::i18n::init() has already been called (happens before this
function in the main flow). In English it emits EN messages; in Portuguese it emits PT.
Trait Implementations§
Source§impl Args for Cli
impl Args for Cli
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for Cli
impl CommandFactory for Cli
Source§impl FromArgMatches for Cli
impl FromArgMatches for Cli
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.Source§impl Parser for Cli
impl Parser for Cli
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for Cli
impl RefUnwindSafe for Cli
impl Send for Cli
impl Sync for Cli
impl Unpin for Cli
impl UnsafeUnpin for Cli
impl UnwindSafe for Cli
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more