GithubHelp home page GithubHelp logo

gfargo / coco Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 0.0 890 KB

AI-powered Git Assistant for CLI

Home Page: https://git-co.co/

License: MIT License

TypeScript 97.66% JavaScript 2.34%
cli coco git git-commit langchain node commit-copilot

coco's People

Contributors

dependabot[bot] avatar gfargo avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

coco's Issues

Config option to change what editor is used by `@inquirer/editor`

From the docs, when using the editor prompt from @InQuirer package:

Launches an instance of the users preferred editor on a temporary file. Once the user exits their editor, the content of the temporary file is read as the answer. The editor used is determined by reading the $VISUAL or $EDITOR environment variables. If neither of those are present, the OS default is used (notepad on Windows, vim on Mac or Linux.)

This is complete when:

  • There is a config option to control the default editor to open

... could also take a look at using the postfix option inside of our editor calls:

postfix string no (default toΒ .txt) The postfix of the file being edited. Adding this will add color highlighting to the file content in most editors.

Resources:

Add option to "append" string into prompt or generated commit

Allow users to either append or insert custom text into either the prompt or the generated commit messages. Below are two possible new options that could be added to coco πŸ’­

additional

Add extra contextual information to the prompt before requesting completion from the LLM.

# Passed into the prompt
coco --additional 'updated project aliases to use new "~" symbol'

append

Add content to commits necessary for automation/integration

# Appended to end of generated message 
coco --append 'resolves #2'

Update `README.md` to include new options

Due to the rapid development of features, README.md unfortunately no longer accurately documents all of the options within coco

Things to add:

  • Documentation of the model option
  • Explain using model in coordination with API key variables
  • Note all ENV API key names match the key outlined in LangChain docs
  • Config example that uses huggingface instead of openai

Add support for conventional commits

It is a relatively trivial task to create a new prompt to handle generating conventional commits.

We'll need to verify that generated messages adhere to the conventional commit rules within the repository. Leveraging a tool like commitlint (#20) would make this a breeze.

Add support for `commitlint`

Would be awesome if coco could incorporate any rules or validation enforced by commitlint

// commitlint.config.js
module.exports = {
  extends: ['@commitlint/config-conventional'], // => @commitlint/config-conventional
};

If the message fails commitlint the resulting errors should be passed back into the prompt for consideration when regenerating.

e.g

# Lint from stdin
echo 'foo: bar' | commitlint
β§—   input: foo: bar
βœ–   type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] [type-enum]

βœ–   found 1 problems, 0 warnings
β“˜   Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint

Issue with approving commit message in interactive mode

When using coco -i and then choosing 'Looks Good' to continue I get a crash like the following:

? Would you like to make any changes to the commit message? ✨ Looks good!                                                     
TypeError: Cannot read properties of undefined (reading 'default')
    at createCommit (/home/user/.nvm/versions/node/v18.16.1/lib/node_modules/git-coco/dist/index.js:895:55)
    at main (/home/user/.nvm/versions/node/v18.16.1/lib/node_modules/git-coco/dist/index.js:1087:23)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Seems like this is failure is occurring here: https://github.com/GFargo/coco/blob/e0e7b4b500f0052c42ac8d3330e2cc0df26f3540/src/lib/utils/git/createCommit.ts#L7

Note: I had the package installed globally for this and not installed as part of the local repo.

  • OS: Ubuntu 20.04
  • Node Version: v18.16.1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.