Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ vitest.config.ts

src
tmp
test-output
test-output

CODE_OF_CONDUCT.md
CONTRIBUTING.md
SECURITY.md
128 changes: 128 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
ribeirogabx@gmail.com.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
74 changes: 74 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Contributing to `commitfy`

Thank you for considering contributing to `commitfy`! This document provides guidelines and an overview of the project structure to help you contribute effectively.

## Project Structure

The project is organized as follows:

- **`src/`**: Contains the main source code, divided into the following subdirectories:
- **`commands/`**: Contains the command implementations that define the functionalities of `commitfy`. Each command is responsible for a specific task, such as generating a commit message, setting up the environment, or displaying help information.
- **`interfaces/`**: Defines TypeScript interfaces and types used throughout the project. This directory helps ensure type safety and consistency across different parts of the codebase.
- **`providers/`**: Contains the implementations of the AI providers supported by `commitfy`. This includes setting up connections, handling API requests, and processing responses from AI services like OpenAI.
- **`utils/`**: Includes utility functions and helpers that are used across the project. These utilities perform common tasks such as environment management, input validation, and process handling.
- **`container.ts`**: Manages dependency injection, allowing for loose coupling between components and making the system more modular and testable.
- **`constants.ts`**: Stores constant values used across the project, such as default settings or configuration keys.
- **`index.ts`**: The entry point of the application that ties together different components and initializes the command-line interface.

- **`bin/`**: Contains executable scripts that are used to run the application from the command line. This typically includes the entry point script that initializes and launches the `commitfy` CLI.
- **`tests/`**: Includes supporting files for tests. The tests themselves are located alongside the original files (e.g., `./src/utils/env.utils.ts`, `./src/utils/env.utils.spec.ts`), ensuring that each module is thoroughly tested.
- **`lib/`**: Contains the compiled version of the source code, generated after the build process. This directory is what gets executed when you run the tool in production.
- **`tmp/`**: A temporary folder used during development and testing. It may hold temporary files, logs, or other data generated during runtime.

## Labels

To help manage issues and pull requests, we use a set of labels. You can view and understand the purpose of each label by visiting the [labels page on GitHub](https://github.com/ribeirogab/commitfy/labels).

## Running Tests

To run the project's tests, use the following command:

```bash
npm test
```

## Contribution Workflow

1. **Fork the Repository**: Click the "Fork" button on the top right corner of the repository page to create a copy of the repository under your GitHub account.

2. **Create a Branch**: Create a new branch for your contribution using the following command:

```bash
git checkout -b feature/your-feature-name
```

3. **Make Changes**: Implement your changes in the newly created branch.

4. **Commit Your Changes**: Use `cfy` to generate a commit message, and then commit your changes:

```bash
git add .
cfy
```

5. **Push to Your Fork**: Push your changes to your forked repository:

```bash
git push origin feature/your-feature-name
```

6. **Open a Pull Request**: Go to the original repository and open a pull request. Be sure to include a detailed description of the changes you have made.

## Code Style and Guidelines

- Follow the existing coding style and conventions in the project.
- Ensure that your changes do not break any existing functionality or tests.
- Write clear and concise commit messages using `cfy`.

## Issues and Bugs

If you encounter any issues or bugs, feel free to [open an issue](https://github.com/ribeirogab/commitfy/issues) on GitHub. Please provide as much detail as possible to help us resolve the issue quickly.

## Thank You!

Your contributions are valuable, and we appreciate your effort in improving `commitfy`. Thank you for taking the time to contribute!
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# commitfy

> Make commits easier and faster using AI.
> Make commit messages easier and faster using AI.

## Description

`commitfy` is a tool designed to help developers generate efficient and consistent commit messages using artificial intelligence. `commitfy` ensures that your commit messages follow established standards and are clear and informative.

## Installation

Install `commitfy` globally (to use in any repository) using npm:
Install `commitfy` globally to use in any repository using npm:

```bash
npm install -g commitfy
Expand All @@ -16,15 +20,17 @@ Once installed, you can use the `commitfy` command or its alias `cfy` to interac

### Commands

#### Setup
#### Initial Setup

To perform initial setup configuration, run:
To perform the initial setup configuration, run:

```bash
cfy setup
```

#### Generate Commit
This command will guide you through the necessary setup to use `commitfy`, such as choosing the AI provider and configuring API keys.

#### Generate Commit Message

To generate a commit message using AI, simply run:

Expand All @@ -42,16 +48,22 @@ If you need assistance or want to see the available commands, run:
commitfy --help
```

## AI Providers
This command will display a list of all available commands along with detailed descriptions.

`commitfy` supports the following AI providers for generating commit messages:
## Configuration

- **OpenAI**
### Configuration Files

> **Note:** Currently, we support the above providers, but we may implement more in the future. If you have a suggestion for an AI provider, please [open an issue](https://github.com/ribeirogab/commitfy/issues).
`commitfy` uses configuration files located in the `~/.commitfy` directory to manage its settings and behavior:

## Support
- **`.env`**: This file contains all the necessary configurations for the app, such as API keys and other environment variables. You can edit this file to update your settings as needed.

- **`.commitfyignore`**: This file functions similarly to a `.gitignore` file. It is used to specify files and directories that should be ignored when generating commit messages. By customizing this file, you can control which changes are considered when `commitfy` creates a commit message.

Contact me!
## AI Providers

`commitfy` supports the following AI providers for generating commit messages:

- **OpenAI**

- E-mail <a href="mailto:ribeirogabx@gmail.com" target="_blank">`ribeirogabx@gmail.com`</a>
> **Note:** Currently, we only support OpenAI, but we plan to add more providers in the future. If you have a suggestion for an AI provider, please [open an issue](https://github.com/ribeirogab/commitfy/issues).
33 changes: 33 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Security Policy

## Supported Versions

We take security seriously and aim to ensure that `commitfy` is safe and secure for all users. Below is a list of versions of `commitfy` that are currently supported with security updates:

| Version | Supported |
| --------- | ------------------ |
| 0.2.x | :white_check_mark: |
| < 0.1.x | :x: |

## Reporting a Vulnerability

If you discover a security vulnerability within `commitfy`, we encourage you to report it as soon as possible. Please follow the steps below to report the issue:

1. **Do not** open a public issue on the repository or discuss the vulnerability in public forums.
2. Contact us directly at [ribeirogabx@gmail.com](mailto:ribeirogabx@gmail.com) with the details of the vulnerability.
3. Provide as much information as possible to help us understand and replicate the issue. This may include:
- A description of the vulnerability and its potential impact.
- Steps to reproduce the vulnerability.
- Any proof of concept code.
- Your recommendations for mitigation or remediation.

We will acknowledge receipt of your report within 48 hours and work to resolve the issue promptly. We will keep you informed of the progress and may reach out to you for further information or clarification if needed.

## Responsible Disclosure

To ensure the safety of our users, we follow a responsible disclosure process. This means that we will not disclose the details of a security vulnerability until we have had the opportunity to investigate, develop, and release a fix. We appreciate your cooperation in helping us maintain the security and integrity of `commitfy`.

## Security Updates

We will release security updates as necessary to address vulnerabilities. If a fix requires a new version of `commitfy`, we will communicate this through our regular release channels, including the project's GitHub releases page.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "commitfy",
"version": "0.2.0",
"version": "0.2.1",
"main": "lib/index.js",
"repository": "https://github.com/ribeirogab/commitfy.git",
"author": "ribeirogab <ribeirogabx@gmail.com>",
Expand Down