Utilities, Diagnostics & Governance
This section covers commands for environment health diagnostics, repository initialization, and database schema change auditing.
1. leai init
Initializes a workspace directory by generating a starter leai.yml configuration template.
# Standard initialization (English default):
leai init
# Initialize starter config with Portuguese comments and examples:
leai init --lang pt-BR
# Overwrite existing file:
leai init -f --lang en-US
Parameters and Flags:
| Parameter / Flag | Type | Default | Description |
|---|---|---|---|
-L, --lang LOCALE | Option | en-US | Template language for generated config (en-US or pt-BR). |
-f, --force | Flag | False | Overwrites existing leai.yml without prompt. |
-o, --output PATH | Option | leai.yml | Target configuration file path. |
2. leai doctor (or leai check)
Runs automated pre-flight health checks to ensure overall environment integrity.
Parameters & Options:
| Parameter / Flag | Type | Default | Description |
|---|---|---|---|
-c, --config PATH | Option | leai.yml | Path to leai.yml. |
What doctor validates:
- Connectivity: Establishes connection to Oracle Database listener and checks version from
v$version. - Catalog Privileges: Validates read access on
ALL_TABLES,ALL_TAB_COLUMNS,ALL_CONSTRAINTS,ALL_SOURCE, andALL_SYNONYMS. - Pipeline Directories: Verifies existence and write permissions for
rawPath,annotationsPath,docPath, andupdates_log_path. - S3 Storage: Tests SeaweedFS S3 connectivity and bucket when configured, providing troubleshooting tips on failure.
- AI Models: Checks active AI provider credentials and verifies the model is ready. For
gateway/async_gatewayproviders, also inspects JWT token expiration/scopes and performs an active HTTP, TLS (ca_bundle), and authentication connectivity check. - GitOps: Validates active branch and remote Git synchronization status.
[!TIP] Diagnostics can also be run directly inside the interactive copilot session (
leai chat) by typing/doctor.
3. leai changes
Audits and lists recently created or altered database objects using Oracle's LAST_DDL_TIME timestamp.
Parameters and Flags:
| Parameter / Flag | Type | Default | Description |
|---|---|---|---|
-d, --days INT | Option | 7 | Number of trailing days to audit. |
-u, --user TEXT | Option | None | Filters by specific modifying user or schema. |
-c, --config PATH | Option | leai.yml | Path to leai.yml. |
--seaweed | Flag | False | Audits snapshots stored in remote S3 bucket. |
--no-cache | Flag | False | Avoids writing snapshots to local disk. |
4. leai rag & leai update --rag
Manages full and incremental loading of RAW database objects into an async_gateway RAG archive, using a SHA-256 JSON checkpoint manifest (.leai/rag_manifest.json). By default, indexes tables, views, mviews, procedures, functions, packages, and triggers (rendering tables/views with YAML annotations as clean Markdown and splitting large packages by subprogram).
# Full or incremental sync of RAW objects (local or --seaweed)
leai rag sync --workers 2
leai rag sync --seaweed --retry-errors
# Checkpoint status and remote indexed documents
leai rag status --remote
# Semantic search in the RAG archive
leai rag search "contract validity rule" --top-k 5
# Incremental Oracle -> RAW -> RAG update in one command
leai update --hours 24 --rag