ClaudeKit CLI

raw JSON →
3.41.4 verified Thu Apr 23 auth: no javascript

claudekit-cli is a command-line interface tool designed to streamline the initialization and maintenance of ClaudeKit projects. Its primary function is to bootstrap new projects using predefined boilerplate templates and facilitate updates to existing ones. The package is currently in active development, with recent releases indicating a focus on continuous integration and refinement, often denoted by 'dev' suffixes (e.g., v3.41.4-dev.45). It requires Node.js version 18.0.0 or higher to operate. As a CLI, its core utility lies in command execution rather than programmatic imports, serving as an essential tool for developers working within the ClaudeKit ecosystem to quickly set up and manage their applications, offering a consistent and automated approach to project scaffolding.

error Error: Command failed with exit code 127: npx claudekit create...
cause The `npx` command could not find or execute `claudekit`. This often indicates `npm` or `node` are not correctly installed or configured in the system's PATH.
fix
Ensure Node.js and npm are correctly installed and their executables are accessible in your system's PATH. Try running node -v and npm -v to verify.
error Error: Cannot find module '...' from 'claudekit-cli'
cause This error typically occurs when Node.js cannot resolve an internal module dependency. This can happen if the `claudekit-cli` package was corrupted during installation or if there are conflicting node_modules.
fix
Try reinstalling the package: npm uninstall -g claudekit-cli followed by npm install -g claudekit-cli. If using npx, clear npm cache with npm cache clean --force.
error Error: EACCES: permission denied, access '...' or 'npm ERR! Could not install packages.'
cause Insufficient permissions to write to global npm directories or project directories when installing packages or creating files.
fix
Try running the command with sudo (on macOS/Linux: sudo npx claudekit create...) or fix npm permissions (search for 'fixing npm permissions' for your OS). For local project creation, ensure your user has write access to the target directory.
breaking The `claudekit-cli` requires Node.js version 18.0.0 or higher. Running with older versions will result in execution errors.
fix Upgrade your Node.js environment to version 18.0.0 or newer using a tool like `nvm` or `fnm`.
gotcha The project is undergoing rapid development, with many recent releases being 'dev' versions (e.g., v3.41.4-dev.45). While this indicates active maintenance, it may also imply potential instability or frequent, undocumented minor changes.
fix Refer to the GitHub repository for the most up-to-date information and consider pinning to specific non-dev versions if stability is critical for your project.
gotcha When using `npx`, ensure you have an active internet connection as it will attempt to download the latest version of `claudekit-cli` if not already cached. For offline use or specific version control, consider global installation (`npm install -g claudekit-cli`).
fix For consistent offline usage, perform `npm install -g claudekit-cli`. Otherwise, verify network connectivity.
npm install claudekit-cli
yarn add claudekit-cli
pnpm add claudekit-cli

Demonstrates how to programmatically execute the `claudekit create` command to bootstrap a new project.

import { execSync } from 'child_process';

const projectName = 'my-claudekit-app';
const template = 'default'; // Or 'desktop', 'web', etc.

try {
  console.log(`Creating a new ClaudeKit project: ${projectName} using template: ${template}...`);
  // This simulates running the CLI command programmatically
  const output = execSync(`npx claudekit create ${projectName} --template ${template}`, {
    stdio: 'inherit'
  });
  console.log(`Project '${projectName}' created successfully.`);

  console.log(`
Now, navigate into your project and start developing:`)
  console.log(`cd ${projectName}`)
  console.log(`npm install`)
  console.log(`npm run dev`)

} catch (error) {
  console.error(`Failed to create project: ${error.message}`);
  process.exit(1);
}