diff options
| author | Yuval Adam <_@yuv.al> | 2025-03-06 13:37:00 +0100 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2025-03-06 13:37:00 +0100 |
| commit | ca7bb72088d2ec17a2ae78cb5d8259cb2eb225f8 (patch) | |
| tree | 26ea20f1114ea47f668a75be5e6eab0b9b69d79f | |
| parent | 9ee5a1d4273e5f0166b3f44bd6b040602613f140 (diff) | |
Initial cli and entrypoints
| -rw-r--r-- | .gitignore | 3 | ||||
| -rw-r--r-- | README.md | 41 | ||||
| -rw-r--r-- | hello.py | 6 | ||||
| -rw-r--r-- | pyproject.toml | 12 | ||||
| -rw-r--r-- | strangeloop/__init__.py | 5 | ||||
| -rw-r--r-- | strangeloop/cli.py | 62 | ||||
| -rw-r--r-- | uv.lock | 34 |
7 files changed, 154 insertions, 9 deletions
@@ -1 +1,2 @@ -__pycache__
\ No newline at end of file +__pycache__ +*.egg-info
\ No newline at end of file @@ -1,3 +1,44 @@ # Strangeloop A recursive and self-referential AI agent framework. + +## Installation + +Run the latest version directly without installation from `uvx`: + +```bash +$ uvx strangeloop +``` + +For developers, from within working copy run: + +```bash +$ uv run strangeloop +``` + +## CLI Usage + +Strangeloop provides a command-line interface with several commands: + +```bash +# Display help +strangeloop --help + +# Print a hello message +strangeloop hello + +# Greet a user +strangeloop greet [NAME] + +# Display information about the environment +strangeloop info +strangeloop info --verbose + +# Process a file +strangeloop process FILE_PATH [--output OUTPUT_PATH] +``` + +You can also run the CLI directly without installation: + +```bash +python main.py --help diff --git a/hello.py b/hello.py deleted file mode 100644 index 6f29093..0000000 --- a/hello.py +++ /dev/null @@ -1,6 +0,0 @@ -def main(): - print("Hello from strangeloop!") - - -if __name__ == "__main__": - main() diff --git a/pyproject.toml b/pyproject.toml index 84ccb86..addf1ff 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,15 @@ [project] name = "strangeloop" -version = "0.1.0" +version = "0.0.1" description = "A recursive and self-referential AI agent framework" readme = "README.md" requires-python = ">=3.13" -dependencies = [] +dependencies = [ + "click>=8.1.8", +] + +[project.scripts] +strangeloop = "strangeloop.cli:cli" + +[tool.uv] +package = true
\ No newline at end of file diff --git a/strangeloop/__init__.py b/strangeloop/__init__.py new file mode 100644 index 0000000..016e4c8 --- /dev/null +++ b/strangeloop/__init__.py @@ -0,0 +1,5 @@ +""" +Strangeloop - A recursive and self-referential AI agent framework. +""" + +__version__ = "0.1.0" diff --git a/strangeloop/cli.py b/strangeloop/cli.py new file mode 100644 index 0000000..35270e5 --- /dev/null +++ b/strangeloop/cli.py @@ -0,0 +1,62 @@ +#!/usr/bin/env python +""" +Strangeloop CLI - A recursive and self-referential AI agent framework. +""" +import click +import sys +from pathlib import Path + + +@click.group() +@click.version_option(version="0.1.0") +def cli(): + """Strangeloop - A recursive and self-referential AI agent framework.""" + pass + + +@cli.command() +def hello(): + """Print a hello message.""" + click.echo("Hello from strangeloop!") + + +@cli.command() +@click.argument("name", required=False) +def greet(name=None): + """Greet a user by name.""" + if name: + click.echo(f"Hello, {name}! Welcome to strangeloop!") + else: + click.echo("Hello! Welcome to strangeloop!") + + +@cli.command() +@click.option("--verbose", "-v", is_flag=True, help="Enable verbose output") +def info(verbose): + """Display information about the strangeloop environment.""" + click.echo("Strangeloop Information:") + click.echo(f"Python version: {sys.version}") + click.echo(f"Running from: {Path(__file__).resolve().parent}") + + if verbose: + click.echo("\nVerbose Information:") + click.echo(f"Platform: {sys.platform}") + click.echo(f"Python executable: {sys.executable}") + + +@cli.command() +@click.argument("file_path", type=click.Path(exists=True)) +@click.option("--output", "-o", help="Output file path") +def process(file_path, output): + """Process a file with strangeloop.""" + click.echo(f"Processing file: {file_path}") + + # This is a placeholder for actual processing logic + click.echo("Processing complete!") + + if output: + click.echo(f"Results written to: {output}") + + +if __name__ == "__main__": + cli() @@ -0,0 +1,34 @@ +version = 1 +requires-python = ">=3.13" + +[[package]] +name = "click" +version = "8.1.8" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b9/2e/0090cbf739cee7d23781ad4b89a9894a41538e4fcf4c31dcdd705b78eb8b/click-8.1.8.tar.gz", hash = "sha256:ed53c9d8990d83c2a27deae68e4ee337473f6330c040a31d4225c9574d16096a", size = 226593 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/d4/7ebdbd03970677812aac39c869717059dbb71a4cfc033ca6e5221787892c/click-8.1.8-py3-none-any.whl", hash = "sha256:63c132bbbed01578a06712a2d1f497bb62d9c1c0d329b7903a866228027263b2", size = 98188 }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697 } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335 }, +] + +[[package]] +name = "strangeloop" +version = "0.1.0" +source = { editable = "." } +dependencies = [ + { name = "click" }, +] + +[package.metadata] +requires-dist = [{ name = "click", specifier = ">=8.1.8" }] |
