|
18 | 18 |
|
19 | 19 |  |
20 | 20 |
|
21 | | -ABCoder, an AI-powered tool, streamlines coding by keeping real-time status updates, providing lossless code compression, and giving development guidance. It enhances testing by identifying quality, generating reports, and auto-creating test cases. It also offers guidance for refactoring, including language stack switches. |
22 | | - |
23 | | -# Table of Contents |
24 | | - |
25 | | -- [ABCoder: AI-Based Coder(AKA: A Brand-new Coder)](#abcoder-ai-based-coderaka-a-brand-new-coder) |
26 | | -- [Table of Contents](#table-of-contents) |
27 | | -- [Overview](#overview) |
28 | | -- [Quick Start](#quick-start) |
29 | | - - [Prerequisites](#prerequisites) |
30 | | - - [Running through Coze OpenAPI](#running-through-coze-openapi) |
31 | | -- [Status Update](#status-update) |
32 | | -- [Lossless Compression](#lossless-compression) |
33 | | -- [Development Guide](#development-guide) |
34 | | -- [Testing Enhancements](#testing-enhancements) |
35 | | -- [Refactor/Rewrite Guide](#refactorrewrite-guide) |
36 | | -- [Getting Involved](#getting-involved) |
37 | | - |
38 | | -# Overview |
39 | | - |
40 | | -ABCoder is a comprehensive open-source software development tool that aims to utilize artificial intelligence to enhance |
41 | | -the process of coding. This project focuses on various aspects of software development ranging from repository analysis, |
42 | | -issue and pull request tracking, to automated code compression, development guidance, testing enhancement, and |
43 | | -refactoring guidance. |
44 | | - |
45 | | -# Quick Start |
46 | | - |
47 | | -## Prerequisites |
48 | | -- install git and set your access token for github on cmd-line |
49 | | -- install [rust-toolchain](https://www.rust-lang.org/tools/install) (stable) |
50 | | -- (optional) install [ollama](https://github.com/ollama/ollama) and run your LLM |
51 | | -- (optional) create a [Coze](https://www.coze.com/docs/developer_guides/coze_api_overview?_lang=en) agent and set its OpenAPI key |
52 | | - |
53 | | -## Running through Coze OpenAPI |
54 | | -1. Set .env file for configuration on ABCoder's working directory. Taking Coze as an example: |
55 | | -``` |
56 | | -# cache for repo,AST and so on |
57 | | -WORK_DIR=tmp_abcoder |
| 21 | +ABCoder, an AI-oriented code handling tool, is designed to enhance coding-context for Large-Language-Model (LLM). |
58 | 22 |
|
59 | | -# exclude dirs for repo parsing, separated by comma |
60 | | -EXCLUDE_DIRS=target,gen-codes |
61 | 23 |
|
62 | | -# LLM's api type |
63 | | -API_TYPE=coze # coze|ollama |
| 24 | +## Features |
64 | 25 |
|
65 | | -# LLM's output language |
66 | | -LANGUAGE=zh |
| 26 | +- Universal Abstract Syntax Tree (UniAST), an language-independent and AI-friendly coding-context, provides ample and recursive code information for AI or programs. |
| 27 | + |
| 28 | +- Universal Parser, parses abitary languages to UniAST. |
67 | 29 |
|
68 | | -# Coze options |
69 | | -COZE_API_TOKEN="{YOUR_COZE_API_TOKEN}" |
70 | | -COZE_BOT_ID={YOUR_COZE_BOT_ID} |
71 | | -``` |
| 30 | +- Univeral Writer, transforms UniAST back to codes. |
72 | 31 |
|
73 | | -2. compile the parsers |
74 | | -``` |
75 | | -./script/make_parser.sh |
76 | | -``` |
| 32 | +- (WIP) Code Understanding and Semantic Querying, which can be used to retrieve codes with natural language for either human or AI. |
| 33 | + |
| 34 | +Based on these features, ABCoder can help developers to easily implement or enhance many AI-assisted coding applications, such as code reviewer, IDE copilot and so on. |
77 | 35 |
|
78 | | -3. compile and run ABCoder |
79 | | -``` |
80 | | -cargo run --bin cmd compress https://xxx.git |
81 | | -``` |
| 36 | +## Getting Started |
82 | 37 |
|
83 | | -4. Once triggered, ABCoder will take three steps: |
84 | | - 1. Download the repository in {REPO_DIR} |
85 | | - 2. Parse the repository and store the AST in {CACHE_DIR} |
86 | | - 3. Call the LLM to compress the repository codes, and refresh the AST for each call. |
87 | | -You can stop the process at anytime after step 2. You can restart the compressing by running the same command. |
88 | | - |
89 | | -5. Export the compressed results |
| 38 | +1. Install ABCoder: |
| 39 | +```bash |
| 40 | +go install github.com/cloudwego/abcoder@latest |
90 | 41 | ``` |
91 | | -cargo run --bin cmd export https://xxx.git --out-dir {OUTPUT_DIR} |
| 42 | +2. Use ABCoder to parse a repository to UniAST (JSON) |
| 43 | +```bash |
| 44 | +abcoder parse <language> <repo-path> > <AST-path> |
| 45 | +``` |
| 46 | +3. Use ABCoder as a writer |
| 47 | +```bash |
| 48 | +abcoder write <AST-path> |
92 | 49 | ``` |
93 | 50 |
|
94 | | -# Status Update |
95 | | - |
96 | | -The system is designed to automatically fetch the latest data from Github upon triggering relevant tasks, ensuring the |
97 | | -repository status is always up-to-date. It can answer queries related to function, defects based on issue and PR |
98 | | -information. For more details, check out our Issues and Pull Requests sections on Github. |
99 | | - |
100 | | -# Lossless Compression |
101 | | - |
102 | | -The system also offers a lossless compression feature for repository code. The specific implementation methods are being |
103 | | -optimized, and more details will be available soon. |
| 51 | +## Universal-Abstract-Syntax-Tree Specification |
104 | 52 |
|
105 | | -# Development Guide |
| 53 | +see [UniAST Specification](docs/uniast-zh.md) |
106 | 54 |
|
107 | | -We welcome all developers wishing to contribute to ABCoder. Our system provides detailed guidance for manual development |
108 | | -and also supports auto-generation of instructions. Check out our Contribution Guide for more information. |
109 | 55 |
|
110 | | -# Testing Enhancements |
| 56 | +## Supported Languages |
111 | 57 |
|
112 | | -The system is designed to analyze existing functions and corresponding tests, identify the overall quality of testing, |
113 | | -produce reports, and automatically generate test cases for weakly covered items. Our goal is to help repositories |
114 | | -enhance and perfect their test cases. |
| 58 | +ABCoder currently supports the following languages: |
115 | 59 |
|
116 | | -# Refactor/Rewrite Guide |
| 60 | +| Language | Parser | Writer | |
| 61 | +| -------- | ------ | ------ | |
| 62 | +| Go | ✅ | ✅ | |
| 63 | +| Rust | ✅ | WIP | |
| 64 | +| C | WIP | ❌ | |
117 | 65 |
|
118 | | -We offer guidance for both small-scale feature iterations and large-scale rewrites, including language stack switches. |
119 | | -Our system provides a detailed guide for manual development and also supports automated guidance generation. |
120 | 66 |
|
121 | | -# Getting Involved |
| 67 | +## Getting Involved |
122 | 68 |
|
123 | 69 | We encourage developers to contribute and make this tool more powerful. If you are interested in contributing to ABCoder |
124 | | -project, kindly check out our Getting Involved Guide. |
| 70 | +project, kindly check out our Getting Involved Guide: |
| 71 | +- [Parser Extension](docs/parser_extension-zh.md) |
| 72 | +- [Writer Extension](docs/writer_extension-zh.md) |
125 | 73 |
|
126 | 74 | > Note: This is a dynamic README and is subject to changes as the project evolves. |
0 commit comments