{"id":17149143,"url":"https://github.com/pranavnt/mamba","last_synced_at":"2025-07-23T10:38:17.904Z","repository":{"id":57570483,"uuid":"346177764","full_name":"pranavnt/mamba","owner":"pranavnt","description":"Simple, intuitive Golang package for building CLIs","archived":false,"fork":false,"pushed_at":"2021-07-18T23:55:21.000Z","size":47,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-19T21:19:16.557Z","etag":null,"topics":["cli","command-line","go","golang","mamba"],"latest_commit_sha":null,"homepage":"","language":"Go","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/pranavnt.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-09T23:56:48.000Z","updated_at":"2023-08-25T20:32:23.000Z","dependencies_parsed_at":"2022-09-10T19:10:37.943Z","dependency_job_id":null,"html_url":"https://github.com/pranavnt/mamba","commit_stats":null,"previous_names":["pranavnt/cli"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pranavnt/mamba","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranavnt%2Fmamba","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranavnt%2Fmamba/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranavnt%2Fmamba/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranavnt%2Fmamba/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pranavnt","download_url":"https://codeload.github.com/pranavnt/mamba/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pranavnt%2Fmamba/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266664235,"owners_count":23964930,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cli","command-line","go","golang","mamba"],"created_at":"2024-10-14T21:32:04.814Z","updated_at":"2025-07-23T10:38:17.879Z","avatar_url":"https://github.com/pranavnt.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eMamba\u003c/h1\u003e \n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./.github/mamba.png\" width=\"15%\" /\u003e\n\u003c/p\u003e\n\u003cdiv align=\"center\"\u003e\n\u003ca href=\"https://pkg.go.dev/github.com/pranavnt/mamba\"\u003e\u003cimg alt=\"Godoc Reference\" src=\"https://godoc.org/github.com/pranavnt/mamba?status.svg\"\u003e\u003c/a\u003e\n\u003cimg src=\"https://github.com/pranavnt/mamba/workflows/Push/badge.svg\" alt=\"push workflow result\"/\u003e\n\u003cimg alt=\"go version\" src=\"https://img.shields.io/github/go-mod/go-version/pranavnt/mamba\"/\u003e\n\u003c/div\u003e\n\u003ch2 align=\"center\"\u003eBuild command line apps in Go with ease\u003c/h2\u003e\n\n## Installation 💻\n\nTo install mamba, run the following command in terminal:\n\n```bash\ngo get github.com/pranavnt/mamba\n```\n\nTo use it, include it in your imports:\n\n```go\nimport (\n    \"github.com/pranavnt/mamba\"\n)\n```\n\n## Usage 📝\n\nFor the usage example, we'll create a command line app called `ace`, which is used for deploying apps.\n\nFirst, we will want to initialize a CLI app, which is done through:\n\n```go\napp := mamba.New()\n```\n\nNext, we will want to add commands to our app, which you do through `AddCommand`:\n\n```go\napp.AddCommand(\"deploy {fileName}\", deploy)\n```\n\nThe command above creates the deploy command, which takes in a parameter for `fileName` (the user will enter this). For example, this would handle `ace run hello.py`.\n\nNow, let's write code for the function that handles this command, called `deploy`. This function must accept one parameter (of type `mamba.Dict`).\n\n```go\nfunc deploy(params mamba.Dict) {\n\tfmt.Println(\"About to deploy \" + params[\"fileName\"].(string))\n\t// code for deployment\n}\n```\n\nHere is a sample function where you can read and print the fileName. You can later use this parameter to actually deploy the project in this app.\n\nFinally, in order to run the code, you need to add:\n\n```go\napp.Run(os.Args)\n```\n\nHere, you are actually running the app, and `os.Args` are the command line arguments that are parsed by mamba. You're done!\n\nThe full code:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n    \"os\"\n\t\"github.com/pranavnt/mamba\"\n)\n\nfunc main() {\n\tapp := mamba.New()\n\tapp.AddCommand(\"deploy {directory}\", deploy)\n\tapp.Run(os.Args)\n}\n\nfunc deploy(params mamba.Dict) {\n\tfmt.Println(\"About to deploy \" + params[\"directory\"].(string))\n\t// other code for deployment\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpranavnt%2Fmamba","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpranavnt%2Fmamba","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpranavnt%2Fmamba/lists"}