remove
Remove an entity from the system.
Usage
bash
et remove <type> <id> [--force]Options
| Option | Description |
|---|---|
--force | Remove without warning about references |
Behaviour
Before removing an entity, et checks if it's referenced by other entities:
- Actors are referenced by goals, interactions, and journeys
- Goals are referenced by actors (goals list), interactions, and journeys
- Interactions are referenced by journeys (steps)
- Journeys are not referenced by other entities
If references exist and --force is not used, removal is blocked with a warning.
Examples
Remove Without References
bash
et remove journey old_flowOutput:
Journey 'old_flow' removedRemove With References (Warning)
bash
et remove actor customerOutput:
Warning: actor 'customer' is referenced by:
- goal/checkout (field: actor)
- interaction/add_to_cart (field: performed_by)
- journey/checkout_flow (field: actor)
Use --force to remove anyway.Exit code: 1
Force Remove
bash
et remove actor customer --forceOutput:
Actor 'customer' removedWARNING
Force removing an entity leaves dangling references. Run et validate after to find and fix them.
JSON Output
Without references:
json
{
"success": true,
"message": "Actor 'customer' removed"
}With references (blocked):
json
{
"success": false,
"error": "Entity is referenced by other entities",
"references": [
{"type": "goal", "id": "checkout", "field": "actor"},
{"type": "interaction", "id": "add_to_cart", "field": "performed_by"}
],
"hint": "Use --force to remove anyway"
}Best Practices
- Check references first: Run without
--forceto see what depends on the entity - Update references: Before removing, update or remove dependent entities
- Validate after force: If you force remove, run
et validateto find broken references - Use for cleanup:
--forceis useful for cleaning up test data or fixing broken models
Errors
- Entity not found:
Error: Actor 'unknown' not found