Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:0xsline OpenChatCut CLI Clip Ref

From Leeroopedia
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