---
title: "timeline.trim: Trim Edit — Film kit command — Kition"
description: "Trims `clip`'s in or out `edge` by `delta` ticks or `deltaFrames`: `mode` regular leaves a gap or overlaps; ripple moves later clips to keep the edit closed. `snap` (\"markers\", \"beats\" or both) lands the trimmed edge on the nearest sequence marker or music beat within `toleranceFrames` (3)."
canonical: "https://developer.kition.ai/docs/kits/film/commands/timeline.trim"
---

> Canonical HTML: [https://developer.kition.ai/docs/kits/film/commands/timeline.trim](https://developer.kition.ai/docs/kits/film/commands/timeline.trim)

# timeline.trim

**Trim Edit.** Trims `clip`'s in or out `edge` by `delta` ticks or `deltaFrames`: `mode` regular leaves a gap or overlaps; ripple moves later clips to keep the edit closed. `snap` ("markers", "beats" or both) lands the trimmed edge on the nearest sequence marker or music beat within `toleranceFrames` (3).

- Kit: Film 0.1.0 (.kfilm); reference: [Film kit commands](https://developer.kition.ai/docs/kits/film.md)
- Changes the document: yes
- Acts on: `clip` (one id), which a run step’s `on` fills

## Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `clip` | `integer` | no |  |
| `delta` | `integer` | no | ticks (254016000000 per second); one of several alternative parameters |
| `deltaFrames` | `integer` | no | one of several alternative parameters |
| `edge` | `"in" \| "out"` | no |  |
| `mode` | `"regular" \| "ripple"` | no |  |
| `snap` | `any` | no | "markers"\|"beats"\|["markers","beats"]? |
| `toleranceFrames` | `integer` | no |  |

## Call through film_run

```text
film_run {
  "path": "<file>.kfilm",
  "steps": [{ "command": "timeline.trim" }]
}
```

The required parameters, with placeholders for their types: not a tested example. Optional: `clip`, `delta`, `deltaFrames`, `edge`, `mode`, `snap`, `toleranceFrames`. film_run answers the step’s result in `completed[i].result`.

## Result

The kit gives no result schema for this command.

## Parameter schema

```json
{
  "additionalProperties": false,
  "properties": {
    "clip": {
      "type": "integer",
      "x-khp-types": [
        "Clip"
      ]
    },
    "delta": {
      "description": "ticks (254016000000 per second); one of several alternative parameters",
      "type": "integer"
    },
    "deltaFrames": {
      "description": "one of several alternative parameters",
      "type": "integer"
    },
    "edge": {
      "enum": [
        "in",
        "out"
      ],
      "type": "string"
    },
    "mode": {
      "enum": [
        "regular",
        "ripple"
      ],
      "type": "string"
    },
    "snap": {
      "description": "\"markers\"|\"beats\"|[\"markers\",\"beats\"]?"
    },
    "toleranceFrames": {
      "default": 3,
      "type": "integer"
    }
  },
  "type": "object"
}
```

Generated from the command list of @kition/film-darwin-arm64@0.1.0 and the kit itself (film_commands through @kition/cli@0.1.1, built from KitionAI/kition-film@375db59).
