Skip to content

remove

Remove an entity from the system.

Usage

bash
et remove <type> <id> [--force]

Options

OptionDescription
--forceRemove 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_flow

Output:

Journey 'old_flow' removed

Remove With References (Warning)

bash
et remove actor customer

Output:

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 --force

Output:

Actor 'customer' removed

WARNING

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

  1. Check references first: Run without --force to see what depends on the entity
  2. Update references: Before removing, update or remove dependent entities
  3. Validate after force: If you force remove, run et validate to find broken references
  4. Use for cleanup: --force is useful for cleaning up test data or fixing broken models

Errors

  • Entity not found: Error: Actor 'unknown' not found

Work matters when it helps real people achieve their goals.