{"id":21702893,"url":"https://github.com/operations-project/composer-project-bin-scripts","last_synced_at":"2026-01-05T09:51:00.805Z","repository":{"id":216664104,"uuid":"742012468","full_name":"operations-project/composer-project-bin-scripts","owner":"operations-project","description":"Include bin scripts in top level composer projects.","archived":false,"fork":false,"pushed_at":"2024-09-11T16:17:50.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"2.x","last_synced_at":"2024-11-17T01:20:26.866Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/operations-project.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}},"created_at":"2024-01-11T15:24:58.000Z","updated_at":"2024-07-10T18:16:13.000Z","dependencies_parsed_at":"2024-01-11T21:06:03.947Z","dependency_job_id":"18a4a733-acdf-4342-8e1f-f12b83f9fdb0","html_url":"https://github.com/operations-project/composer-project-bin-scripts","commit_stats":null,"previous_names":["jonpugh/composer-project-bins","operations-platform/composer-project-bins","operations-platform/composer-project-bin-scripts","operations-project/composer-project-bin-scripts"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operations-project%2Fcomposer-project-bin-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operations-project%2Fcomposer-project-bin-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operations-project%2Fcomposer-project-bin-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/operations-project%2Fcomposer-project-bin-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/operations-project","download_url":"https://codeload.github.com/operations-project/composer-project-bin-scripts/tar.gz/refs/heads/2.x","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":226401072,"owners_count":17619280,"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":"2024-11-25T21:21:59.278Z","updated_at":"2026-01-05T09:51:00.775Z","avatar_url":"https://github.com/operations-project.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Project Bin Scripts\n## Your scripts in the Composer bin-dir.\n\nThis plugin allows you to add your own scripts as composer bins to projects.\n\nIt works just like dependent packages \"bin\" scripts work: a link is created from\nyour vendor bin directory to the script.\n\n### Advantages:\n\n1. All commands for your project can be run from the same directory, the vendor bin dir.\n2. The composer bin dir and autoloader path are available via bash or PHP variables.\n3. Scripts can use ensure they are calling exact versions of scripts such as `drush` or `npm` by including this path.\n\nSee [Composer \"Vendor Binaries\" Documentation](https://getcomposer.org/doc/articles/vendor-binaries.md#finding-the-composer-autoloader-from-a-binary) for more information.\n\n## Usage\n\n1. Install the plugin.\n\n    ```\n    $ composer require operations/project-bin-scripts\n    ```\n2. Create a script file.\n    ```shell\n    #!/usr/bin/env bash\n    # File: scripts/hello-world\n\n    # If your script wants to rely on the other scripts in bin-dir, check for $COMPOSER_RUNTIME_BIN_DIR\n    if [[ -z $COMPOSER_RUNTIME_BIN_DIR ]]; then\n      echo \"ERROR: The COMPOSER_RUNTIME_BIN_DIR environment variable is missing. Run this script from the composer vendor bin directory.\"\n      exit 1\n    fi\n\n    # Set the PATH variable to include COMPOSER_RUNTIME_BIN_DIR to allow calling\n    # other bin scripts directly.\n    PATH=$PATH:$COMPOSER_RUNTIME_BIN_DIR\n\n    echo \"Hello World!\"\n    echo \"You are here:\"\n    pwd\n\n    # To confirm this works, try using \"which\"\n    echo \"You are using this drush: \"\n    which drush\n    drush --version\n\n    ```\n3. Add to `composer.json`:\n    ```json\n    {\n      \"bin\": [\n        \"scripts/hello-world\"\n      ]\n    }\n    ```\n\n4. Run composer install:\n\n    ```\n    $ composer install\n    ```\n\n5. Run your script from the composer bin path:\n    ```shell\n    ./vendor/bin/hello-world\n    ```\n\n   Or, if you set PATH, just use the command.\n\n    ```shell\n    PATH=$PATH:./vendor/bin\n    hello-world\n    ```\n## NOTE about composer schema for \"bin\"\n\nThis is the same configuration used by `composer.json` schema for dependencies.\nUsing this same config here might cause some confusion.\n\nThe main reason this was used is so the plugin could use the exact same code\nto install project binaries as it does dependency binaries.\n\nIf you think this is confusing and should change, please submit a pull request.\n\n## About\n\n- Created by: [Jon Pugh](https://github.com/jonpugh)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foperations-project%2Fcomposer-project-bin-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foperations-project%2Fcomposer-project-bin-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foperations-project%2Fcomposer-project-bin-scripts/lists"}