{"id":16021030,"url":"https://github.com/cirocosta/vai","last_synced_at":"2026-05-08T19:33:35.479Z","repository":{"id":73883930,"uuid":"114537509","full_name":"cirocosta/vai","owner":"cirocosta","description":"Single script that wraps a list of scripts in a directory as a CLI","archived":false,"fork":false,"pushed_at":"2017-12-17T15:26:52.000Z","size":5,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-03T21:49:46.485Z","etag":null,"topics":["bash","linux","scripting","shell"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cirocosta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-12-17T13:15:41.000Z","updated_at":"2017-12-17T23:20:48.000Z","dependencies_parsed_at":null,"dependency_job_id":"5e6e2ec9-5c86-4cd5-b951-20448c708e68","html_url":"https://github.com/cirocosta/vai","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"0b7a9161cb56918d992be808d5c4c6dc43de35fc"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cirocosta/vai","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirocosta%2Fvai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirocosta%2Fvai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirocosta%2Fvai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirocosta%2Fvai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cirocosta","download_url":"https://codeload.github.com/cirocosta/vai/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cirocosta%2Fvai/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32794716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["bash","linux","scripting","shell"],"created_at":"2024-10-08T18:01:32.536Z","updated_at":"2026-05-08T19:33:35.461Z","avatar_url":"https://github.com/cirocosta.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003evai ⚡️  \u003c/h1\u003e\n\n\u003ch5 align=\"center\"\u003eA CLI script runtime to bring order to your scripts (or not)\u003c/h5\u003e\n\n\u003cbr/\u003e\n\n### Overview\n\n`vai` is a little piece of `bash` scripting that aims at enforcing a certain organization in how scripts advertise their use as well as providing a way of discovering a other commands that belong to a given project.\n\nThis can be best understood with an example.\n\nSay that our project has 3 scripts that perform the following functions:\n\n- `say-hello.sh`: prints `hello` to stdout\n- `say-world`: adds `one` to whatever comes in the first arg\n- `say-haha`: reverses a string\n\nWe can take the traditional method of simply putting all of them under a directory and creating a `README.md` that documents it. Or, use `vai` and implement few methods that advertise their functionality:\n\n```\nscripts\n├── say-haha.sh\n├── say-hello.sh\n└── say-world.sh\n```\n\nEach of these scripts would then implement two methods: `description` and `main`.\n\nHaving these two methods implemented, the expected interface is fulfilled and so `vai` can route executions to them.\n\n```sh\n#!/bin/bash\n\ndescription () {\n  echo 'Prints `hello` to stdout.'\n}\n\nmain () {\n  echo \"hello!\"\n}\n\neval \"$@\"\n```\n\nThis way, `vai list` shows the commands:\n\n```sh\nvai\n\n  USAGE:\n    vai \u003ccommand\u003e [args]\n\n  COMMANDS:\n    help                  Prints a command's help message                   \n    say-world             Prints `world` to stdout.                         \n    say-hello             Prints `hello` to stdout.                         \n    description           Prints a project's description                    \n    list                  Lists available 'vai' commands                    \n    say-haha              Prints `haha` to stdout.                          \n\nvai say-world\nworld!\n```\n\n### Should I use this?\n\nWell, maybe yes, maybe not.\n\nThis was meant to be just a quick experiment and is probably not suitable for real use case. However, feel free to make use of it if you find useful 👌\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcirocosta%2Fvai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcirocosta%2Fvai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcirocosta%2Fvai/lists"}