Skip to content
GitHub

Troubleshooting

Cause: The package is not installed or the virtual environment is not activated.

Solution:

Terminal window
uv add lexigram-cli
# or run via uv without installing:
uv run lexigram --help

ConfigNotFoundError — Configuration File Not Found

Section titled “ConfigNotFoundError — Configuration File Not Found”

Exception: lexigram.cli.ConfigNotFoundError

Cause: A CLI command that needs project context (run, dev, db, inspect, gen) was run outside a project directory.

Solution:

Terminal window
# Create an application.yaml in the current directory
lexigram init
# Or run from the project root
cd my-project

ProviderNotInstalledError — Provider Not Installed

Section titled “ProviderNotInstalledError — Provider Not Installed”

Exception: lexigram.cli.ProviderNotInstalledError

Cause: A command requires a package that is not installed (e.g., lexigram-sql for db commands).

Solution:

Terminal window
uv add lexigram-sql # for database commands
uv add lexigram-web # for web-related generators

Cause: The generator’s contributing package is not installed.

Solution:

Terminal window
uv add lexigram-web # or the relevant package
lexigram gen list # verify it appears

Cause: lexigram run or lexigram dev could not find create_app() in the project.

Solution:

Terminal window
# Specify the entry point explicitly
lexigram run my_app.app:create_app
# Or ensure your app module defines create_app() or 'app' at module level

Cause: The preferred server backend (Granian, Uvicorn) is not installed.

Solution:

Terminal window
uv add uvicorn
# or
uv add granian

The CLI auto-detects available backends and falls back gracefully.

Error: Failed to parse config file at ~/.config/lexigram/config.toml

Cause: The TOML config file contains syntax errors — missing quotes, invalid tables, or trailing commas.

Fix: Validate the TOML file:

Terminal window
uv run python -c "import tomllib; tomllib.load(open('~/.config/lexigram/config.toml', 'rb'))"

The default config is created by ConfigManager.save() and should be valid. If the file is corrupted, delete it and let the CLI recreate it:

Terminal window
rm ~/.config/lexigram/config.toml
Error: Generator 'web-api' failed: No module named 'lexigram-web'

Cause: The generator’s contributing package (lexigram-web, etc.) is not installed. Generators are discovered via entry points and may declare optional dependencies.

Fix: Install the required package:

Terminal window
uv add lexigram-web
lexigram gen list # verify it appears
Warning: No ASGI server backend found. Install uvicorn or granian.

Cause: Neither uvicorn nor granian is installed in the current environment. lexigram run and lexigram dev require an ASGI server to serve the application.

Fix: Install a server backend:

Terminal window
uv add uvicorn
# or for better performance:
uv add granian

The CLI prefers Granian when available and falls back to Uvicorn.

Symptom: Terminal output contains literal escape sequences like [32m instead of colored text.

Cause: The terminal does not support ANSI color codes (pipe/redirect, CI output, or NO_COLOR environment). The CLI detects terminal capabilities but may not disable color when output is piped.

Fix: Disable colors explicitly:

Terminal window
lexigram --no-color <command>
# or
LEX_CLI__COLOR=false lexigram <command>

For scripted output, use --json for machine-readable results:

Terminal window
lexigram system info --json