fix
opentp fix
Section titled “opentp fix”Automatically fixes event keys based on taxonomy values and the configured key generator (spec.events.x-opentp.keygen).
opentp fix [options]Options
Section titled “Options”| Option | Description |
|---|---|
--root <path> | Project root directory |
--verbose | Show detailed output |
--external-transforms <path> | Load custom transforms (can be repeated) |
Examples
Section titled “Examples”Fix all events
Section titled “Fix all events”opentp fixOutput:
Fixed 3 events: events/auth/login.yaml: auth::login_click → auth::login events/dashboard/view.yaml: dashboard_view → dashboard::view events/onboarding/step.yaml: step_complete → onboarding::step_completeHow It Works
Section titled “How It Works”- Reads each event file
- Extracts taxonomy values (area, event, etc.)
- Applies
spec.events.x-opentp.keygen.template+ transforms to generate the expected key - If the current key doesn’t match, updates the file
Example
Section titled “Example”Given this configuration:
spec: events: x-opentp: keygen: template: "{area | slug}::{event | slug}" transforms: slug: - lower - replace: from: " " to: "_"And this event:
event: key: wrong_key # incorrect taxonomy: action: User clicks login buttonRunning opentp fix will update the key to:
event: key: auth::login_button_click # fixed- Only the
keyfield is modified; other fields remain unchanged - Original file formatting is preserved as much as possible
- Run
opentp validateafter fixing to verify changes