Prerequisites
- Node.js >= 18
- A Ditto API key — generate one from your developer integrations settings
- A Ditto workspace with at least one style guide
Installation
1
Install the package
2
Initialize your project
Run the init command from your repo root:This creates two files:
dittospec.config.json— project configurationworkspace.ditto.md— workspace-level Ditto spec file for universal style guide rules
3
Set your API key
Set the
DITTO_API_KEY environment variable:You can also add
DITTO_API_KEY=your-api-key to a .env file at the repo root. The CLI loads it automatically.4
Verify the connection
Run a dry-run pull to confirm everything is wired up:You should see a list of discovered Ditto spec files and what style guide rules would be written.
Configuration
Thedittospec.config.json file controls how the CLI discovers Ditto spec files and syncs style guide rules. A minimal config:
Properties
Agent setup
Runninginit with the --agent flag writes configuration for your AI development tool:
Claude Code
Claude Code
Appends a Ditto Specs section to
CLAUDE.md (creates the file if absent) and writes three skill files to .claude/commands/:See Agent Skills for detailed documentation of each skill.
Cursor
Cursor
Appends a Ditto Specs section to
.cursorrules with instructions for reading and creating Ditto specs.Re-running
init --agent is safe — it updates skill files to the current CLI version and skips CLAUDE.md sections that already exist. Use --force to overwrite skill files you’ve customized.