Implementation:0xsline OpenChatCut CLI Clip Ref
Appearance
| Knowledge Sources | |
|---|---|
| Domains | CLI, Editing |
| Last Updated | 2026-10-22 14:00 GMT |
Overview
Clip reference resolver for `occ item` commands that searches timelines by id, prefix, or name with ambiguity detection to prevent editing the wrong clip.
Description
The CLI Clip Ref module resolves clip references across all timelines and items. It searches for exact id match, unique id prefix, or unique name. Ambiguity (multiple matches) is an error listing candidates, preventing silent data damage from editing the wrong clip.
Usage
- CLI item commands: Used by `occ item` subcommands to resolve clip targets safely.
Code Reference
Source Location
- Repository: OpenChatCut
- File: cli/clip-ref.ts
- Lines: 1-42
Signature
export function resolveClipRef(doc: ProjectDoc, ref: string): { timelineId: string; itemId: string };
Import
import { resolveClipRef } from './clip-ref.ts';
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| doc | ProjectDoc | Yes | Project document with timelines |
| ref | string | Yes | Clip reference (id, prefix, or name) |
Outputs
| Name | Type | Description |
|---|---|---|
| resolveClipRef() returns | { timelineId, itemId } | Resolved clip location |
Usage Examples
Resolving a Clip Reference
import { resolveClipRef } from './clip-ref.ts';
const { timelineId, itemId } = resolveClipRef(doc, 'intro');
// Throws if 'intro' matches multiple clips
Related Pages
Requires Environment
Page Connections
Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment