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 Store

From Leeroopedia
Knowledge Sources
Domains CLI, Storage
Last Updated 2026-10-22 14:00 GMT

Overview

Read-side project library access for the CLI that lists, resolves, and reads projects using the same store entry points as the app and MCP server.

Description

The CLI Store module lists and resolves projects via `listExternalProjects` and `createExternalProject`. Resolves project references by exact id, unique prefix, or unique name (ambiguity is an error). Reads stored documents through `getStoredEntry` and runs project migrations for normalization. No edit session needed for reads.

Usage

  • CLI project commands: Used by `occ project` and other CLI commands for project access.

Code Reference

Source Location

  • Repository: OpenChatCut
  • File: cli/store.ts
  • Lines: 1-100

Signature

export function listProjects(): Promise<ProjectSummary[]>;
export function resolveProject(ref: string): Promise<ProjectSummary>;
export function readProjectDoc(projectId: string): Promise<ProjectDoc>;
export function createProject(name: string): Promise<ProjectSummary>;

Import

import { listProjects, resolveProject, readProjectDoc, createProject } from './store.ts';

I/O Contract

Inputs

Name Type Required Description
ref string Yes Project reference (id, prefix, or name)
projectId string Yes Project ID
name string Yes New project name

Outputs

Name Type Description
listProjects() returns Promise<ProjectSummary[]> All projects
resolveProject() returns Promise<ProjectSummary> Resolved project (throws on ambiguity)
readProjectDoc() returns Promise<ProjectDoc> │ Project document

Usage Examples

Listing and Reading Projects

import { listProjects, readProjectDoc } from './store.ts';

const projects = await listProjects();
for (const p of projects) console.log(p.id, p.name);

const doc = await readProjectDoc(projects[0].id);

Related Pages

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment