{"id":15442850,"url":"https://github.com/unixorn/gitlike-commands","last_synced_at":"2025-04-19T20:02:00.406Z","repository":{"id":37959084,"uuid":"467973056","full_name":"unixorn/gitlike-commands","owner":"unixorn","description":"Easy python module for creating git-style subcommand handling.","archived":false,"fork":false,"pushed_at":"2024-09-02T14:29:41.000Z","size":35,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-18T13:16:24.313Z","etag":null,"topics":["cli","hacktoberfest","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/unixorn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":null,"patreon":"unixorn","open_collective":null,"ko_fi":"unixorn","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2022-03-09T14:59:39.000Z","updated_at":"2024-09-02T14:29:39.000Z","dependencies_parsed_at":"2025-03-03T00:32:18.141Z","dependency_job_id":"bfcc51b8-0748-46b0-8acb-aa536541f345","html_url":"https://github.com/unixorn/gitlike-commands","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"e1f735c4d4c33e57358a6fbf94d2bc837a5e1128"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unixorn%2Fgitlike-commands","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unixorn%2Fgitlike-commands/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unixorn%2Fgitlike-commands/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/unixorn%2Fgitlike-commands/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/unixorn","download_url":"https://codeload.github.com/unixorn/gitlike-commands/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249787507,"owners_count":21325571,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cli","hacktoberfest","python3"],"created_at":"2024-10-01T19:30:46.086Z","updated_at":"2025-04-19T20:02:00.368Z","avatar_url":"https://github.com/unixorn.png","language":"Python","funding_links":["https://patreon.com/unixorn","https://ko-fi.com/unixorn"],"categories":[],"sub_categories":[],"readme":"# gitlike-commands\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/license/apache-2-0/)\n[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Funixorn%2Fgitlike-commands%2Fbadge%3Fref%3Dmain\u0026style=plastic)](https://actions-badge.atrox.dev/unixorn/gitlike-commands/goto?ref=main)\n![Awesomebot](https://github.com/unixorn/gitlike-commands/actions/workflows/awesomebot.yml/badge.svg)\n![Megalinter](https://github.com/unixorn/gitlike-commands/actions/workflows/mega-linter.yml/badge.svg)\n[![Issue Count](https://codeclimate.com/github/unixorn/gitlike-commands/badges/issue_count.svg)](https://codeclimate.com/github/unixorn/gitlike-commands)\n![PyPI - Format](https://img.shields.io/pypi/format/gitlike-commands?style=plastic)\n## Background\n\n`gitlike-commands` is a python module for easily creating `git`-style subcommand handling.\n\nRefactored out of [thelogrus](https://github.com/unixorn/thelogrus/) so you don't have to import any modules that aren't part of the Python standard library.\n\n## Usage\n\n`subcommand_driver` automatically figures out what name the script was called as, then looks for subcommands and runs them if found, passing in any command line options.\n\nSo if you have a `foo` script in your `$PATH` as shown below\n\n```python\n#!/usr/bin/env python3\nfrom gitlike_commands import subcommand_driver\n\nif __name__ == '__main__':\n    subcommand_driver()\n```\n\nRunning `foo bar baz` will look for a `foo-bar-baz` script, and if present in your `$PATH`, run it. If there is no `foo-bar-baz`, it will look for `foo-bar`, and if it finds that, run `foo-bar baz`.\n\nIf you're using poetry in your python project, you can add a gitlike driver as a scripts entry:\n\n```toml\n[tool.poetry.scripts]\ngitalike-demo = \"gitlike_commands:subcommand_driver\"\n```\n\nThe subcommands can be written in any language, the only requirements are that they are marked executable and follow the `foo-something` naming convention.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funixorn%2Fgitlike-commands","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Funixorn%2Fgitlike-commands","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Funixorn%2Fgitlike-commands/lists"}