# codellms

> Use LLMS to automatically generate a complete application project.

Latest version **0.6.0** (published 2023-09-17) · Apache License 2.0 license · 0 weekly downloads

## Install

```sh
npm install codellms
pnpm add codellms
yarn add codellms
bun add codellms
```

Provides the command `codellms`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.0 |
| Published | 2023-09-17 |
| First published | 2023-07-01 |
| Weekly downloads | 0 |
| License | Apache License 2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=12.0.0 |
| Dependencies | 7 |
| Unpacked size | 69.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 6 |
| Author | guoxing45@gmail.com |
| Maintainers | cgx9 |
| Keywords | oclif, codegpt, codellms, openai, code generate |

## Links

- npm: https://www.npmjs.com/package/codellms
- Repository: https://github.com/codellms/codellms
- Issues: https://github.com/codellms/codellms/issues
- npm.io page: https://npm.io/package/codellms

## Dependencies (7)

- [openai](https://npm.io/package/openai.md) ^3.3.0
- [@iarna/toml](https://npm.io/package/@iarna/toml.md) ^2.2.5
- [@oclif/core](https://npm.io/package/@oclif/core.md) ^2
- [@cucumber/gherkin](https://npm.io/package/@cucumber/gherkin.md) ^26.2.0
- [@cucumber/messages](https://npm.io/package/@cucumber/messages.md) ^22.0.0
- [@oclif/plugin-help](https://npm.io/package/@oclif/plugin-help.md) ^5
- [@oclif/plugin-plugins](https://npm.io/package/@oclif/plugin-plugins.md) ^2.4.7

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.6.0 (latest) — 2023-09-17
- 0.5.1 — 2023-09-08
- 0.5.0 — 2023-08-02
- 0.4.0 — 2023-07-18
- 0.3.0 — 2023-07-11
- 0.2.2 — 2023-07-10
- 0.2.1 — 2023-07-09
- 0.2.0 — 2023-07-06
- 0.1.1 — 2023-07-01
- 0.1.0 — 2023-07-01

## README

# codellms

[![npm version](https://badge.fury.io/js/codellms.svg)](https://badge.fury.io/js/codellms)

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

* [x] Automatically initialize the project
* [x] Generate corresponding api according to requirements
* [x] Automatically install dependencies
* [x] automatic debug (The effect is not very good.)
* [x] Support modification and addition of requirements without re-running the entire project
* [ ] If the project is a RESTful API project, generate Swagger.
* [x] Create different dialogue contexts based on the feature files.
* [ ] Support using Claude API for code generation.
* [x] Use database structure to assist GPT in understanding entity classes.
* [x] 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

``` shell
yarn global add codellms
```

## Usage

1. create config file(codellms.toml)

``` shell
codellms init
```

2. 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](https://cucumber.io/docs/gherkin/reference/).

Example of codellms.toml:

``` 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 |
```

3. 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)

``` shell
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.

---
_Source: https://npm.io/package/codellms · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
