kgen

kgen is a code generation CLI tool for Typescript (Soon JS too) React projects built in Rust.

It speeds up your development and enforces standardization across your project.

Command example:

kgen component header --data

You could also do:

kgen c header -d

Generates a component in your /components directory (configurable too), and thanks to the --data flag adds basic fetching data logic to it. The generated component should look something like this:

import React from "react";
import { useState, useEffect } from "react";

interface HeaderProps {

}

interface DataType {

}

export const Header = ({ }: HeaderProps) => {
    const [data, setData] = useState<DataType>({});

    useEffect(() => {
        fetch("").then(res => res.json().then(data => {
            setData(data);
        }))
    }, [])

    return (
        <>

        </>
    )
}

Help section: All commands and descriptions

To get this helper list with all the commands, flags, and aliases with short description whenever you need, just type on your terminal kgen or kgen --help.

Usage:

kgen [FILE_TYPE] [NAME] <EXTRA_OPTIONS>

Useful links