Add CLI commands (init, run, test, prompt)
This commit is contained in:
23
src/promptforge/cli/main.py
Normal file
23
src/promptforge/cli/main.py
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
import sys
|
||||||
|
import click
|
||||||
|
from pathlib import Path
|
||||||
|
|
||||||
|
from promptforge import __version__
|
||||||
|
|
||||||
|
|
||||||
|
@click.group()
|
||||||
|
@click.version_option(version=__version__, prog_name="PromptForge")
|
||||||
|
@click.option(
|
||||||
|
"--prompts-dir",
|
||||||
|
type=click.Path(exists=False, file_okay=False, dir_okay=True, path_type=Path),
|
||||||
|
help="Directory containing prompts",
|
||||||
|
)
|
||||||
|
@click.pass_context
|
||||||
|
def main(ctx: click.Context, prompts_dir: Path):
|
||||||
|
"""PromptForge - AI Prompt Versioning, Testing & Registry."""
|
||||||
|
ctx.ensure_object(dict)
|
||||||
|
ctx.obj["prompts_dir"] = prompts_dir or Path.cwd() / "prompts"
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
Reference in New Issue
Block a user