{"id":21243371,"url":"https://github.com/kamangir/blue-options","last_synced_at":"2025-07-10T20:31:49.723Z","repository":{"id":246801421,"uuid":"823433920","full_name":"kamangir/blue-options","owner":"kamangir","description":"🌀 options for Bash.","archived":false,"fork":false,"pushed_at":"2025-03-16T00:03:47.000Z","size":187,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-17T04:11:15.752Z","etag":null,"topics":["ai","bash","bash-scripting","languages"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/blue-options/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kamangir.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-03T03:12:45.000Z","updated_at":"2025-03-16T00:03:50.000Z","dependencies_parsed_at":"2025-01-10T00:20:13.170Z","dependency_job_id":"738f4e63-24ae-4e2c-99a0-6d2ec310cebb","html_url":"https://github.com/kamangir/blue-options","commit_stats":null,"previous_names":["kamangir/blue-options"],"tags_count":0,"template":false,"template_full_name":"kamangir/blue-plugin","purl":"pkg:github/kamangir/blue-options","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamangir%2Fblue-options","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamangir%2Fblue-options/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamangir%2Fblue-options/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamangir%2Fblue-options/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamangir","download_url":"https://codeload.github.com/kamangir/blue-options/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamangir%2Fblue-options/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264652701,"owners_count":23644314,"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":["ai","bash","bash-scripting","languages"],"created_at":"2024-11-21T01:11:56.303Z","updated_at":"2025-07-10T20:31:49.717Z","avatar_url":"https://github.com/kamangir.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🌀 blue-options\n\n🌀 `blue_options` implements an `options` argument for Bash.\n\nhere is an example use of an `options` in the [vancouver-watching 🌈](https://github.com/kamangir/vancouver-watching) ingest command:\n\n\n```bash\n \u003e @help vanwatch ingest\n```\n```bash\nvanwatch \\\n\tingest \\\n\t[area=\u003carea\u003e,count=\u003c-1\u003e,~download,dryrun,~upload] \\\n\t[-|\u003cobject-name\u003e] \\\n\t[process,count=\u003c-1\u003e,~download,dryrun,gif,model=\u003cmodel-id\u003e,publish,~upload] \\\n\t[--detect_objects 0] \\\n\t[--overwrite 1] \\\n\t[--verbose 1]\n```\n\nthis command takes in an `options`, an `object`, and `args`. an `options` is a string representation of a dictionary, such as,\n\n```bash\narea=\u003cvancouver\u003e,~batch,count=\u003c-1\u003e,dryrun,gif,model=\u003cmodel-id\u003e,~process,publish,~upload\n```\n\nwhich is equivalent, in json notation, to,\n\n```json\n{\n    \"area\": \"vancouver\",\n    \"batch\": false,\n    \"count\": -1,\n    \"dryrun\": true,\n    \"gif\": true,\n    \"model\": \"\u003cmodel-id\u003e\",\n    \"process\": false,\n    \"publish\": true,\n    \"upload\": false,\n}\n```\n\nfor more refer to 🔻 [giza](https://github.com/kamangir/giza).\n\n## installation\n\n```bash\npip install blue_options\n```\n\nadd this line to your `~/.bash_profile` or `~/.bashrc`,\n\n```bash\nsource $(python3 -m blue_options locate)/.bash/blue_options.sh\n```\n\n## usage\n\nlet your function receive an `options` argument, then parse it with `abcli_options` and `abcli_options_int`.\n\n```bash\nfunction func() {\n    local options=$1\n\n    local var=$(abcli_options \"$options\" var default)\n    local key=$(abcli_options_int \"$options\" key 0)\n\n    [[ \"$key\" == 1 ]] \u0026\u0026\n        echo \"var=$var\"\n}\n```\n\n## example 1\n\nfrom [reddit](https://www.reddit.com/r/bash/comments/1duw6ac/how_can_i_automate_these_tree_commands_i/)\n\n\u003e How can I automate these tree commands I frequently need to type out?\nI would like to run:\n```bash\ngit add .\ngit commit -m \"Initial \"commit\"\ngit push\n```\n\u003e I got bored of typing them out each time. Can I make an alias or something like \"gc\" (for git commit). The commit message is always the same \"Initial commit\".\n\nfirst, install `blue-options`. this will also install [`blueness`](https://github.com/kamangir/blueness).\n\n```bash\npip install blue_options\n```\n\nthen, copy [`example1.sh`](./blue_options/assets/example1.sh) to your machine and add this line to the end of your `bash_profile`,\n\n```bash\nsource \u003cpath/to/example1.sh\u003e\n```\n\nnow, you have access to the `@git` super command. here is how it works.\n\n1. `@git help` shows usage instructions (see below).\n1. `@git commit` runs the three commands. you can customize the message by running `@git commit \u003cmessage\u003e`. you can also avoid the push by running `@git commit \u003cmessage\u003e ~push`.\n1. for any `\u003ctask\u003e` other than `commit`, `@git \u003ctask\u003e \u003cargs\u003e` runs `git \u003ctask\u003e \u003cargs\u003e`.\n\n```\n \u003e @git help\n @git commit [\u003cmessage\u003e] \\\n\t~push\n . git commit with \u003cmessage\u003e and push.\n@git \u003ccommand\u003e\n . git \u003ccommand\u003e.\n ```\n\n![image](https://raw.githubusercontent.com/kamangir/assets/main/blue-options/example1.png)\n\n---\n\n[![pylint](https://github.com/kamangir/blue-options/actions/workflows/pylint.yml/badge.svg)](https://github.com/kamangir/blue-options/actions/workflows/pylint.yml) [![pytest](https://github.com/kamangir/blue-options/actions/workflows/pytest.yml/badge.svg)](https://github.com/kamangir/blue-options/actions/workflows/pytest.yml) [![PyPI version](https://img.shields.io/pypi/v/blue-options.svg)](https://pypi.org/project/blue-options/) [![PyPI - Downloads](https://img.shields.io/pypi/dd/blue-options)](https://pypistats.org/packages/blue-options)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamangir%2Fblue-options","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamangir%2Fblue-options","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamangir%2Fblue-options/lists"}