inc/IssueTemplateCommand.php
public function generate_issue_template( $args, $assoc_args ) {
		$slug = $args[0];
		$assoc_args = array_merge( [], $assoc_args );

		$assoc_args['slug'] = $slug;

		if ( ! empty( $assoc_args['dir'] ) ) {
			$dir = $assoc_args['dir'];
		} else {
			$dir = WP_CONTENT_DIR . '/' . $assoc_args['type'] . 's/' . $assoc_args['slug'];
		}

		foreach ( $assoc_args as $key => $value ) {
			$assoc_args[ 'has_' . $key ] = ! empty( $value );
		}

		$force = Utils\get_flag_value( $assoc_args, 'force' );
		$type = $assoc_args['type'];
		$package_root = dirname( dirname( __FILE__ ) );
		$template_path = $package_root . '/templates/issue-template';
		$files_written = $this->create_files( array(
			"{$dir}/.github/ISSUE_TEMPLATE.md"  => Utils\mustache_render( "{$template_path}/{$assoc_args['type']}.mustache", $assoc_args ),
		), $force );

		if ( empty( $files_written ) ) {
			WP_CLI::log( 'No issue template created.' );
		} else {
			WP_CLI::success( 'Created issue template for ' . $assoc_args['owner'] . '/' . $assoc_args['slug'] . '.' );
		}
	}
public function generate_issue_template( $args, $assoc_args ) {
		$slug = $args[0];
		$assoc_args = array_merge( [], $assoc_args );

		$assoc_args['slug'] = $slug;

		if ( ! empty( $assoc_args['dir'] ) ) {
			$dir = $assoc_args['dir'];
		} else {
			$dir = WP_CONTENT_DIR . '/' . $assoc_args['type'] . 's/' . $assoc_args['slug'];
		}

		foreach ( $assoc_args as $key => $value ) {
			$assoc_args[ 'has_' . $key ] = ! empty( $value );
		}

		$force = Utils\get_flag_value( $assoc_args, 'force' );
		$type = $assoc_args['type'];
		$package_root = dirname( dirname( __FILE__ ) );
		$template_path = $package_root . '/templates/issue-template';
		$files_written = $this->create_files( array(
			"{$dir}/.github/ISSUE_TEMPLATE.md"  => Utils\mustache_render( "{$template_path}/{$assoc_args['type']}.mustache", $assoc_args ),
		), $force );

		if ( empty( $files_written ) ) {
			WP_CLI::log( 'No issue template created.' );
		} else {
			WP_CLI::success( 'Created issue template for ' . $assoc_args['owner'] . '/' . $assoc_args['slug'] . '.' );
		}
	}
Generate an issue template for a Pressbooks theme or plugin, placing it in .github/ISSUE_TEMPLATE.md.

## OPTIONS

<slug>
: Slug for the theme or plugin (e.g. pressbooks, pressbooks-book).

--type=<type>
: The type of repo for which we're generating an issue template. Must be `theme` or `plugin`.

--owner=<owner>
: The GitHub username of this repo's owner (e.g. pressbooks).

[--dir=<dir>]
: Specify a destination directory for the command. Defaults to the theme or plugin's directory.

[--force]
: Overwrite files that already exist.

@when after_wp_load