Add core source files: main, models, config
Some checks failed
CI / test (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / typecheck (push) Has been cancelled

This commit is contained in:
2026-01-30 18:57:27 +00:00
parent 086a73af1b
commit 57ef134cc3

35
src/codexchange/main.py Normal file
View File

@@ -0,0 +1,35 @@
"""Main entry point for CodeXchange CLI."""
import typer
from codexchange.config import get_config
from codexchange.cli.commands import convert_cmd, batch_convert_cmd, list_models_cmd, list_languages_cmd
app = typer.Typer(
name="codexchange",
help="CodeXchange CLI - Convert code between programming languages using local LLMs",
add_completion=False
)
app.command("convert", help="Convert a single file from one language to another")(convert_cmd)
app.command("batch-convert", help="Convert multiple files in a directory")(batch_convert_cmd)
app.command("list-models", help="List available Ollama models")(list_models_cmd)
app.command("list-languages", help="List supported programming languages")(list_languages_cmd)
@app.callback()
def callback(
verbose: bool = typer.Option(False, "--verbose", "-v", help="Enable verbose output"),
) -> None:
"""CodeXchange CLI - Convert code between programming languages using local LLMs."""
config = get_config()
config.verbose = verbose
def main() -> None:
"""Entry point for the CLI application."""
app()
if __name__ == "__main__":
main()