{"id":17348078,"url":"https://github.com/tavinus/cli-barcode","last_synced_at":"2025-09-21T02:03:49.464Z","repository":{"id":83182765,"uuid":"63058132","full_name":"tavinus/cli-barcode","owner":"tavinus","description":"Generates awesome barcodes from CLI using PHP","archived":false,"fork":false,"pushed_at":"2022-11-20T18:59:01.000Z","size":67,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-04T10:08:48.524Z","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/tavinus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":"tavinus","ko_fi":"tavinus","custom":["https://bit.ly/paypaltavinus"]}},"created_at":"2016-07-11T10:16:10.000Z","updated_at":"2022-11-20T18:59:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"359c4daf-0ee3-462f-9fa8-622688a9aa03","html_url":"https://github.com/tavinus/cli-barcode","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/tavinus/cli-barcode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tavinus%2Fcli-barcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tavinus%2Fcli-barcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tavinus%2Fcli-barcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tavinus%2Fcli-barcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tavinus","download_url":"https://codeload.github.com/tavinus/cli-barcode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tavinus%2Fcli-barcode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276183775,"owners_count":25599223,"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-09-21T02:00:07.055Z","response_time":72,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":[],"created_at":"2024-10-15T16:51:01.824Z","updated_at":"2025-09-21T02:03:49.449Z","avatar_url":"https://github.com/tavinus.png","language":"PHP","funding_links":["https://github.com/sponsors/tavinus","https://ko-fi.com/tavinus","https://bit.ly/paypaltavinus"],"categories":[],"sub_categories":[],"readme":"# cli-barcode PHP\n### Current version [1.0.8](https://github.com/tavinus/cli-barcode/releases/tag/1.0.8)\nCreate awesome barcodes from CLI using PHP.  \nThis script uses @picqer's [php-barcode-generator](https://github.com/picqer/php-barcode-generator) to generate barcodes from the command line.  \nFor command line parsing @ulrichsg's [getopt-php](https://github.com/ulrichsg/getopt-php) is used.  \n## Generating barcodes\nUsage is pretty straight forward.  \n```\nbarcode -e \u003cencoding\u003e -f \u003coutput_format\u003e [options] \u003cbarcode string\u003e \u003coutput file\u003e\n```\n##### There are 4 required parameters  \n1. Encoding (barcode type)  \n2. Output format (png, jpg, svg, html)  \n3. Barcode string (will become the barcode)  \n4. Output file (where to save it)  \n\n##### Apart from that you get a few optional parameters\n* Width factor for the bars, defaults to 2\n* Height of the bars, defaults to 30\n* Color of the bars, defaults to '#000000' (black)\n  \nI find the default settings for these very optimal, since there is usually no big penalty on resizing the barcodes generated.  \nThe encodings and output formats are case-insenstive.  \n\n##### Important Notes\nFrom [v1.0.6](https://github.com/tavinus/cli-barcode/releases/tag/1.0.6) parameters and options can be passed in any order,  \nas long as the `Barcode String` comes before the `Output File`.  \nThis requires my patched version of `getopt-php`.  \n  \n## Example Runs\n#### Blue Colored `CODE_128_C` SVG with \"123123123123\"\n```\n$ barcode -v -c '#0030ff' -e CODE_128_C -f SVG \"123123123123\" $HOME/teste.svg \nPHP-CLI Barcode v1.0.6 - Verbose Execution\nOutput File       : /home/guneves/teste.svg       \nBarcode String    : 123123123123                  \nBarcode Encoding  : CODE_128_C                    \nOutput Format     : SVG                           \nWidth Factor      : 2                             \nHeight of Barcode : 30                            \nHex Color         : #0030ff                       \nFinal Status      : Success\n```\n#### `CODE_39` PNG with \"A GREAT BAR\" and custom Width Factor and Height\n```\n$ barcode -vv -e CODE_39 -f PNG \"A GREAT BAR\" $HOME/test.png \n2017-05-20T06:10:44-03:00 | PHP-CLI Barcode v1.0.6 - Verbose Execution\n2017-05-20T06:10:44-03:00 | Output File       : /home/guneves/test.png        \n2017-05-20T06:10:44-03:00 | Barcode String    : A GREAT BAR                   \n2017-05-20T06:10:44-03:00 | Barcode Encoding  : CODE_39                       \n2017-05-20T06:10:44-03:00 | Output Format     : PNG                           \n2017-05-20T06:10:44-03:00 | Width Factor      : 2                             \n2017-05-20T06:10:44-03:00 | Height of Barcode : 30                            \n2017-05-20T06:10:44-03:00 | Hex Color         : #000000                       \n2017-05-20T06:10:44-03:00 | Final Status      : Success\n```\n## Help Information from cli\n```\n$ barcode --help\nPHP-CLI Barcode v1.0.6\nUsage: barcode -e \u003cencoding\u003e -f \u003coutput_format\u003e [options] \u003cbarcode string\u003e \u003coutput file\u003e\nOptions:\n  -e, --encoding \u003cbar-type\u003e    Barcode encoding type selection, listed below\n  -f, --format \u003cfile-type\u003e     Output format for the barcode, listed below\n  -w, --width \u003cpoints\u003e         Width factor for bars to make wider, defaults to 2\n  -h, --height \u003cpoints\u003e        Total height of the barcode, defaults to 30\n  -c, --color \u003chex-color\u003e      Hex code of the foreground color, defaults to black\n                               Eg. -c 54863b, or -c '#000'\n  -v, --verbose                Prints verbose information to screen\n                               Use twice for timestamp\n  -q, --quiet                  Supress all messages, even errors\n  --help                       Help Information, including encodings and formats\n  --version                    Display version information and exits\n  --create-bash                Creates a shell script named 'barcode' that can call this script\n\nRequired Options and Parameters:\n    -e \u003cencoding\u003e\n    -f \u003coutput format\u003e\n    \u003cinput string\u003e\n    \u003coutput file\u003e\n\nOutput Formats:\n    HTML\n    JPG\n    PNG\n    SVG\n\nEncodings:\n    CODABAR\n    CODE_11\n    CODE_128\n    CODE_128_A\n    CODE_128_B\n    CODE_128_C\n    CODE_39\n    CODE_39E\n    CODE_39E_CHECKSUM\n    CODE_39_CHECKSUM\n    CODE_93\n    EAN_13\n    EAN_2\n    EAN_5\n    EAN_8\n    IMB\n    INTERLEAVED_2_5\n    INTERLEAVED_2_5_CHECKSUM\n    KIX\n    MSI\n    MSI_CHECKSUM\n    PHARMA_CODE\n    PHARMA_CODE_TWO_TRACKS\n    PLANET\n    POSTNET\n    RMS4CC\n    STANDARD_2_5\n    STANDARD_2_5_CHECKSUM\n    UPC_A\n    UPC_E\n\nExamples:\n    barcode -f HTML -e CODE_39 \"1234567890\" \"/tmp/1234567890.html\"\n    barcode -e CODE_128 -f PNG -c \"#888\" -w 3 -h 50 \"AGREATBAR\" \"/tmp/AGREATBAR.png\"\n    barcode \"1234567890\" \"/tmp/mybar.svg\" --encoding EAN_13 --format SVG\n```\n\n\n## How to install using `Make`\nThe vendor folder is included so we can just download this package and run it.  \nI have also made some patches upstream to both `getopt-php` and `php-barcode-generator`.  \n  \nYou can [download the zip](https://github.com/tavinus/cli-barcode/archive/master.zip) or [tarball](https://github.com/tavinus/cli-barcode/archive/master.tar.gz) and put the cli-barcode folder where you want it to be installed.  \n  \n### Or use git to clone:\n```\ngit clone https://github.com/tavinus/cli-barcode.git $HOME/cli-barcode # \u003c= Replace TARGET\ncd $HOME/cli-barcode # \u003c= Replace TARGET\n```\n\nThen you can run:  \n```\n./barcode.php --create-bash\n``` \nTo recreate the `barcode` file with the full path to your installation. \n  \nAt this point you can run:\n```\nsudo make install\n``` \nTo copy the shell executable to `/usr/local/bin/barcode`.  \n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftavinus%2Fcli-barcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftavinus%2Fcli-barcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftavinus%2Fcli-barcode/lists"}