coding_assistant
v1.0.3
Published
A coding helper using openAI
Downloads
2
Readme
TypeScript Coding Assistant
This TypeScript Coding Assistant is a command-line tool that analyzes a TypeScript project, counts the number of tokens in each file, generates documentation, and saves it to a specified directory. If any file exceeds the maximum number of tokens allowed, the program returns an error message.
Installation
- Clone this repository or download the source code.
- Run
npm install
to install the required dependencies.
Usage
To use the TypeScript Coding Assistant, you need to update the documentationPath
in the src/index.ts
file to specify the desired path where the generated documentation files should be saved.
After setting the documentationPath
, run the following command to start the program:
```bash npm run start ```
or
``` ts-node src/index.ts ```
The TypeScript Coding Assistant will analyze the TypeScript project, generate documentation for each file, and save it to the specified directory. If any file exceeds the maximum number of tokens allowed, the program returns an error message.
Configuration
You can adjust the maxTokens
value in the src/index.ts
file to set the maximum number of tokens allowed per file. If any file exceeds this limit, the program returns an error message.
Customization
You can customize the way tokens are counted and documentation is generated by modifying the following functions in the src/services/codingAssistant.ts
file:
countTokens(content: string): number
generateDocumentation(filePath: string): string