Skip to content

Commit 8b4a10e

Browse files
authored
docs: add integration instructions for Lazygit and other tools (#3)
1 parent 4c92191 commit 8b4a10e

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,51 @@ CFME_DEFAULT_PROMPT_VARIABLES_FILE_FETCH_URL
416416
it does not exist locally.
417417
```
418418
419+
## Integration into other tools
420+
421+
### Lazygit
422+
423+
[Lazygit](https://github.com/jesseduffield/lazygit) is awesome.
424+
But `cfme` allows you to be even lazier! You can use `cfme`
425+
from within Lazygit's TUI to generate commit messages.
426+
427+
Just add the following custom command to your Lazygit config file
428+
(e.g. `~/.config/lazygit/config.yml`):
429+
430+
```yaml
431+
customCommands:
432+
- key: "<c-a>"
433+
description: "generate commit message for staged files using ai-commits"
434+
command: "cfme"
435+
context: "files"
436+
loadingText: "Generating commit message with cfme..."
437+
subprocess: true
438+
```
439+
440+
And now, use lazygit to stage your changes, then just press `Ctrl+a`
441+
to run `cfme` and generate a commit message for the staged changes!
442+
443+
### Other tools
444+
445+
As `cfme` is just a bash script, you can easily integrate it into
446+
other tools and workflows.
447+
Have a look at the [Lazygit](#lazygit) section above for an example
448+
of how to do this.
449+
450+
The `-r` and `-m` flags are especially interesting for integration
451+
into other tools, as they allow you to pipe the AI-generated
452+
response or the reviewed commit message into other tools, instead
453+
of committing it directly.
454+
455+
The `-p` and `-v` flags allow you to specify custom prompt
456+
and variables files, which is useful if you want to have
457+
different prompts for different workflows.
458+
459+
I'm sure you can come up with many more use cases!
460+
If you ever get stuck integrating `cfme` into your workflow,
461+
or if you need an additional feature to make the integration easier,
462+
feel free to ask for help. Just open up an issue!
463+
419464
## Contributing
420465
421466
If you would like to contribute to this project, you're more than welcome

0 commit comments

Comments
 (0)