Skip to content

uFloppyDisk/create-cssharp-plugin

Repository files navigation

Create CounterStrike Sharp Plugin

Bootstrap your CounterStrike Sharp plugin project in no time at all!

create-cssharp-plugin offers a mighty fine project template to get you started quickly.

Features

  • Generates a .sln file with your .csproj already referenced*
  • Bootstraps a .cs entry file with Module(.*) fields populated based on input
  • Initializes a git repository and stages the project for you
  • Comes with a complementary .gitignore out of the box!

* dotnet CLI must be installed

Planned and potential features

  • Unit test template
  • Opinionated project structure (directories for commands, hooks, etc.)
  • GitHub actions release workflow (build plugin and generate GH release with plugin artifacts attached)

Prerequisites

NodeJS (v20 recommended)

You can get NodeJS by going to their website and selecting your OS, node version, and package manager.
https://nodejs.org/en/download

dotnet CLI [optional]

The dotnet CLI should come with .NET SDK.
Install .NET SDK
Linux - Windows

Learn more: https://learn.microsoft.com/en-us/dotnet/core/tools/

Installation

Run using your favourite package manager:

npm

Run on-demand via npm:

npx create-cssharp-plugin

OR install as a command globally:

npm install -g create-cssharp-plugin
create-cssharp-plugin
yarn

Run on-demand via yarn:

yarn exec create-cssharp-plugin

OR install as a command globally:

yarn global add create-cssharp-plugin
create-cssharp-plugin
pnpm

Run on-demand via pnpm:

pnpm dlx create-cssharp-plugin

OR install as a command globally:

pnpm add -g create-cssharp-plugin
create-cssharp-plugin

Usage

Interactive prompts

Create your CounterStrikeSharp plugin project using interactive step-by-step prompts in your terminal.

Run create-cssharp-plugin with no arguments to enter interactive mode and follow the prompts.
ex. npx create-cssharp-plugin

Command-line arguments

Generate your CounterStrikeSharp plugin project directly from the command line.

Tip

View CLI options and usage help by passing -h or --help

Generate a project named "example"

create-cssharp-plugin example

Generate a project with a different plugin name(space).

create-cssharp-plugin -p differentName example

Generate a project with an author and description

create-cssharp-plugin -a JohnCSSharp -d "It's CSSharping time" example

Note

If you specify a project directory as the first positional argument when running create-cssharp-plugin, all interactive prompts will be skipped and defaults will apply.

Enter interactive mode after passing arguments

Show prompts and skip those set via arguments:
create-cssharp-plugin -i example

Forcibly show all prompts with initial values populated from arguments:
create-cssharp-plugin -I example

More CLI option recipes

Say yes to all default build tasks (ex. git init) and ask remaining prompts interactively:
create-cssharp-plugin -yi example
create-cssharp-plugin -yip differentName example

Project Structure

Projects generated using create-cssharp-plugin have the following structure:

./projectName
├── projectName.sln
├── src
│   ├── pluginName.cs
│   └── pluginName.csproj
└── test

Note

create-cssharp-plugin will create a project directory relative to your current working directory.

Contributing

  1. Clone this repository
git clone https://github.com/uFloppyDisk/create-cssharp-plugin.git
cd create-cssharp-plugin
  1. Install dependancies
npm install
  1. Open another shell and watch for changes
npm run dev
  1. Run the CLI
npx .

When running the CLI this way, all plugin projects will be placed in the .playground directory to avoid mixing with the rest of your filesystem and this repo's files.

About

Generate a CounterStrike Sharp plugin project

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •