Skip to content

kamihi.cli.commands.init ⚓︎

Initialization of projects with Kamihi.

License

MIT

Functions:

Name Description
init

Initialize a new Kamihi project.

init ⚓︎

init(
    ctx: Context,
    name: str = typer.Argument(
        ..., help="Name of the project."
    ),
    path: Annotated[
        Path | None,
        Option(
            exists=True,
            file_okay=False,
            dir_okay=True,
            writable=True,
            resolve_path=True,
            help="Path to the project directory.",
        ),
    ] = None,
    description: str = typer.Option(
        "Kamihi project", help="Description of the project."
    ),
) -> None

Initialize a new Kamihi project.

Source code in src/kamihi/cli/commands/init.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
@app.command()
def init(
    ctx: typer.Context,
    name: str = typer.Argument(..., help="Name of the project."),
    path: Annotated[
        Path | None,
        typer.Option(
            exists=True,
            file_okay=False,
            dir_okay=True,
            writable=True,
            resolve_path=True,
            help="Path to the project directory.",
        ),
    ] = None,
    description: str = typer.Option(
        "Kamihi project",
        help="Description of the project.",
    ),
) -> None:
    """Initialize a new Kamihi project."""
    run_copy(
        "gh:kamihi-dev/kamihi-project-template",
        str((path or ctx.obj.project) / name),
        data={
            "project_name": name,
            "project_description": description,
            "kamihi_version": kamihi_version,
        },
    )