0.6.0 • Published 8 months ago

codellms v0.6.0

Weekly downloads
-
License
Apache License 2....
Repository
github
Last release
8 months ago

codellms

npm version

Use gpt to generate a complete api project, supporting multiple programme languages. Currently, only API type backend projects have been tested using Express in the example/todolist directory. It is not recommended for frontend projects. When GPT-4 opens up multimodal support, I believe that complete frontend and backend projects can be generated, and the frontend project can be generated based on the automatically generated API.

features

  • Automatically initialize the project
  • Generate corresponding api according to requirements
  • Automatically install dependencies
  • automatic debug (The effect is not very good.)
  • Support modification and addition of requirements without re-running the entire project
  • If the project is a RESTful API project, generate Swagger.
  • Create different dialogue contexts based on the feature files.
  • Support using Claude API for code generation.
  • Use database structure to assist GPT in understanding entity classes.
  • The new project supports generating DB migrate to create database structure.
  • Avoid importing different packages that provide the same functionality.

Installation

npm install -g codellms

or

yarn global add codellms

Usage

  1. create config file(codellms.toml)
codellms init
  1. edit codellms.toml(Don't forget to use your own OpenAI API key) and write your feature in features folder. The feature file follows the syntax of Gherkin (BDD) and uses the ".feature" suffix, for example, "todolist.feature". The Gherkin syntax can be referred to here: Gherkin Reference.

Example of codellms.toml:

[dependencies]
express='4.18.2' # For the main framework version, such as Express or Spring Boot, do not use too new of a framework. ChatGPT does not have knowledge of the latest frameworks.

[basic]
language = "typescript" # Java\Go\PHP...
arch = "mvc" # or clean architecture ...
type="api"
db="xxx"
folders=["src/models", "src/controller", "src/services", "src/utils"]
[api]
style="restful"# graphql\grpc...
[openai]
api_key="<your_openai_aip_key>" # Required  Or you can use the environment variable:openai_api_key
model="gpt-3.5-turbo"
temperature=0.5
api_base="" # The default is https://api.openai.com/v1
[db]
need_migration_file=false
schemas="./dbschemas"
[db.xxx]
uri='./db.sqlite'

To use a pre-designed database table structure to generate entity classes, you need to set the "need_migration_file" attribute of the "db" node to false, and configure the "schemas" directory for the table structure. The file naming of the table structure should match the feature file, and it is recommended to use the Markdown format. For example:

| name | type | default value | not null| comment |
| title | varchar | '' | true | this is title |
  1. Generate your project code.(If you don't need to initialize the project, you can manually create an empty codellms-lock.json file in the current directory)
codellms build

It will automatically create folders and code files. Due to the uncertainty of GPT's responses, you may need to try a few times.

0.3.0

10 months ago

0.2.1

10 months ago

0.5.0

9 months ago

0.4.0

10 months ago

0.2.2

10 months ago

0.6.0

8 months ago

0.5.1

8 months ago

0.2.0

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago