credit-kapp
v1.1.2
Published
π Automatically Credit your applications easily.
Downloads
24
Readme
credit-kapp - Effortless File Attribution Tool βοΈ
credit-kapp is a CLI tool designed to automatically add custom copyright and attribution messages to your project's source files. Whether you're managing open-source projects or need to quickly credit your work, credit-kapp simplifies the process by appending customized comments to files in your project.
npm i credit-kapp@latest -g
Features π
- File Commenting: Automatically add attribution comments to your project's files.
- Language Support: Supports a variety of programming languages such as JavaScript, Python, TypeScript, HTML, and more.
- Gitignore Parsing: Automatically ignores files and directories defined in
.gitignore
. - Custom Messages: Easily customize the message to include your name, GitHub handle, and a personal note.
- Force Mode: Use the
--force
flag to bypass checks and add comments even if they already exist. - Smart Insertion: Detects cases like
"use server"
and places the comment below, rather than overriding the content.
Getting Started π οΈ
Prerequisites
Installation
Clone the repository:
git clone https://github.com/kars1996/credit-kapp.git cd credit-kapp-cli
Install the required dependencies:
npm install
Compile the TypeScript code:
npm run build
Optionally, link the CLI globally (recommended for easier access):
npm link
Usage
Once installed, you can use credit-kapp to add comments to your project's files:
Start the CLI by running:
credit-kapp
Follow the prompts to enter your name, GitHub handle, and custom message.
Provide the directory path, and credit-kapp will handle the rest, appending comments to all valid files.
Options
--force
: Use this flag to bypass checks and add comments even if comments already exist in the files.credit-kapp --force
File Structure
credit-kapp-cli/
βββ src/
β βββ utils.ts # Utility functions for file parsing and operations.
β βββ ui.ts # Custom UI elements and interactions.
β βββ index.ts # Main CLI logic and user input handling.
β βββ types.ts # Type definitions used throughout the project.
βββ package.json # NPM dependencies and scripts.
βββ tsconfig.json # TypeScript configuration.
βββ README.md # Project documentation (you are here).
Customizing Messages π§©
credit-kapp allows for customization of the messages added to your files:
- In the CLI, follow the prompt to input your custom copyright message.
- To further extend credit-kapp, you can modify the logic in
src/index.ts
to support additional languages or customize the output format.