Home

Awesome

lerna

Kody is a command-line tool for generating artifact files, powered by both classic and AI code generation techniques. It can be used by both technical and non-technical users to generate files across a wide range of technologies and programming languages.

The code generation feature in Kody relies on OpenAI GPT, a language model that uses deep learning to generate human-like text, and ChatGPT to provide natural language processing capabilities.

Table of Contents

Installation

Prerequisites

To install kody, use npm with the following command:

npm install -g kodyfire-cli

or

yarn global add kodyfire-cli

You can check the documentation with

kody --help

Usage

kody [options] [command]

Options

Commands

Getting Started

Open the project you are willing to work on using vscode or your prefered editor.

Generate artifacts using AI

In case you want to exclusivly rely on AI to generate your artifacts. You don't need to install any additional kodies. Run the kody ai [prompt] command and follow the prompts. For example, to create a Laravel Controller named SampleController under API/V1 and add a comment on top saying Hello Kodyfire, run the following command

kody ai create a Laravel Controller named SampleController under API/V1. Add a comment on top saying Hello Kodyfire!

You can use the experimental Speech-to-Text option to pass your prompt using your voice.

kody ai -r

The transcription relies on Whisper and requires SoX installed and available in your $PATH. for the audio recording.

For Linux

sudo apt-get install sox libsox-fmt-all

For MacOS

brew install sox

For Windows

Download the binaries

Generate your artifact using the classical method

Search and install a kody

Based on your project, search availables kodies and select the one that fits your need..

To search availables kodies by keyword runthe following command. if you don't specify a keyword all available kodies will be listed.

kody search [keyword]

Install your kody of choice. For example, if you want to install the react kody

kody install react

or

npm install -s react-kodyfire

Please note you can install as many kodies in the same project as you wish.

Generate your artifact

There are 2 methods you can generate your artifacts with:

Method 1: Generator mode kody generate

The recommended way of using kody is using the generate command. The command will assist you creating your artifact based on the chosen concept. For example, a react component is considered a concept. In order to generate your artifacts, run the generate command. The syntax is kody g|generate [kody] [concept]. the assistant will prompt you to select the missing arguments. As an example, run the following command from your terminal:

kody generate react component
Method 2: Runner mode kody run

The run command is similar to the generate command. The run requires a definition file which is simply a json file containing all the concept definitions you have created using the ride command. The generate command on the other hand creates one or more concept definition on the run and process them on one run. Every command has its use cases.

Initialize kody

In order to start using kody, you need to initialize your project.

kody init

This will add the definition files required for kody runs. <u>Important</u>: Please run the command only once. The command will override existing definition files. We will disable overriding in a future version.

Ride your kody

In order to update your definition, use the kody ride command to assist you populate the required fields

kody ride
Launch a kody run

Once you are satisified with your definition file, execute the run command to generate your artifacts.

kody run -s laravel-kody.json

To run all kodies defined within your project, run the following command:

kody batch

Create your own kody

In most cases you might need a custom kody to suit your needs

Scaffold a new kody

Create a basic kody using the scaffold command. Follow the prompts to setup your kody

kody scaffold

This will create a folder containing the basic structure for a kody. You can start using right away within your project.

Setup your kody

Install npm dependencies
npm i
Build your kody
npm run build

Add your concepts and related templates

//TODO This will build your kody and export the basic templates files.

Add your kody as an NPM dependency to a test project

In order to be able to use it within your test project run the following command

npm i -s ./yourkody-kodyfire

Publish your kody

Please remember that Kody is still in exploration phase and things will change frequently. Contribution is always highly requested.

Prepare your kody

Add the required kodyfire metadata to your package.json

{
  // A command for handling this part will be added in a future version
  "kodyfire": {
    "id": "your-id", // must be unique.
    "type": "kodyfire", // Example of valid technology names: laravel, express, react, angular, flutter, html, css. Default: kodyfire
    "version": "0.0.1"
  }
}

Publish to Github

Intialize your project as a git repository and push to a public Github repo

To do so, kindly follow these steps:-

  1. Intitialize a new Github repository and make it public.
  2. Open your project root folder locally from terminal and run the following commands:-
git init
git add .
git commit -m "Initial Commit!"
  1. Link your project to your Github repository.
git remote add origin <copied URL>
git push origin main

Publish to npm

Once you are satisfied with your kody and you would to like to share it with the community. Run the following command.

npm Publish

<u>Note</u>: <i>You'll need an NPM account</i>

Share with community

Congratulation publishing your first kody. Don't forget to share your kody repo link by opening an issue on Kody's github repository.

Terminology

Note: Kody uses classical code generation techniques in addition to AI-powered code generation using OpenAI Codex and ChatGPT.

Available kodies

NameDescription
basic-kodyfireA general purpose code generator that should handle most of the generation use cases
typescript-kodyfireGenerate typescript related artifacts
tsconfig-kodyfireGenerate tsconfig files for your typescript projects
nextjs-kodyfireGenerate nextJs components and related artifacts
react-kodyfireGenerate react components
laravel-kodyfireLaravel artifacts generation
uml-kodyfireUml diagrams generation using plantuml
readme-kodyfireReadme file generation
word-kodyfireGenerate ms word document based on a template
pdf-kodyfireGenerate PDF document from HTML templates
social-image-kodyfireGenerate dynamic images for social sharing based on HTML templates
social-gif-kodyfireGenerate dynamic gif images for social sharing based on HTML templates
linkedin-quizzes-kodyfirePractice Linkedin skill assessement tests from your terminal
chatgpt-kodyfireUse chatgpt from the terminal. Allows you provide additional data from various sources (not implemented yet) and export to serveral outputs (markdown only now).

Contributing

If you encounter any issues while using Kody or have suggestions for new features, feel free to open an issue or submit a pull request.

Please read our contributing guidelines before making contributions.

License

Kody is MIT licensed.