gfargo / coco Goto Github PK
View Code? Open in Web Editor NEWAI-powered Git Assistant for CLI
Home Page: https://git-co.co/
License: MIT License
AI-powered Git Assistant for CLI
Home Page: https://git-co.co/
License: MIT License
Allow coco
to summarize the details of the last day or X number of days of development within a repository.
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:
... 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:
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'
Due to the rapid development of features, README.md
unfortunately no longer accurately documents all of the options within coco
Things to add:
model
optionmodel
in coordination with API key variableshuggingface
instead of openai
Tracking issue for:
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.
While amazingly powerful, nodegit
provides a huge barrier to adoption by creating ridiculously long install times and external dependency on libgit2
.
Possible alternatives:
simple-git
- https://github.com/steveukx/git-jsisomophic-git
- https://github.com/isomorphic-git/isomorphic-gitWould 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
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.
Tracking issue for:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.