GithubHelp home page GithubHelp logo

jessejay-ch / devchat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from devchat-ai/devchat

0.0 0.0 0.0 1.3 MB

AI coding assistant with human in the loop. Not yet another experiment. True productivity.

Home Page: https://www.merico.dev

License: Apache License 2.0

Shell 0.49% Python 99.51%

devchat's Introduction

devchat

DevChat

๐Ÿ‘‰ For an enhanced experience and UI, we welcome you to install Visual Studio Code extension from Visual Studio Marketplace! Enjoy DevChat VSCode! ๐Ÿ‘

PRs Welcome CircleCI GitHub license Downloads PyPI version Discord Chat

The AI Coding Assistant Made Effective by Manual Control

๐Ÿ› ๏ธ No excessive automation, just right AI where it works.

โ˜• Simple to use, without complicated prompt engineering.

๐Ÿป Designed for extensibility.

What is DevChat?

DevChat is an open-source platform that empowers developers to more effectively integrate AI into code generation and documentation. DevChat aims to go beyond simple code auto-completion and limited operations on code snippets. DevChat offers a highly practical and effective way for developers to interact and collaborate with large language models (LLMs).

Why DevChat?

While there are many AI coding tools available, we developed DevChat based on our practical insights from generating tens of thousands of lines of code. DevChat makes the following distinctive design choices:

  • Precise manual control over the context embedded in a prompt. Precise control over context is the key to effective AI use. We find that most other "intelligent" or "automatic" tools tend to over-guess what a user needs to put into a prompt. That typically introduces more noise than LLMs can effectively manage.
  • A simple, extensible prompt directory. Bring your own prompts, and build a library of what works for you and your team. Easily integrate your own prompt templates into DevChat, avoiding significant engineering effort or a steep learning curve. You don't need a complex framework to make AI work for you. All it takes is a standard editor operating on your filesystem.

Feature Overview

Context Building

Great output requires great input. To maximize the power of AI, DevChat assists you seamlessly to provide the right context to the AI.

  • For instance, to generate test cases for a function, you can add to the prompt the function along with an existing test case. The test case serves as a useful reference for DevChat, enabling it to understand how to write a valid test case specific to your environment, thus eliminating the need for you to specify every requirement in your prompt.

    Add to context

  • You can incorporate the output of any command, such as tree ./src, into a prompt with DevChat. For example, you can add the output of git diff --cached to DevChat, which can then generate a commit message for you.

    Generate a commit message

  • Program analysis can assist in building the necessary context. Suppose you want DevChat to explain some code to you. DevChat can perform better if it's aware of the dependent functions that the code is calling. In this scenario, you can select the target code with DevChat to explain and add "symbol definitions" to the context (by clicking the plus button). DevChat will then generate a prompt that explains the target code, taking into account the dependent functions.

Prompt Extension

DevChat utilizes a directory to manage predefined prompt templates. You can easily add your own or modify existing ones using a text editor. By default, the directory is named workflows and located in the .chat folder at your home directory. You can run ls ~/.chat/workflows in a terminal to see what's inside.

The workflows directory typically contains three subdirectories, sys, org, and usr. The sys (system) directory is a clone of https://github.com/devchat-ai/workflows, which contains the default prompt templates. You can overwrite those system prompts. For instance, if you create commit_message in the usr directory and define your own prompt.txt, DevChat will use your version instead of the default in sys or org.

workflows
โ”œโ”€โ”€ sys
โ”‚   โ””โ”€โ”€ commit_message
โ”‚       โ””โ”€โ”€ prompt.txt
โ”œโ”€โ”€ org
โ”‚   โ””โ”€โ”€ commit_message
โ”‚       โ””โ”€โ”€ prompt.txt
โ””โ”€โ”€ usr
    โ””โ”€โ”€ commit_message
        โ””โ”€โ”€ prompt.txt

The org directory is useful for cleanly maintaining team-wise conventions or requirements. Your team can share a Git repository to store prompts in org, and every team member can locally sync ~/.chat/workflows/org with the repository. The org prompts will overwrite those in sys, while an individual developer can then further customize them in usr.

You can incorporate a template in your prompt by typing a "command" with the corresponding name in the DevChat input. Type / followed by the command name, as shown below. The /-separated path to the prompt directory corresponds to a .-separated command name. For instance, if you want to embed the 'prompt.txt' file located in path/to/dir into your current prompt, you should type /path.to.dir into the DevChat input field, along with the other content of the prompt. Note that sys, org, or usr do not need to be included in a command name. DevChat will first look up the corresponding path under usr, then org, and finally sys.

image

Quick Start

For UI, install our Visual Studio Code extension from Visual Studio Marketplace. Read Quick Start for the VS Code extension.

For CLI:

  • Install Python 3.8+ and pip.
  • Install DevChat by running: pip install devchat.
  • Set your OpenAI API Key by running export OPENAI_API_KEY="[sk-...]" (or DevChat access key).
  • To access help, use the command: devchat --help or devchat prompt --help.

Community

What is Prompt-Centric Software Development (PCSD)?

Contributing

Issues and pull request are welcome: https://github.com/devchat-ai/devchat/issues

Contact

Email: [email protected]

We are creators of Apache DevLake.

devchat's People

Contributors

0warning0error avatar basicthinker avatar daniel-hutao avatar ishaan-jaff avatar yangbobo2021 avatar

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.