
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
cli-typescript-starter
Advanced tools
`cli-typescript-starter` is a simple and efficient tool that enables you to quickly create command-line applications using TypeScript. With its well-structured codebase and robust features, it provides an easy-to-use interface for developing and testing y
An all-inclusive starter kit for crafting command-line interfaces (CLI) using TypeScript, driven by Node.js. This kit is meticulously designed to kick-start your development journey with a solid foundation, encompassing features such as argument parsing, environment setup, logging, testing suites, as well as code formatting and linting capabilities.
This template incorporates several key tools and libraries to enhance your CLI development experience:
.env
file into process.env
,
making it easy to manage application configuration.Before you begin, ensure you have installed Node.js and pnpm on your system.
To start using this CLI TypeScript starter, follow these steps:
npx cli-typescript-starter create my-project
or
npx giget@latest gh:kucherenko/cli-typescript-starter my-project
or
pnpm exec degit kucherenko/cli-typescript-starter my-project
Navigate to your project directory and install the necessary dependencies:
cd my-project && pnpm install
Update the package.json
to reflect your project's details:
"name": "my-project",
"bin": {
"my-project": "./bin/run"
}
Create a .env
file in the root directory and configure your environment variables as needed.
This starter comes equipped with several predefined scripts to facilitate development, alongside sample commands to demonstrate the capabilities of the CLI application.
pnpm start [command name]
to run any command. This utilizes ts-node
for a seamless
development experience.my-project [command name]
to run the desired
command from the built project (the name of command should be provided in package.json
in bin
).info
: Prints information about the current system and Node.js configuration. This command is useful for
verifying the environment in which the CLI is running.greeting
: Demonstrates interactive prompts within the CLI. It's a great way to see how user inputs can be
handled in a friendly manner.create
: Create new project based on cli-typescript-starter
.All commands are located in the src/commands/
folder. This organization makes it easy to find and modify commands or
add new ones as needed.
This starter comes with several predefined scripts to help with development:
pnpm build
- Build the project using tsup
.pnpm build:watch
- Automatically rebuild the project on file changes.pnpm commit
- run commitizen
tool for helping with commit messages.pnpm commitlint
- lint commit messages.pnpm compile
- Compile TypeScript files using tsc
.pnpm clean
- Remove compiled code from the dist/
directory.pnpm format
- Check files for code style issues using Prettier.pnpm format:fix
- Automatically fix code formatting issues with Prettier.pnpm lint
- Check code for style issues with ESLint.pnpm lint:fix
- Automatically fix code style issues with ESLint.pnpm start [command]
- Run the CLI application using ts-node
.pnpm start:node [command]
- Run the CLI application from the dist/
directory.pnpm test
- Run unit tests.pnpm test:watch
- Run tests and watch for file changes.This project utilizes semantic-release
to automate version management and the NPM publishing
process. Semantic-release
automates the workflow of releasing new versions, including the generation of detailed
release notes based on commit messages that follow the conventional commit format.
The publishing process is triggered automatically when changes are merged into the main branch. Here's how it works:
semantic-release
determines the type of version change (
major, minor, or patch) and updates the version accordingly.semantic-release
publishes the new version to the NPM registry and creates a GitHub
release with the generated notes.To ensure a smooth semantic-release
process:
semantic-release
accurately determine version changes and generate
meaningful release notes.NPM_TOKEN
for authentication during the publication
process.By integrating semantic-release
, this project streamlines its release process, ensuring that versions are managed
efficiently and that users are well-informed of each update through automatically generated release notes.
To contribute to this project or customize it for your needs, consider the following guidelines:
commitizen
and commitlint
to ensure our commit messages are consistent and follow the
conventional commit format, recommended by @commitlint/config-conventional
. To make a commit, you can
run pnpm commit
, which will guide you through creating a conventional commit message..env
file for local development. For production, ensure you configure the
environment variables in your deployment environment.commitlint
.Contributions are welcome! If you'd like to improve this CLI TypeScript starter, please follow the standard fork-and-pull request workflow. Here are a few guidelines to keep in mind:
commitizen
and commitlint
with
the @commitlint/config-conventional
configuration, enforced by Husky git hooks.By adhering to these guidelines, you help maintain the quality and consistency of the project, making it easier for others to contribute and for users to understand and utilize the project effectively.
This project is licensed under the MIT License - see the LICENSE file for details.
Andrey Kucherenko
Happy Coding!
FAQs
`cli-typescript-starter` is a simple and efficient tool that enables you to quickly create command-line applications using TypeScript. With its well-structured codebase and robust features, it provides an easy-to-use interface for developing and testing y
The npm package cli-typescript-starter receives a total of 4 weekly downloads. As such, cli-typescript-starter popularity was classified as not popular.
We found that cli-typescript-starter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.