alms-cli 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- alms_cli/__init__.py +3 -0
- alms_cli/__main__.py +5 -0
- alms_cli/commands/__init__.py +6 -0
- alms_cli/commands/info.py +73 -0
- alms_cli/commands/init.py +129 -0
- alms_cli/main.py +41 -0
- alms_cli/templates/__init__.py +1329 -0
- alms_cli/ui/__init__.py +23 -0
- alms_cli/ui/components.py +121 -0
- alms_cli-0.1.0.dist-info/METADATA +108 -0
- alms_cli-0.1.0.dist-info/RECORD +14 -0
- alms_cli-0.1.0.dist-info/WHEEL +4 -0
- alms_cli-0.1.0.dist-info/entry_points.txt +2 -0
- alms_cli-0.1.0.dist-info/licenses/LICENSE +21 -0
alms_cli/__init__.py
ADDED
alms_cli/__main__.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"""Info command - Show project information."""
|
|
2
|
+
|
|
3
|
+
import typer
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from rich.console import Console
|
|
6
|
+
from rich.table import Table
|
|
7
|
+
from rich import box
|
|
8
|
+
from rich.panel import Panel
|
|
9
|
+
|
|
10
|
+
from alms_cli.ui.components import print_tree, print_error, print_info
|
|
11
|
+
from alms_cli import __version__
|
|
12
|
+
|
|
13
|
+
info_app = typer.Typer(
|
|
14
|
+
name="info",
|
|
15
|
+
help="Show project information",
|
|
16
|
+
add_completion=False,
|
|
17
|
+
rich_markup_mode="rich",
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
console = Console()
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@info_app.command()
|
|
24
|
+
def project():
|
|
25
|
+
"""Show information about the current ALMS project."""
|
|
26
|
+
|
|
27
|
+
project_root = Path.cwd()
|
|
28
|
+
|
|
29
|
+
pyproject = project_root / "pyproject.toml"
|
|
30
|
+
if not pyproject.exists():
|
|
31
|
+
print_error("Not an ALMS project (pyproject.toml not found)")
|
|
32
|
+
console.print()
|
|
33
|
+
print_info("Run 'alms init <name>' to create a new project")
|
|
34
|
+
console.print()
|
|
35
|
+
raise typer.Exit(1)
|
|
36
|
+
|
|
37
|
+
console.print()
|
|
38
|
+
console.print(
|
|
39
|
+
Panel(
|
|
40
|
+
f"[bold white]ALMS Project Info[/bold white]\n"
|
|
41
|
+
f"[dim]CLI Version: {__version__}[/dim]",
|
|
42
|
+
box=box.ROUNDED,
|
|
43
|
+
border_style="blue",
|
|
44
|
+
)
|
|
45
|
+
)
|
|
46
|
+
console.print()
|
|
47
|
+
|
|
48
|
+
table = Table(
|
|
49
|
+
box=box.ROUNDED,
|
|
50
|
+
border_style="blue",
|
|
51
|
+
title="[bold]Project Details[/bold]",
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
table.add_column("Property", style="bold blue")
|
|
55
|
+
table.add_column("Value", style="white")
|
|
56
|
+
|
|
57
|
+
table.add_row("Name", project_root.name)
|
|
58
|
+
table.add_row("Location", str(project_root))
|
|
59
|
+
table.add_row("Has pyproject.toml", "Yes")
|
|
60
|
+
table.add_row("Has src/", str((project_root / "src").exists()))
|
|
61
|
+
table.add_row("Has tests/", str((project_root / "src" / "tests").exists()))
|
|
62
|
+
table.add_row("Has alembic/", str((project_root / "alembic").exists()))
|
|
63
|
+
|
|
64
|
+
console.print(table)
|
|
65
|
+
console.print()
|
|
66
|
+
|
|
67
|
+
console.print("[bold]Project Structure:[/bold]")
|
|
68
|
+
console.print()
|
|
69
|
+
|
|
70
|
+
if (project_root / "src").exists():
|
|
71
|
+
print_tree(project_root / "src")
|
|
72
|
+
|
|
73
|
+
console.print()
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"""Init command - Create a new ALMS project."""
|
|
2
|
+
|
|
3
|
+
import typer
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from rich.console import Console
|
|
6
|
+
from rich.panel import Panel
|
|
7
|
+
from rich import box
|
|
8
|
+
import questionary
|
|
9
|
+
|
|
10
|
+
from alms_cli.ui.components import (
|
|
11
|
+
print_header,
|
|
12
|
+
print_step,
|
|
13
|
+
print_success,
|
|
14
|
+
print_error,
|
|
15
|
+
print_info,
|
|
16
|
+
print_warning,
|
|
17
|
+
create_progress,
|
|
18
|
+
print_project_summary,
|
|
19
|
+
)
|
|
20
|
+
from alms_cli.templates import TemplateGenerator
|
|
21
|
+
|
|
22
|
+
console = Console()
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def init_command(
|
|
26
|
+
name: str = typer.Argument(None, help="Project name"),
|
|
27
|
+
path: str = typer.Option(None, "--path", "-p", help="Path to create project"),
|
|
28
|
+
interactive: bool = typer.Option(True, "--interactive/--no-interactive", "-i", help="Interactive mode"),
|
|
29
|
+
):
|
|
30
|
+
"""Create a new ALMS project with beautiful scaffolding."""
|
|
31
|
+
|
|
32
|
+
print_header("ALMS Project Generator", "AI-First Backend Starter Kit")
|
|
33
|
+
|
|
34
|
+
if not name:
|
|
35
|
+
if interactive:
|
|
36
|
+
name = questionary.text(
|
|
37
|
+
"Project name:",
|
|
38
|
+
default="my-alms-project",
|
|
39
|
+
validate=lambda x: len(x) > 0 and x.replace("-", "").replace("_", "").isalnum(),
|
|
40
|
+
).ask()
|
|
41
|
+
|
|
42
|
+
if not name:
|
|
43
|
+
print_error("Project name is required")
|
|
44
|
+
raise typer.Exit(1)
|
|
45
|
+
else:
|
|
46
|
+
print_error("Project name is required")
|
|
47
|
+
raise typer.Exit(1)
|
|
48
|
+
|
|
49
|
+
project_path = Path(path) / name if path else Path(name)
|
|
50
|
+
|
|
51
|
+
if project_path.exists():
|
|
52
|
+
if interactive:
|
|
53
|
+
overwrite = questionary.confirm(
|
|
54
|
+
f"Directory '{name}' already exists. Overwrite?",
|
|
55
|
+
default=False,
|
|
56
|
+
).ask()
|
|
57
|
+
|
|
58
|
+
if not overwrite:
|
|
59
|
+
print_warning("Project creation cancelled")
|
|
60
|
+
raise typer.Exit(0)
|
|
61
|
+
else:
|
|
62
|
+
print_error(f"Directory '{name}' already exists")
|
|
63
|
+
raise typer.Exit(1)
|
|
64
|
+
|
|
65
|
+
features = []
|
|
66
|
+
|
|
67
|
+
if interactive:
|
|
68
|
+
print_info("Select features to include:")
|
|
69
|
+
console.print()
|
|
70
|
+
|
|
71
|
+
answers = questionary.checkbox(
|
|
72
|
+
"Features:",
|
|
73
|
+
choices=[
|
|
74
|
+
questionary.Choice("Database (PostgreSQL)", checked=True),
|
|
75
|
+
questionary.Choice("Redis Cache", checked=True),
|
|
76
|
+
questionary.Choice("AI Agents (LangChain)", checked=True),
|
|
77
|
+
questionary.Choice("Observability (OpenTelemetry)", checked=True),
|
|
78
|
+
questionary.Choice("Docker Support", checked=True),
|
|
79
|
+
questionary.Choice("CI/CD (GitHub Actions)", checked=True),
|
|
80
|
+
],
|
|
81
|
+
).ask()
|
|
82
|
+
|
|
83
|
+
features = [a for a in (answers or [])]
|
|
84
|
+
|
|
85
|
+
console.print()
|
|
86
|
+
print_step(1, 4, f"Creating project structure in {project_path}")
|
|
87
|
+
|
|
88
|
+
with create_progress() as progress:
|
|
89
|
+
task = progress.add_task("Generating files...", total=100)
|
|
90
|
+
|
|
91
|
+
generator = TemplateGenerator(name, project_path)
|
|
92
|
+
files_created = generator.generate(features)
|
|
93
|
+
|
|
94
|
+
progress.update(task, completed=100)
|
|
95
|
+
|
|
96
|
+
print_success(f"Created {files_created} files")
|
|
97
|
+
console.print()
|
|
98
|
+
|
|
99
|
+
print_step(2, 4, "Setting up configuration")
|
|
100
|
+
print_success("Environment template created (.env.example)")
|
|
101
|
+
print_success("Git ignore created (.gitignore)")
|
|
102
|
+
print_success("Docker configuration created")
|
|
103
|
+
console.print()
|
|
104
|
+
|
|
105
|
+
print_step(3, 4, "Initializing project structure")
|
|
106
|
+
print_success("API layer created")
|
|
107
|
+
print_success("Execution layer created")
|
|
108
|
+
print_success("Agent layer created")
|
|
109
|
+
print_success("Database layer created")
|
|
110
|
+
print_success("Observability layer created")
|
|
111
|
+
console.print()
|
|
112
|
+
|
|
113
|
+
print_step(4, 4, "Finalizing setup")
|
|
114
|
+
print_success("Tests scaffolded")
|
|
115
|
+
print_success("Documentation created")
|
|
116
|
+
print_success("GitHub workflows configured")
|
|
117
|
+
console.print()
|
|
118
|
+
|
|
119
|
+
print_project_summary(project_path, files_created, features or ["All features"])
|
|
120
|
+
|
|
121
|
+
console.print(
|
|
122
|
+
Panel(
|
|
123
|
+
"[bold green]Your ALMS project is ready![/bold green]\n\n"
|
|
124
|
+
"[dim]Run the commands above to get started[/dim]",
|
|
125
|
+
box=box.ROUNDED,
|
|
126
|
+
border_style="green",
|
|
127
|
+
)
|
|
128
|
+
)
|
|
129
|
+
console.print()
|
alms_cli/main.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Main CLI application entry point."""
|
|
2
|
+
|
|
3
|
+
import typer
|
|
4
|
+
from typer import Typer
|
|
5
|
+
from rich.console import Console
|
|
6
|
+
from alms_cli import __version__
|
|
7
|
+
from alms_cli.commands.init import init_command
|
|
8
|
+
from alms_cli.commands.info import info_app
|
|
9
|
+
|
|
10
|
+
app = Typer(
|
|
11
|
+
name="alms",
|
|
12
|
+
help="ALMS CLI - Beautiful project scaffolding tool",
|
|
13
|
+
add_completion=False,
|
|
14
|
+
rich_markup_mode="rich",
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
console = Console()
|
|
18
|
+
|
|
19
|
+
app.command(name="init")(init_command)
|
|
20
|
+
app.add_typer(info_app, name="info")
|
|
21
|
+
|
|
22
|
+
@app.callback(invoke_without_command=True)
|
|
23
|
+
def main(ctx: typer.Context):
|
|
24
|
+
"""ALMS CLI - AI-First Backend Project Scaffolding"""
|
|
25
|
+
if ctx.invoked_subcommand:
|
|
26
|
+
return
|
|
27
|
+
|
|
28
|
+
console.print()
|
|
29
|
+
console.print("[bold blue]╔══════════════════════════════════════════╗[/bold blue]")
|
|
30
|
+
console.print("[bold blue]║[/bold blue] [bold white]ALMS CLI[/bold white] [bold blue]║[/bold blue]")
|
|
31
|
+
console.print("[bold blue]║[/bold blue] [dim]AI-First Backend Project Scaffolding[/dim] [bold blue]║[/bold blue]")
|
|
32
|
+
console.print("[bold blue]╚══════════════════════════════════════════╝[/bold blue]")
|
|
33
|
+
console.print()
|
|
34
|
+
console.print(f"[dim]Version: {__version__}[/dim]")
|
|
35
|
+
console.print()
|
|
36
|
+
console.print("[bold]Commands:[/bold]")
|
|
37
|
+
console.print(" [green]init[/green] Create a new ALMS project")
|
|
38
|
+
console.print(" [green]info[/green] Show project information")
|
|
39
|
+
console.print()
|
|
40
|
+
console.print("[dim]Run 'alms <command> --help' for more information[/dim]")
|
|
41
|
+
console.print()
|