{"id":15436323,"url":"https://github.com/zigai/interfacy","last_synced_at":"2026-02-26T14:07:39.744Z","repository":{"id":169355027,"uuid":"471082778","full_name":"zigai/interfacy","owner":"zigai","description":"Framework for building command-line interfaces from Python functions, classes, and class instances","archived":false,"fork":false,"pushed_at":"2026-01-31T14:00:41.000Z","size":486,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-31T14:35:18.075Z","etag":null,"topics":["argparse","argparse-alternative","argument-parser","cli","cli-framework","interfacy","python","python3","type-hints"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zigai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-03-17T17:39:32.000Z","updated_at":"2026-01-31T14:00:45.000Z","dependencies_parsed_at":"2025-01-16T15:49:43.947Z","dependency_job_id":"bb7d8869-473a-4676-a6c5-61d0a8a42abf","html_url":"https://github.com/zigai/interfacy","commit_stats":{"total_commits":153,"total_committers":3,"mean_commits":51.0,"dds":"0.019607843137254943","last_synced_commit":"41e06a6bd1d7de49667824b8c74b0eeb7ada46b7"},"previous_names":["zigai/interfacy-cli","zigai/interfacy"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/zigai/interfacy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigai%2Finterfacy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigai%2Finterfacy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigai%2Finterfacy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigai%2Finterfacy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zigai","download_url":"https://codeload.github.com/zigai/interfacy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zigai%2Finterfacy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29179577,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T22:12:24.066Z","status":"ssl_error","status_checked_at":"2026-02-06T22:12:09.859Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["argparse","argparse-alternative","argument-parser","cli","cli-framework","interfacy","python","python3","type-hints"],"created_at":"2024-10-01T18:49:55.320Z","updated_at":"2026-02-06T23:04:42.549Z","avatar_url":"https://github.com/zigai.png","language":"Python","readme":"# Interfacy\n\n[![Tests](https://github.com/zigai/interfacy/actions/workflows/tests.yml/badge.svg)](https://github.com/zigai/interfacy/actions/workflows/tests.yml)\n[![PyPI version](https://badge.fury.io/py/interfacy.svg)](https://badge.fury.io/py/interfacy)\n![Supported versions](https://img.shields.io/badge/python-3.10+-blue.svg)\n[![Downloads](https://static.pepy.tech/badge/interfacy)](https://pepy.tech/project/interfacy)\n[![license](https://img.shields.io/github/license/zigai/interfacy.svg)](https://github.com/zigai/interfacy/blob/main/LICENSE)\n\nInterfacy is a CLI framework for building command-line interfaces from Python functions, classes, and class instances using type annotations and docstrings.\n\n## Features\n\n- Generate CLIs from functions, class methods, or class instances.\n- Nested subcommands and command groups with aliases.\n- Type inference from annotations, with support for custom parsers.\n- `--help` text generated from docstrings.\n- Run a target callable directly from the CLI (e.g. `interfacy path.py:main`).\n- Multiple help layouts and color themes.\n- Optional class initializer arguments exposed as CLI options.\n- Argparse-compatible backend, including a drop-in `ArgumentParser` replacement.\n- Stdin piping support with configurable routing to parameters.\n- Optional tab completion via `argcomplete`.\n\n## Installation\n\n### From PyPI\n\n```bash\npip install interfacy\n```\n\n```bash\nuv add interfacy\n```\n\n### From source\n\n```bash\npip install git+https://github.com/zigai/interfacy.git\n```\n\n```bash\nuv add \"git+https://github.com/zigai/interfacy.git\"\n```\n\n## Quick start\n\n```python\nfrom interfacy import Argparser\n\ndef greet(name: str, times: int = 1) -\u003e None:\n    for _ in range(times):\n        print(f\"Hello, {name}!\")\n\nif __name__ == \"__main__\":\n    Argparser().run(greet)\n```\n\n## Classes as flags\n\n```python\nfrom dataclasses import dataclass\nfrom interfacy import Argparser\n\n@dataclass\nclass Address:\n    \"\"\"Mailing address data for a user.\n\n    Args:\n        city: City name.\n        zip: Postal or ZIP code.\n    \"\"\"\n    city: str\n    zip: int\n\n@dataclass\nclass User:\n    \"\"\"User profile information for the CLI.\n\n    Args:\n        name: Display name.\n        age: Age in years.\n        address: Optional mailing address details.\n    \"\"\"\n    name: str\n    age: int\n    address: Address | None = None\n\ndef greet(user: User) -\u003e str:\n    if user.address is None:\n        return f\"Hello {user.name}, age {user.age}\"\n    return f\"Hello {user.name}, age {user.age} from {user.address.city} {user.address.zip}\"\n\nif __name__ == \"__main__\":\n    Argparser(print_result=True).run(greet)\n```\n\nHelp output:\n\n```text\nusage: app.py greet [--help] --user.name USER.NAME --user.age USER.AGE\n                    [--user.address.city] [--user.address.zip]\n\noptions:\n  --help                      show this help message and exit\n  --user.name                 Display name. [type: str] (*)\n  --user.age                  Age in years. [type: int] (*)\n  --user.address.city         City name. [type: str]\n  --user.address.zip          Postal or ZIP code. [type: int]\n```\n\n## Class-based commands\n\n```python\nfrom interfacy import Argparser\n\nclass Calculator:\n    def add(self, a: int, b: int) -\u003e int:\n        return a + b\n\n    def mul(self, a: int, b: int) -\u003e int:\n        return a * b\n\nif __name__ == \"__main__\":\n    Argparser(print_result=True).run(Calculator)\n```\n\n## Decorator-based commands\n\n```python\nfrom interfacy import Argparser\n\nparser = Argparser()\n\n@parser.command()\ndef greet(name: str) -\u003e str:\n    return f\"Hello, {name}!\"\n\n@parser.command(name=\"calc\", aliases=[\"c\"])\nclass Calculator:\n    def add(self, a: int, b: int) -\u003e int:\n        return a + b\n\n    def mul(self, a: int, b: int) -\u003e int:\n        return a * b\n\nif __name__ == \"__main__\":\n    parser.run()\n```\n\n## CLI entrypoint\n\nUse the CLI entrypoint to run a target callable from a module or file, or to inspect its help:\n\n```text\nusage: interfacy [--help] [--version] [--config-paths] [TARGET] ...\n\nInterfacy is a CLI framework for building command-line interfaces from Python callables.\n\npositional arguments:\n  TARGET                      Python file or module with a symbol (e.g. main.py:main or pkg.cli:app).\n  ARGS                        Arguments passed through to the target command.\n\noptions:\n  --help                      show this help message and exit\n  --version                   show version and exit.\n  --config-paths              print config file search paths and exit.\n\nUse 'interfacy TARGET --help' to display the help text for the target.\n```\n\n## License\n\n[MIT License](https://github.com/zigai/interfacy/blob/main/LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzigai%2Finterfacy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzigai%2Finterfacy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzigai%2Finterfacy/lists"}