A powerful command-line interface tool for managing The DIG component library.
bash
npx the-dig@latest init
`
This command will:
- Create a .thedigrc.json configuration file
- Install necessary dependencies (clsx, lucide-react)
- Set up the basic project structure
$3
Configure your project's CSS with The DIG styles:
`bash
npx the-dig@latest config
`
This will update your global CSS file with The DIG styles and Tailwind CSS configuration.
$3
Add components from The DIG library to your project:
`bash
npx the-dig@latest add
`
Example:
`bash
npx the-dig@latest add TextField
npx the-dig@latest add Button,Badge
`
$3
Update components from The DIG library to your project:
`bash
npx the-dig@latest update
`
Example:
`bash
npx the-dig@latest update TextField
npx the-dig@latest update Button,Badge
`
Configuration
The CLI uses a .thedigrc.json file to store project configuration. Here's the default configuration:
`json
{
"tsx": true,
"tailwind": {
"version": 4,
"css": "/src/app/globals.css"
},
"aliases": {
"components": "/src/components"
}
}
`
$3
- tsx: Enable TypeScript JSX support
- tailwind.version: Tailwind CSS version to use
- tailwind.css: Path to your global CSS file
- aliases.components: Directory where components will be added
Available Commands
| Command | Description |
| --------------------- | ------------------------------------ |
| init | Initialize the project for The DIG |
| config | Configure the project CSS |
| add | Add new components to your project |
| update | Update components to your project |
$3
- Node.js 18+
- TypeScript
- npm or yarn
$3
- commander: CLI framework
- fs-extra: Enhanced file system operations
- node-fetch: HTTP client
- ora`: Terminal spinners