Metadata-Version: 2.4
Name: lexigram-cli
Version: 0.1.2
Summary: Command-line interface for Lexigram Framework - Project scaffolding, code generation, and development tools
Project-URL: Homepage, https://lexigram.dev
Project-URL: Repository, https://github.com/dbtinoy-/lexigram-cli-experimental
Project-URL: Documentation, https://docs.lexigram.dev
Project-URL: Issues, https://github.com/dbtinoy-/lexigram/issues
Project-URL: Changelog, https://github.com/dbtinoy-/lexigram/blob/main/CHANGELOG.md
Author-email: Lexigram Framework Team <team@lexigram.dev>
Maintainer-email: Lexigram Framework Team <team@lexigram.dev>
License: MIT
License-File: LICENSE
Keywords: cli,codegen,command-line,devtools,framework,scaffolding
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Code Generators
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.11
Requires-Dist: httpx>=0.25.0
Requires-Dist: jinja2>=3.1.0
Requires-Dist: lexigram-contracts>=0.1.0
Requires-Dist: lexigram>=0.1.0
Requires-Dist: pydantic>=2.10.0
Requires-Dist: pyyaml>=6.0
Requires-Dist: rich>=13.0.0
Requires-Dist: shellingham>=1.5.0
Requires-Dist: typer[all]>=0.9.0
Requires-Dist: watchfiles>=0.21.0
Provides-Extra: all
Requires-Dist: lexigram-testing>=0.1.1; extra == 'all'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'all'
Requires-Dist: pytest-cov>=4.0.0; extra == 'all'
Requires-Dist: pytest>=8.0.0; extra == 'all'
Provides-Extra: dev
Requires-Dist: black>=23.0.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Provides-Extra: test
Requires-Dist: lexigram-testing>=0.1.1; extra == 'test'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'test'
Requires-Dist: pytest-cov>=4.0.0; extra == 'test'
Requires-Dist: pytest>=8.0.0; extra == 'test'
Description-Content-Type: text/markdown

# lexigram-cli

Command-line interface for the Lexigram Framework.

---

## Overview

The `lexigram` CLI provides project scaffolding, code generation, development tooling, and administrative commands for every stage of the application lifecycle. It uses a contributor-based plugin system so other packages can extend the CLI with new commands and generators.

---


> Full documentation: [docs.lexigram.dev](https://docs.lexigram.dev)
## Install

```bash
uv add lexigram-cli
# or, as a standalone tool:
uv tool install lexigram-cli
```

## Quick Start

```python
from lexigram import Application
from lexigram.di.module import Module, module

from lexigram.cli import CLIModule
from lexigram.cli.config import CLIConfig

@module(imports=[CLIModule.configure(CLIConfig())])
class AppModule(Module):
    pass

app = Application(modules=[AppModule])
if __name__ == "__main__":
    app.run()
```

Or use the CLI directly:

```bash
# Create a new web API project
lexigram new project my-api --template web-api

# Scaffold a new extension package
lexigram new package my-feature

# Generate a controller
lexigram gen controller UserController --resource User

# Add the database package to an existing project
lexigram add database --driver postgres

# Start the dev server with hot-reload
lexigram dev start
```

## Configuration

> **Zero-config usage:** Call `CLIModule.configure()` with no arguments to use all defaults.

### Option 1 — YAML file

```yaml
# application.yaml
cli:
  default_template: "web-api"
  default_database: "postgres"
  color: true
  verbose: false
```

### Option 2 — Profiles + Environment Variables *(recommended)*

```bash
export LEX_CLI__DEFAULT_TEMPLATE=web-api
export LEX_CLI__COLOR=true
export LEX_CLI__VERBOSE=false
```

### Option 3 — Python

```python
from lexigram.cli.config import CLIConfig
from lexigram.cli import CLIModule

config = CLIConfig.from_env_profile()
CLIModule.configure(config)
```

### Config reference

| Field | Default | Env var | Description |
|-------|---------|---------|-------------|
| `default_template` | `"web-api"` | `LEX_CLI__DEFAULT_TEMPLATE` | Template used by `lexigram new` |
| `default_database` | `"postgres"` | `LEX_CLI__DEFAULT_DATABASE` | Database driver used by scaffolding |
| `color` | `true` | `LEX_CLI__COLOR` | Enable coloured terminal output |
| `verbose` | `false` | `LEX_CLI__VERBOSE` | Print verbose/debug output |

## Key Features

- **Project scaffolding** — `web-api`, `api`, and `full` templates
- **Package generation** — scaffold new `lexigram-*` extension packages
- **Code generators** — 32+ generators (controller, service, model, provider, event, etc.)
- **Contributor system** — extensible plugin architecture for new commands
- **Shell completion** — bash, zsh, and fish completion scripts

## Key Source Files

| File | What it contains |
|------|----------------|
| `src/lexigram/cli/config.py` | `CLIConfig` configuration dataclass |
| `src/lexigram/cli/module.py` | CLI module assembly |
| `src/lexigram/cli/commands/` | All CLI command implementations |
| `src/lexigram/cli/generators/` | Code generation logic |
| `src/lexigram/cli/registry/` | Registry subsystems |
| `src/lexigram/cli/contributors/` | Plugin contributor system |