{"id":13583041,"url":"https://github.com/joshuatvernon/cbf","last_synced_at":"2025-04-06T18:31:50.619Z","repository":{"id":32730128,"uuid":"140098466","full_name":"joshuatvernon/cbf","owner":"joshuatvernon","description":"CBF  🦥is a simple CLI tool for developers who can't be f#@!'d learning or remembering all the commands they have to run day to day or just in a specific repo","archived":false,"fork":false,"pushed_at":"2023-02-27T15:32:07.000Z","size":2202,"stargazers_count":27,"open_issues_count":12,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T14:03:16.260Z","etag":null,"topics":["cbf","cli","command","commands","json-script","runner","runners","script","scriptrunner","scripts","yaml-script"],"latest_commit_sha":null,"homepage":"https://joshuatvernon.github.io/cbf-site/","language":"JavaScript","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/joshuatvernon.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"patreon":"joshuatvernon"}},"created_at":"2018-07-07T16:08:31.000Z","updated_at":"2023-07-01T06:43:22.000Z","dependencies_parsed_at":"2024-01-12T20:03:59.647Z","dependency_job_id":null,"html_url":"https://github.com/joshuatvernon/cbf","commit_stats":{"total_commits":166,"total_committers":4,"mean_commits":41.5,"dds":"0.47590361445783136","last_synced_commit":"10d18ce356301a362d4febe3e515d149ff6eb5c5"},"previous_names":["joshuatvernon/pyr"],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuatvernon%2Fcbf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuatvernon%2Fcbf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuatvernon%2Fcbf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joshuatvernon%2Fcbf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joshuatvernon","download_url":"https://codeload.github.com/joshuatvernon/cbf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247531026,"owners_count":20953884,"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":["cbf","cli","command","commands","json-script","runner","runners","script","scriptrunner","scripts","yaml-script"],"created_at":"2024-08-01T15:03:12.951Z","updated_at":"2025-04-06T18:31:49.487Z","avatar_url":"https://github.com/joshuatvernon.png","language":"JavaScript","funding_links":["https://patreon.com/joshuatvernon"],"categories":["JavaScript","Other"],"sub_categories":[],"readme":"# [CBF](https://joshuatvernon.github.io/cbf-site/) 🦥\n\n![cbf sloth](images/sloth.png)\n\n[![npm version](https://badge.fury.io/js/cbf.svg)](https://badge.fury.io/js/cbf) [![Build Status](https://travis-ci.com/joshuatvernon/cbf.svg?branch=master)](https://travis-ci.com/joshuatvernon/cbf) [![vulnerabilities](https://snyk.io/test/github/joshuatvernon/cbf/badge.svg)](https://snyk.io/test/github/joshuatvernon/cbf)\n\n**CBF** 🦥is a simple CLI tool for developers who _can't be f#@!'d_ learning or remembering all the commands they have to run day to day or just in a specific repo.\n\n![demo](images/demo.gif)\n\nDevelopers build scripts that can either be saved directly to **CBF** or loaded on the fly from a local `cbf.yml` file. The script will then serve as living, breathing runnable documentation for new starters, infrequent contributors or just developers who _can't be f#@!'d_ learning or remembering all the commands.\n\nCheck out the [wiki](https://github.com/joshuatvernon/cbf/wiki) to get started!\n\n## Installation\n\n```sh\nnpm i cbf -g\n```\n\nor\n\n```sh\nyarn global add cbf\n```\n\n## Scripts\n\n### Simple scripts\n\n**CBF** simple scripts can be stored as `json` or `yaml` files but must end with either `.simple.json` or `.simple.yml` so **CBF** knows to parse them differently than advanced scripts.\n\nSimple scripts are made up of _options_ and _commands_.\n\n1. The first tag is required and is the scripts name\n2. _options_ are stored as keys\n3. _commands_ are stored as values\n\n_Note: If you would like to customise_ `directories`, `messages` _or_ `variables` _passed to_ each `command` _please use [advanced scripts](#advanced-scripts)._\n\n#### Example simple yaml script\n\n```yaml\nhello:\n  world: \"echo 'Hello, world!'\"\n  mars: \"echo 'Hello, mars!'\"\n  jupiter: \"echo 'Hello, jupiter!'\"\n```\n\n#### Example simple json script\n\n```json\n{\n  \"hello\": {\n    \"world\": \"echo 'Hello, world!\",\n    \"mars\": \"echo 'Hello, mars!\",\n    \"jupiter\": \"echo 'Hello, jupiter!\"\n  }\n}\n```\n\nYou can fine more example simple scripts [here](./examples/simple).\n\n### Advanced scripts\n\n**CBF** advanced scripts can be stored as `json` or `yaml` files. Advanced scripts are made up of `options`, `command`, `variables`, `message` and `directory` tags that are used to construct the layout of the script.\n\n1. The first tag is required and is the scripts name\n2. `options` tags are used to store lists of more `options` or `command`'s\n3. `command` tags are used to store one or many strings containing shell commands\n4. `variables` tags are used to prompt the user for variables to be replaced in a command\n5. `message` tags are used to store messages that are printed to stdout when an option or command is selected\n6. `directory` tags are used to set where a command should be ran. When a command is ran, **CBF** recursively searches for the commands set directory or closest set parent `directory` tag\n\n#### Example advanced yaml script\n\n```yml\nexample-project:\n  message: 'Run, build or test example project?'\n  directory: '~/projects/example'\n  options:\n    run:\n      message: 'Running example project...'\n      command: 'yarn start'\n    build:\n      directory: '~/projects/example/src'\n      message: 'Building example project...'\n      command: 'yarn install'\n    test:\n      message: 'Run unit or integration tests?'\n      options:\n        unit:\n          message: 'Running example project unit tests'\n          command: 'yarn test:unit'\n        integration:\n          message: 'Running example project integration tests'\n          command: 'yarn test:integration'\n```\n\n#### Example advanced json script\n\n```json\n{\n  \"example-project\": {\n    \"message\": \"Run, build or test example project?\",\n    \"directory\": \"~/projects/example\",\n    \"options\": {\n      \"run\": {\n        \"message\": \"Running example project...\",\n        \"command\": \"yarn start\"\n      },\n      \"build\": {\n        \"directory\": \"~/projects/example/src\",\n        \"message\": \"Building example project...\",\n        \"command\": \"yarn install\"\n      },\n      \"test\": {\n        \"message\": \"Run unit or integration tests?\",\n        \"options\": {\n          \"unit\": {\n            \"message\": \"Running example project unit tests\",\n            \"command\": \"yarn test:unit\"\n          },\n          \"integration\": {\n            \"message\": \"Running example project integration tests\",\n            \"command\": \"yarn test:integration\"\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nYou can fine more example advanced scripts [here](./examples/advanced).\n\n## Local CBF file\n\nCommit a `cbf.yml` to your repository so developers can run `cbf` or `cbf -d` to easily run and view commands related to the repository.\n\n## Package.json\n\n_Can't be f#@!'d_ writing a **CBF** script? Well guess what? You can just run `cbf` or `cbf -d` to easily run and view commands saved in the `scripts` section of your repos `package.json` file.\n\n_Note: If there is a local `cbf.yml` file it will always instead of a `package.json` file when just using `cbf` or `cbf -d`. However, you can manually choose to run the `scripts` from a `package.json` by running `cbf -j` or `cbf -dj`._\n\nAdditionally, you can filter out props by passing a comma separated list of property keys e.g.\n\n```sh\ncbf -j preinstall,postinstall\n```\n\n## Usage\n\n```text\nλ cbf -h\n\nUsage: cbf [options]\n\ncbf is a simple CLI tool for developers who can't be f#@!'d learning or remembering commands.\n\nGo to https://github.com/joshuatvernon/cbf to learn how to make cbf scripts.\n\nOptions:\n  -V, --version                       output the version number\n  -D, --delete [script name]          delete a previously saved script\n  -A, --delete-all                    delete all previously saved scripts\n  -d, --documented                    prepends the command to the questions when running a script\n  -R, --dry-run                       prints the command that would have been run to stdout\n  -j, --json [comma separated props]  run scripts in a package json file\n  -l, --list                          list previously saved scripts\n  -N, --npm-alias                     set an alias that should be ran instead of npm when running scripts in a package json\n  -p, --print [script name]           print a saved script\n  -r, --run [script name]             run a previously saved script\n  -s, --save \u003cpath to script file\u003e    process and save a script from a yaml or json file\n  -S, --shell                         set which shell commands should be run within\n  -h, --help                          output usage information\n```\n\n## Copyright\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshuatvernon%2Fcbf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoshuatvernon%2Fcbf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoshuatvernon%2Fcbf/lists"}