Home

Awesome

all-shields-cli

🦌 all-shields-cli - badges generator

<!-- all-shields/header-badges:START -->

v2.0.2 License: MIT Language: TypeScript ECMAScript: 2019 Discord Server

<!-- all-shields/header-badges:END -->

Tool to help automate your badges of shields.io, badgen.net, fury.io, github action and snyk.io from .all-shieldsrc dotfile for your markdown files. You can use Liquid variables like {{name}} or {{version}} which refer to your package.json. Inspired by all-contributors-cli

🎁 Support: Donate

This project is free, open source and I try to provide excellent free support. Why donate? I work on this project several hours in my spare time and try to keep it up to date and working. THANK YOU!

<!-- all-shields/sponsors-badges:START -->

Donate Paypal Donate Ko-Fi Donate Github Sponsors Donate Patreon Donate Bitcoin Donate Ethereum

<!-- all-shields/sponsors-badges:END -->

📎 Menu

💡 Features

👔 Screenshot

all-shields-cli

🚀 How to use

🔧 Installation

  1. In your node project run: npm install @ptkdev/all-shields-cli --save-dev
  2. In your package.json add script:
	...
	"scripts": {
		"all-shields-generate": "all-shields-cli"
	}
	...
  1. Create .all-shieldsrc and paste sample:
{
	"files": ["README.md"],
	"shields": [
		{
			"id": "my-badges",
			"badges": [
				{
					"url": "https://www.npmjs.com/package/@ptkdev/all-shields-cli",
					"color": "#D3D3D3",
					"label": "package name",
					"title": "package name",
					"message": "{{name}}",
					"style": "flat",
					"logo": "",
					"platform": "shields"
				}
			]
		}
	]
}
  1. Add in your README.md the html comment (my-badges is id from the previous step):
<!-- all-shields/my-badges:START -->
<!-- all-shields/my-badges:END -->
  1. Run npm run all-shields-generate

See folder examples, run with npm run example. Below is available a description of options values.

⚙️ CLI
  1. Install cli package globally: npm install @ptkdev/all-shields-cli -g
  2. Run anywhere: all-shields-cli

You can use npx, example: npx @ptkdev/all-shields-cli

🔑 Liquid variables

In your .all-shieldsrc dotfile you can use liquid variables like {{name}} or {{version}} which refer to your package.json. Key of package.json is name of liquid variable {{key_from_package.json}}

🐶 Work with Husky

  1. In your node project run: npm install husky --save-dev (docs)
  2. Setup husky with: npx husky install
  3. Add hook: npx husky add .husky/pre-commit "npm run all-shields-generate"

🧰 Options: Badges Array

ParameterDescriptionValuesDefault valueAvailable on platformsAvailable since
platformDefine platformdiscord / shields / fury / snyk / badgen / githubshieldsv1.0.0
customSet custom string of image url (appended after domain url of badge service)stringemptydiscord, shields, fury, snyk, badgen, githubv1.1.0
urlIf you click on badge open this urlURIemptydiscord, shields, fury, snyk, badgen, githubv1.0.0
colorBadge hexcode color (right side). NOTE: Overwrited if custom is set.string / hexcodelightgrayshields, badgenv1.0.0
labelBadge text (left side). NOTE: Overwrited if custom is set.stringemptyshields, badgenv1.0.0
titleMouse hover alt textstringemptydiscord, shields, fury, snyk, badgen, githubv1.0.0
messageBadge text (right side). NOTE: Overwrited if custom is set.stringemptydiscord, shields, fury, snyk, badgen, githubv1.0.0
styleLook of badge. NOTE: Overwrited if custom is set.plastic / flat / flat-square / for-the-badge / socialflatshieldsv1.0.0
logoShow logo (left side). NOTE: Overwrited if custom is set.shields: bitcoin , dependabot , discord , gitlab , npm , paypal , serverfault , stackexchange , superuser , telegram , travis and more on docs. <br><br> badgen: airbnb, apple, appveyor, atom, awesome, azure, azurepipelines, bitcoin, buymeacoffee, chrome, circleci, cocoapods, codacy, codebeat, codeclimate, codecov, codeship, commonwl, deepscan, dependabot, discord, dockbit, docker, eclipse, firefox, flow, git, github, gitlab, gitter, googleplay, graphql, haskell, jsdelivr and more on docsemptyshields, badgenv1.0.0
server_idif platform is discord, set your discord server_idDISCORD_SERVER_IDemptydiscordv1.0.0

🔨 Developer Mode

🏁 Run Project

  1. Clone this repository or download nightly, beta or stable.
  2. Run npm run init
  3. Run npm run build && npm run link (unix require sudo)
  4. Run all-shields-cli anywhere for execute command line tool

or run npm run dev for watch mode.

📚 Documentation

Run npm run docs

👑 Backers and Sponsors

Thanks to all our backers! 🙏 Donate 3$ or more on paypal, ko-fi, github or patreon and send me email with your avatar and url.

👨‍💻 Contributing

I ❤️ contributions! I will happily accept your pull request! Translations, grammatical corrections (GrammarNazi you are welcome! Yes my English is bad, sorry), etc... Do not be afraid, if the code is not perfect we will work together 👯 and remember to insert your name in .all-contributorsrc and package.json file.

Thanks goes to these wonderful people (emoji key):

<!-- ALL-CONTRIBUTORS-LIST:START --> <!-- prettier-ignore-start --> <!-- markdownlint-disable --> <table> <tr> <td align="center"><a href="https://ptk.dev"><img src="https://avatars1.githubusercontent.com/u/442844?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Patryk Rzucidło</b></sub></a><br /><a href="https://github.com/ptkdev/ptkdev/all-shields-cli/commits?author=ptkdev" title="Code">💻</a> <a href="#translation-ptkdev" title="Translation">🌍</a> <a href="https://github.com/ptkdev/ptkdev/all-shields-cli/commits?author=ptkdev" title="Documentation">📖</a> <a href="https://github.com/ptkdev/ptkdev/all-shields-cli/issues?q=author%3Aptkdev" title="Bug reports">🐛</a></td> <td align="center"><a href="https://github.com/di4urp"><img src="https://avatars1.githubusercontent.com/u/44859500?v=4?s=100" width="100px;" alt=""/><br /><sub><b>di4urp</b></sub></a><br /><a href="https://github.com/ptkdev/ptkdev/all-shields-cli/commits?author=di4urp" title="Code">💻</a> <a href="https://github.com/ptkdev/ptkdev/all-shields-cli/issues?q=author%3Adi4urp" title="Bug reports">🐛</a></td> </tr> </table> <!-- markdownlint-restore --> <!-- prettier-ignore-end --> <!-- ALL-CONTRIBUTORS-LIST:END -->

💰 In the future, if the donations allow it, I would like to share some of the success with those who helped me the most. For me open source is share of code, share development knowledges and share donations!

🦄 Other Projects

<!-- all-shields/projects-badges1:START -->

<!-- all-shields/projects-badges1:END --> <!-- all-shields/projects-badges2:START -->

<!-- all-shields/projects-badges2:END --> <!-- all-shields/projects-badges3:START -->

<!-- all-shields/projects-badges3:END --> <!-- all-shields/projects-badges4:START -->

<!-- all-shields/projects-badges4:END -->

💫 License

Copyleft (c) 2021 Patryk Rzucidło (@PTKDev) <support@ptkdev.io>