This guide explains what the checkmate init command does behind the scenes and how to perform each step manually if needed.
When you run npx checkmateai init or checkmate init, the following actions occur:
- Creates directory structure for specs and logs
- Generates a
.checkmateconfiguration file if it doesn't exist - Adds appropriate entries to
.gitignore - Sets up Cursor integration by generating rule files
- Performs basic verification of the setup
If you encounter issues with the automatic initialization, you can follow these manual steps:
Create the necessary directories for CheckMate to store specifications, logs, and cache:
# Create the main checkmate directory
mkdir -p checkmate/specs
mkdir -p checkmate/logs
mkdir -p checkmate/cache
# Create the agent specs directory (for YAML specs)
mkdir -p checkmate/specs/agentsCreate a .checkmate file in your project root with your API keys:
# Create .checkmate file with basic configuration
cat > .checkmate << EOF
openai_key: sk-**** # Replace with your OpenAI API key
anthropic_key: sk-ant-**** # Replace with your Anthropic API key
models:
reason: claude-3-7-sonnet-20250219
quick: gpt-4o-mini
tree_cmd: "git ls-files | grep -E '\\\\.(ts|js|tsx|jsx)$'"
log: optional
EOFEnsure that sensitive files are not committed to your repository:
# Add CheckMate entries to .gitignore
cat >> .gitignore << EOF
# CheckMate
.checkmate
checkmate/logs/
checkmate/cache/
.checkmate-telemetry/
EOFTo manually set up Cursor integration:
# Create Cursor rules directory if it doesn't exist
mkdir -p .cursor/rules
# Generate Cursor rule files
npx checkmateai setup-mcpThe generated rule files use the checkmate run-script command to execute utility scripts with proper path resolution. This ensures that scripts like cm-enforce.js and validate-spec-format.js can be found and executed correctly, regardless of where CheckMate is installed.
For example, a typical rule might include:
- Execute: checkmate run-script cm-enforce run --target "..."
This approach is more reliable than direct node scripts/... calls which can break when CheckMate is installed as a dependency.
Create a simple test specification to verify your setup:
# Create a simple test spec
cat > checkmate/specs/test-spec.md << EOF
# Test Specification
files:
- README.md
- [ ] Repository has a README.md file
EOF
# Run CheckMate to verify
npx checkmateai status --target test-specIf you encounter issues with API keys:
- Ensure your API keys are correctly formatted in the
.checkmatefile - Alternatively, set them as environment variables:
export OPENAI_API_KEY=sk-...your-key-here... export ANTHROPIC_API_KEY=sk-ant-...your-key-here...
If you encounter permission issues:
# Ensure directories have correct permissions
chmod -R 755 checkmate
chmod 600 .checkmate # Secure your API keysIf Cursor rules aren't being applied:
- Check that the
.cursor/rulesdirectory exists and contains rule files - Verify the
mcpServerssection in.cursor/config.json:cat .cursor/config.json
- Manually run the MCP setup:
npx checkmateai setup-mcp
To verify that your CheckMate setup is working correctly:
# Check your API connections
npx checkmateai status
# Create a simple spec
npx checkmateai gen "Test feature"
# Verify the spec status
npx checkmateai status --target test-featureIf all steps complete successfully, your CheckMate installation is working properly.
Once initialization is complete:
- Quick Start Guide - Get started with CheckMate
- Configuration Guide - Learn about configuration options
- Spec Types - Understand the different types of specifications