{"id":24262986,"url":"https://github.com/projectcleverweb/cli-stuff","last_synced_at":"2025-09-10T07:34:50.703Z","repository":{"id":8259889,"uuid":"9709970","full_name":"ProjectCleverWeb/CLI-stuff","owner":"ProjectCleverWeb","description":null,"archived":false,"fork":false,"pushed_at":"2013-08-12T16:42:02.000Z","size":86,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T22:45:55.175Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/ProjectCleverWeb.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}},"created_at":"2013-04-27T05:43:55.000Z","updated_at":"2022-09-03T17:44:10.000Z","dependencies_parsed_at":"2022-08-07T00:00:59.135Z","dependency_job_id":null,"html_url":"https://github.com/ProjectCleverWeb/CLI-stuff","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ProjectCleverWeb/CLI-stuff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProjectCleverWeb%2FCLI-stuff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProjectCleverWeb%2FCLI-stuff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProjectCleverWeb%2FCLI-stuff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProjectCleverWeb%2FCLI-stuff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ProjectCleverWeb","download_url":"https://codeload.github.com/ProjectCleverWeb/CLI-stuff/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ProjectCleverWeb%2FCLI-stuff/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261020447,"owners_count":23098151,"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":[],"created_at":"2025-01-15T07:25:29.730Z","updated_at":"2025-06-20T21:33:32.398Z","avatar_url":"https://github.com/ProjectCleverWeb.png","language":"PHP","readme":"CLI-stuff\n=========\n\n#Prerequisites#\n* PHP installed and [added to your $PATH](http://blog.eukhost.com/webhosting/how-do-i-add-my-php-directory-to-the-path-on-windows/)\n* Download [ANSICON](https://github.com/Project-CleverWeb/Perfect-Shell/tree/master/windows/resources/ansicon), and [install it](https://github.com/adoxa/ansicon/blob/master/readme.txt) **(windows only)**\n\u0026nbsp;\n\n* **Notice 1:** Linux will automatically add php to your path if installed via `apt-get` or `yum`\n* **Notice 2:** Currently the ANSICON source on github is incomplete, and does not contain the `x86` and `x64` folders. The download link supplied is to one of my own repos that has the complete version of ANSICON in it. **I do not own or contribute to ANSICON.**\n\n#The Script#\nThis script will soon become apart of a [larger project](https://github.com/Project-CleverWeb/Perfect-Shell) of mine, but of course you can play with the current working version.\n\n#Usage#\n**NOTE:** All examples assume the script is located in a file called `color.php` and it is located in the current directory.\n\nThe only required variable is a string supplied via either the `-s` argument or `STDIN`. This means both of the following will work without error:\n\n    php color.php -s \"my name is frank\"\n\n    echo my name is frank | php color.php\n\n**NOTE:** Right now the default text color is white, and it is hard-coded in. A future build will likely allow this to be changed on-the-fly.\n\n**However,** if both `STDIN` and `-s` are provided, `STDIN` will not be modified and it will be prepended to `-s`. \n\n    php color.php -s \"hello, \" -c yellow | php color.php -s Frank -c red\n\nThe above example would print \"hello, Frank\" where 'hello, ' is yellow, and 'Frank' is red.\n\n**Please note:** Quotes are only required around a string if it has a `space` character in it.\n\n#Other Variables#\n\nUnlike the string variable, the remaining variables are not required, but each must use their respective argument.\n\nThe first optional argument is `-c` which colors the text of the string (see [*Ex 2*](#ex-2)). The next argument is `-C` which colors the background of the string (see [*Ex 3*](#ex-3)). And then there is the `-S` argument, which allows changing the style of the text (see [*Ex 4*](#ex-4)).\n\nThere is also the `--no-stdin` argument which will discard the `STDIN` string. This is more for future compatibly, which may allow `STDIN` to supply settings or other information.\n\nFinally, You can easily **view an example of all the colors and styles** available by using the `--print-all` argument (see [*Ex 1*](#ex-1)). Please keep in mind this will discard all the other variables.\n\n#Examples#\n####Ex 1:####\nThis will print all the possible colors and styles, but will ignore all other supplied variables, including STDIN.\n\n    php color.php --print-all\n\n####Ex 2:####\nThis will show the git diff short-stat where just the text is yellow.\n\n    git diff --shortstat | php color.php -c light_yellow\n\n####Ex 3:#####\n(*Linux*) This will show the current directory with blue text on a white background.\n\n    pwd | php color.php -c blue -C white\n\n####Ex 4:####\nThis will show the string \"task complete: Make example #4\" where \"Make example #4\" has a strike through it.\n\n    echo \"task complete: \" | php color.php -s \"Make example #4\" -S strike\n\n####Ex 5:####\n(*Linux*) Assuming you put the function `git-unpushed` into your `~/.bashrc` file, the following would print \"Not Pushed: 2\" in a bold green text, given you have 2 commits ready to be pushed to Github in this directory.\n\n    function git-unpushed {\n        brinfo=$(git branch -v)\n        if [[ $brinfo =~ (\"[ahead \"([[:digit:]]*)]) ]]\n        then\n            echo \"Not Pushed: ${BASH_REMATCH[2]}\"\n        fi\n    }\n    \n    git-unpushed | php color.php -c green -S bold\n\n[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/ProjectCleverWeb/CLI-stuff/trend.png)](https://bitdeli.com/free \"Bitdeli Badge\")\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectcleverweb%2Fcli-stuff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprojectcleverweb%2Fcli-stuff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprojectcleverweb%2Fcli-stuff/lists"}