Package: devchat
DevChat👉 For an enhanced experience and UI, we welcome you to installVisual Studio Code extensionfromVisual Studio Marketplace! Enjoy DevChat VSCode! 👏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 highlypracticalandeffectiveway 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 OverviewContext BuildingGreat output requires great input. To maximize the power of AI, DevChat assists you seamlessly toprovide the right contextto 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.You can incorporate the output of any command, such astree ./src, into a prompt with DevChat. For example, you can add the output ofgit diff --cachedto DevChat, which can then generate a commit message for you.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 ExtensionDevChat 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 namedworkflowsand located in the.chatfolder at your home directory. You can runls ~/.chat/workflowsin a terminal to see what's inside.Theworkflowsdirectory typically contains three subdirectories,sys,org, andusr. Thesys(system) directory is a clone ofhttps://github.com/devchat-ai/workflows, which contains the default prompt templates. You can overwrite those system prompts. For instance, if you createcommit_messagein theusrdirectory and define your ownprompt.txt, DevChat will use your version instead of the default insysororg.workflows
├── sys
│   └── commit_message
│       └── prompt.txt
├── org
│   └── commit_message
│       └── prompt.txt
└── usr
    └── commit_message
        └── prompt.txtTheorgdirectory is useful for cleanly maintaining team-wise conventions or requirements. Your team can share a Git repository to store prompts inorg, and every team member can locally sync~/.chat/workflows/orgwith the repository. Theorgprompts will overwrite those insys, while an individual developer can then further customize them inusr.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 inpath/to/dirinto your current prompt, you should type/path.to.dirinto the DevChat input field, along with the other content of the prompt. Note thatsys,org, orusrdo not need to be included in a command name. DevChat will first look up the corresponding path underusr, thenorg, and finallysys.Quick StartFor UI, install ourVisual Studio Code extensionfromVisual Studio Marketplace. ReadQuick Startfor the VS Code extension.For CLI:Install Python 3.8+ andpip.Install DevChat by running:pip install devchat.Set yourOpenAI API Keyby runningexport OPENAI_API_KEY="[sk-...]"(or DevChat access key).To access help, use the command:devchat --helpordevchat prompt --help.CommunityJoin ourDiscord!Participate indiscussions!What is Prompt-Centric Software Development (PCSD)?The traditional code-centric paradigm is evolving. Stay ahead of the curve with DevChat.Write prompts to create code. Transform prompts into all the artifacts in software engineering.(This image is licensed by devchat.ai under aCreative Commons Attribution-ShareAlike 4.0 International License.)We like to call it DevPromptOps(This image is licensed by devchat.ai under aCreative Commons Attribution-ShareAlike 4.0 International License.)ContributingIssues and pull request are welcome:https://github.com/devchat-ai/devchat/issuesContactEmail:hello@devchat.aiWe are creators ofApache DevLake.