Download the PHP package wp-forge/wp-cli-forge-command without Composer

On this page you can find all versions of the php package wp-forge/wp-cli-forge-command. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-cli-forge-command

WP Forge Command

A zero-configuration scaffolding tool for WordPress built as a WP-CLI package.

Installation

  1. Install WP-CLI

  2. Install this WP-CLI package:

Usage

From your project root, run the init command to set up a project-level configuration file.
*Technically, this step is optional. However, it helps to eliminate some prompts as you run make commands.

Run the make command to scaffold a new entity such as a plugin, theme, etc.

Advanced Usage

Clone a Git repository containing scaffolding templates so they will be locally available to the tool.

When cloning a repository, you can optionally provide a name. This allows you to utilize multiple repositories containing scaffolding templates from various sources. If you do not set a name, the system will use the name "default" automatically.

To scaffold using a template from a named repository, just prefix the entity name with your custom namespace.

For example, if you set the name to be company, and you wanted to scaffold a wp-plugin, then you would run this command:

This will ensure that the repository containing the company templates will be checked for the wp-plugin scaffolding. In the event that you have multiple template sources configured and the requested template cannot be found under the requested namespace, the tool will ask you if you want to check the other template sources for that template.

You can also use a path to leverage templates found nested in other folders.

The above command would look in the ~/.wp-cli/templates/company folder for the template in the github-actions/lint-php directory.

Documentation

All commands are self-documented by the tool. Simply type an available command followed by the --help flag for more details.

Get high-level documentation on available commands:

Get documentation for a specific command:

Scaffolding Templates

In order to use this tool, you must first have a Git repository where you will host your scaffolding templates.

Let's get started!

Step 1: Create a new Git repository.

Step 2: Create a folder in the repository for each thing you will want to scaffold. The name of the folder is the name you will use with the make command.

Examples of things you might want to scaffold:

Step 3: Make sure you have a config.json file in the template folder. This will tell the CLI what to do with your template.

Config Examples

A simple config.json file might look like this:

This would copy the lint-php.yml file from the template folder to the .github/workflows/lint-php.yml file relative to the project root. You can provide multiple copy directives to copy not only files, but also entire directories. If you want the path to be relative to the current directory where the CLI tool is being run, then just leave off the relativeTo property or set its value to workingDir.

It is very common that you will want to replace placeholders in your templates. To facilitate this, you must first collect the required information from the user.

You can add a prompts section to trigger these data requests in the CLI:

With these prompts defined, you can now use the name field as a Mustache placeholder in any template file. You can also reference the name of any property from the project configuration file in your templates without needing to prompt the user.

You can have a template leverage other templates by using the runCommand directive and calling the make command:


All versions of wp-cli-forge-command with dependencies

PHP Build Version
Package Version
Requires wp-forge/wp-scaffolding-tool Version ^1.1.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wp-forge/wp-cli-forge-command contains the following files

Loading the files please wait ....