I am building a CLI tool that lets you add features into your project via CLI. This CLI tool currently only supports adding features in a Next.js based projects. The idea is to run a command like
pnpx thinkthroo@latest add supabase-auth
or
pnpx thinkthroo@latest add s3-upload
and this would add the files required.
I have broken down the process into parts and share the steps involved and write about my experience in setting up a CLI tool through this articles.
I have referenced this article — How to write a TypeScript Library to set up this project but I had my own touch inspired by shadcn/ui CLI since what I am building is also a CLI tool.
The difference is the way I am importing the extends . Since my setup is a monorepo, I would now have to add @repo/typescript-config as dependency in package.json. Read more about Turborepo.
Finally, I created another file named ts-library.json in typescript-config that is imported in my CLI tool, thinkthroo and updated its code to what is shown below:
You will find some other files in this typescript-config.
These are created at the time of setting up the monorepo. I might remove this package in the future releases if I do not see a need, but for now I am going to just leave it there.
Hey, my name is Ramu Narasinga. I study large open-source projects and create content about their codebase architecture and best practices, sharing it through articles, videos.