The Package Skeleton CLI is a command-line interface that allows you to initialize a PHP package skeleton by replacing all the placeholders in the files with the values you provide.
⚠️ The CLI only works on macOS 🤷♂️
Using cURL:
curl -L "https://github.com/coyotito-mx/package-skeleton-cli/releases/download/v0.0.3/skeleton" -o skeleton
chmod +x skeletonUsing wget:
wget "https://github.com/coyotito-mx/package-skeleton-cli/releases/download/v0.0.3/skeleton" -O skeleton
chmod +x skeletonThen you can move the binary to the desired location and use it.
⚠️ To use the CLI, you must have a package skeleton with the placeholders you want to replace, or you could call the command with the option--bootstrap=and one of the valid templates to bootstrap (vaniall,laravel).
The placeholders must be written in the following format: {{placeholder}}. You can use modifiers with the placeholders to format the values before replacing them. The modifiers must be written in the following format:
{{placeholder|modifier[,modifier]}}This command will bootstrap a Laravel Project using the laravel template from one of our template skeletons.
skeleton init \
asciito \
acme \
"This is a sample package" \
--author="John Doe" \
--email="[email protected]" \+
--license=MIT \
--namespace="Asciito\\Acme" \
--package-version=v1.0.0 \
--minimum-stability=stable \
--type=library \
--path="$HOME"
--bootstrap=laravelThe available placeholders (replacers):
vendorpackagenamespacedescriptionauthoremail(Author's email)package-versionminimum-stabilitylicense(package license: MIT)type(package type: library, project, metapackage, composer-plugin, etc.)- More placeholders will be added in the future.
Global modifiers:
upper(converts the value to uppercase)lower(converts the value to lowercase)ucfirst(converts the first character to uppercase)title(converts the value to title case)studly(converts the value to studly case)camel(converts the value to camel case)slug(converts the value to slug case)snake(converts the value to snake case)kebab(converts the value to kebab case)plural(converts the value to plural)reverse(reverses the value)
⚠️ Beware, the order is important, calling a modifier like<placeholder>|upper,slugmight not be what you want.For example, the value
John Doecould be:{{author|upper,slug}} → john-doeInstead. you must use then in the following order:
{{author|slug,upper}} → JOHN-DOE
Modifiers by Replacer:
Namespaceescape(escapes thenamespaceseparator\to\\)reverse(reverses thenamespaceseparator)
skeleton init [options] [--] <vendor> <package> <description>
Options:
--namespace=NAMESPACE The namespace of the package
--author[=AUTHOR] The author of the package
--email=EMAIL The email of the author
--minimum-stability=MINIMUM-STABILITY The minimum stability allowed for the package [default: "dev"]
-b, --bootstrap=BOOTSTRAP Bootstrap a package using a template (vanilla, laravel)
--type[=TYPE] The package type [default: "library"]
--package-version=PACKAGE-VERSION The package version [default: "0.0.1"]
--replace-license Force replace the `LICENSE.md` file
--skip-license-generation Skip license generation
--dir[=DIR] The excluded directories (multiple values allowed)
--file[=FILE] The excluded files (multiple values allowed)
--path[=PATH] The path where the package will be initialized
--confirm Skip the confirmation prompt
-d, --do-not-install-dependencies Do not install the dependencies after initialization
-s, --no-self-delete Do not delete the CLI after initialization finishedIf you would like to contribute to the Skeleton CLI, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Make your changes.
- Submit a pull request.
The Skeleton CLI is open-sourced software licensed under the MIT license.