# CLI **Category**: react **URL**: https://ui.darkcode.dev/en/docs/react/getting-started/cli **Source**: https://raw.githubusercontent.com/DarkCode-Developers/darkcode-ui/refs/heads/main/apps/docs/content/docs/en/react/getting-started/(overview)/cli.mdx > Use the CLI to manage DarkCode UI dependencies and initialize projects. *** The CLI offers a comprehensive suite of commands to initialize, manage, and improve your DarkCode UI projects. It enables you to `install`, `uninstall`, or `upgrade` individual components, assess the health of your project, download documentation for AI coding agents, and more. ## Installation Requirements: - [Node.js version 22.22.0 or later](https://nodejs.org/en/) ### Global Installation To install `darkcode-ui-cli` globally, execute one of the following commands in your terminal: ```npm npm install darkcode-ui-cli@latest -g ``` ### Without Installation Alternatively, you can use `darkcode-ui-cli` without a global installation by running one of the following: ```bash pnpm dlx darkcode-ui-cli@latest ``` ```bash npx darkcode-ui-cli@latest ``` ```bash yarn dlx darkcode-ui-cli@latest ``` ```bash bunx darkcode-ui-cli@latest ``` ## Quick Start Once `darkcode-ui-cli` is installed, run the following command to display available commands: ```bash darkcode-ui ``` This will produce the following help output: ```bash Usage: darkcode-ui [command] Options: -v, --version Output the current version --no-cache Disable cache, by default data will be cached for 30m after the first request -d, --debug Debug mode will not install dependencies -h --help Display help information for commands Commands: init [options] [projectName] Initializes a new project install [options] Installs @darkcode-ui/react and @darkcode-ui/styles to your project upgrade [options] Upgrades @darkcode-ui/react and @darkcode-ui/styles to the latest versions uninstall [options] Uninstall @darkcode-ui/react and @darkcode-ui/styles from the project list [options] Lists installed DarkCode UI packages (@darkcode-ui/react, @darkcode-ui/styles) env [options] Displays debugging information for the local environment doctor [options] Checks for issues in the project agents-md [options] Downloads DarkCode UI documentation for AI coding agents help [command] Display help for command ``` ### init Initialize a new DarkCode UI project using the `init` command. This sets up your project with the necessary configurations. ```bash darkcode-ui init [options] ``` **Options:** - `-t --template [string]` The template to use for the new project e.g. app, pages, vite - `-p --package [string]` The package manager to use for the new project output: ```bash DarkCode UI CLI ┌ Create a new project │ ◇ Select a template (Enter to select) │ ● App (A Next.js 16 with app directory template pre-configured with DarkCode UI and Tailwind CSS.) │ ○ Pages (A Next.js 16 with pages directory template pre-configured with DarkCode UI and Tailwind CSS.) │ ○ Vite (A Vite template pre-configured with DarkCode UI and Tailwind CSS.) │ ◇ New project name (Enter to skip with default name) │ my-darkcode-ui-app │ ◇ Select a package manager (Enter to select) │ ● npm │ ○ yarn │ ○ pnpm │ ○ bun │ ◇ Template created successfully! │ ◇ Next steps ───────╮ │ │ │ cd my-darkcode-ui-app │ │ npm install │ │ │ ├────────────────────╯ │ └ 🚀 Get started with npm run dev ``` Install the dependencies to start the local server: ```bash cd my-darkcode-ui-app && npm install ``` ```bash cd my-darkcode-ui-app && pnpm install ``` ```bash cd my-darkcode-ui-app && yarn install ``` ```bash cd my-darkcode-ui-app && bun install ``` Start the local server: ```npm npm run dev ``` ### Install Install `@darkcode-ui/react` and `@darkcode-ui/styles` to your project, along with their peer dependencies. If they are already installed, the command does nothing. ```bash darkcode-ui install [options] ``` **Options:** - `-p --packagePath` [string] The path to the package.json file **Output:** ```bash DarkCode UI CLI 📦 Packages to be installed: ╭─────────────────────────────────────────────────────────────────────────────╮ │ Package │ Version │ Status │ Docs │ │─────────────────────────────────────────────────────────────────────────────│ │ @darkcode-ui/react │ 1.0.0 │ stable │ https://ui.darkcode.dev │ │ @darkcode-ui/styles │ 1.0.0 │ stable │ https://ui.darkcode.dev │ ╰─────────────────────────────────────────────────────────────────────────────╯ ╭─────────────── PeerDependencies ────────────────╮ │ react@18.3.1 latest │ │ react-dom@18.3.1 latest │ │ tailwindcss@4.2.2 latest │ ╰─────────────────────────────────────────────────╯ ? Proceed with installation? › - Use arrow-keys. Return to submit. ❯ Yes No ✅ @darkcode-ui/react and @darkcode-ui/styles installed successfully ``` ### upgrade Upgrade `@darkcode-ui/react` and `@darkcode-ui/styles` with their peer dependencies to the latest versions. ```bash darkcode-ui upgrade [options] ``` **Options:** - `-p --packagePath` [string] The path to the package.json file **Output:** ```bash DarkCode UI CLI ╭──────────────────────────── Upgrade ────────────────────────────╮ │ @darkcode-ui/react ^1.0.0 -> ^1.0.0 │ │ @darkcode-ui/styles ^1.0.0 -> ^1.0.0 │ ╰─────────────────────────────────────────────────────────────────╯ ? Would you like to proceed with the upgrade? › - Use arrow-keys. Return to submit. ❯ Yes No ✅ Upgrade complete. All packages are up to date. ``` ### uninstall Uninstall `@darkcode-ui/react` and `@darkcode-ui/styles` from your project. Peer dependencies will not be uninstalled. ```bash darkcode-ui uninstall [options] ``` **Options:** - `-p --packagePath` [string] The path to the package.json file **Output:** ```bash DarkCode UI CLI ❗️ Packages slated for uninstallation: ╭──────────────────────────────────────────────────────────────────────────────────────╮ │ Package │ Version │ Status │ Docs │ │──────────────────────────────────────────────────────────────────────────────────────│ │ @darkcode-ui/react │ 1.0.0 │ stable │ https://ui.darkcode.dev │ │ @darkcode-ui/styles │ 1.0.0 │ stable │ https://ui.darkcode.dev │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ? Confirm uninstallation of these packages: › - Use arrow-keys. Return to submit. ❯ Yes No ✅ Successfully uninstalled: @darkcode-ui/react, @darkcode-ui/styles ``` ### list List the installed DarkCode UI packages (`@darkcode-ui/react`, `@darkcode-ui/styles`). ```bash darkcode-ui list [options] ``` **Options:** - `-p --packagePath` [string] The path to the package.json file **Output:** ```bash DarkCode UI CLI Current installed packages: ╭──────────────────────────────────────────────────────────────────────────────────────╮ │ Package │ Version │ Status │ Docs │ │──────────────────────────────────────────────────────────────────────────────────────│ │ @darkcode-ui/react │ 1.0.0 🚀latest │ stable │ https://ui.darkcode.dev │ │ @darkcode-ui/styles │ 1.0.0 🚀latest │ stable │ https://ui.darkcode.dev │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ ``` ### doctor Check for issues in your project. - Check whether `@darkcode-ui/react` and `@darkcode-ui/styles` are installed - Check whether `required peer dependencies` are installed and matched minimal requirements in the project ```bash darkcode-ui doctor [options] ``` **Options:** - `-p --packagePath` [string] The path to the package.json file **Output:** If there is a problem in your project, the `doctor` command will display the problem information. ```bash DarkCode UI CLI DarkCode UI CLI: ❌ Your project has 1 issue that require attention ❗️Issue 1: missingDarkCodeUIPackages The following DarkCode UI packages are not installed: - @darkcode-ui/styles Run `darkcode-ui install` to install them. ``` Otherwise, the `doctor` command will display the following message. ```bash DarkCode UI CLI ✅ Your project has no detected issues. ``` ### env Display debug information about the local environment. ```bash darkcode-ui env [options] ``` **Options:** - `-p --packagePath` [string] The path to the package.json file **Output:** ```bash DarkCode UI CLI Current installed packages: ╭──────────────────────────────────────────────────────────────────────────────────────╮ │ Package │ Version │ Status │ Docs │ │──────────────────────────────────────────────────────────────────────────────────────│ │ @darkcode-ui/react │ 1.0.0 🚀latest │ stable │ https://ui.darkcode.dev │ │ @darkcode-ui/styles │ 1.0.0 🚀latest │ stable │ https://ui.darkcode.dev │ ╰──────────────────────────────────────────────────────────────────────────────────────╯ Environment Info: System: OS: darwin CPU: arm64 Binaries: Node: v25.8.1 ``` ### agents-md Download DarkCode UI documentation for AI coding agents (Claude, Cursor, etc.). The command clones the latest docs from the DarkCode UI repository and injects a compact index into `AGENTS.md` or `CLAUDE.md` so assistants can reference your project's DarkCode UI setup. ```bash darkcode-ui agents-md [options] ``` **Options:** - `--react` [boolean] Include React docs only - `--output ` [string] Target file path (e.g., `AGENTS.md`, `CLAUDE.md`) - `--ssh` [boolean] Use SSH instead of HTTPS for git clone **Examples:** Run without flags to enter interactive mode: ```bash darkcode-ui agents-md ``` Download React docs to a specific file: ```bash darkcode-ui agents-md --react --output AGENTS.md ``` **How it works:** 1. Clones documentation from the `main` branch using git sparse-checkout 2. Generates a compact index of doc and demo files 3. Injects the index into your markdown file between markers (`` / ``) 4. Adds `.darkcode-ui-docs/` to `.gitignore` For more details, see [AGENTS.md](/docs/react/getting-started/agents-md). The `agents-md` command collects anonymous usage data (selection, output file names, duration, success or error). Set `DARKCODE_UI_ANALYTICS_DISABLED=1` to opt out. ## Reporting issues If you found a bug, please report it in [darkcode-ui-cli Issues](https://github.com/DarkCode-Developers/darkcode-ui-cli/issues).