shlogg · Early preview
Ramu Narasinga @karthik-m22

Setting Up A CLI Tool With TypeScript And Turborepo

Building a CLI tool for Next.js projects. Created a monorepo with `pnpm` and set up `tsconfig.json` using `@repo/typescript-config`. Added `tsup` to bundle TypeScript code.

Introduction

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.

  
  
  Create a project

I have referenced this article — How to...