CLI आनी SDK

@sketchie/sdk TypeScript क्लायंट आनी sketchie कमांड लायन तेच HTTP API वयर पातळ, टायप केल्ले wrapper आसात. दोनूय SKETCHIE_API_KEY वयल्यान तुमची कि वाचतात आनी मूळपणान https://sketchie.ai/api कडेन वता.

SDK आनी CLI Sketchie साधन संचाचो एक वांटो म्हूण धाडतात. जर तुमची रजिस्ट्री अजून पॅकेज सोडयना, तर तुमी bun वांगडा Sketchie रिपॉझिटरी वयल्यान चलोवं येता. कच्चें HTTP API आयज कोणत्याय भाशेवयल्यान काम करता.

TypeScript SDK

एक क्लायंट तयार करात, मैत्रीपूर्ण फील्डां सयत स्पश्टीकरण तयार करात, आनी रेंडराची वाट पळयात.

sketchie.ts
import { SketchieClient } from '@sketchie/sdk';

const client = new SketchieClient({
  apiKey: process.env.SKETCHIE_API_KEY, // Bearer sk_...
  // baseUrl defaults to https://sketchie.ai/api
});

// Friendly fields: input (the topic) and length ("M:SS", a multiple of 30).
const created = await client.createExplainer({
  input: 'Explain how DNS resolves a domain name',
  length: '0:30',
  aspect: '16:9',
});

// Poll until the render finishes (or fails).
const done = await client.waitForExplainer(created.id, {
  onUpdate: (e) => console.log(e.status),
});

console.log(done.videoUrl);   // the rendered MP4
console.log(done.sceneGraph); // the editable scene graph

संपादन आनी परत-रेंडर लूप

संपादनक्षमता wedge: पुराय जाल्लें स्पश्टीकरण आपली sceneGraph परत दिता. आनीक एक फुकट व्हिडियो तयार करपाची जागा वापरनासतना एक आवृत्ती जोडपाक editExplainerGraph सयत कमिट करात, वा सोंपी भाशेंत सूचोवणी धाडात. दर व्हिडियोचो पयलो परत-रेंडर फुकट. उपरांतचे परत-रेंडर पगार येवजणेचे मिणूट वापरतात.

edit.ts
// After a video is ready you get back its editable sceneGraph.
// Edit it, then append a new version to the existing explainer.
const edited = editScenes(done.sceneGraph!); // your UI edits the graph
const rerender = await client.editExplainerGraph(done.id, edited);
await client.waitForVersion(done.id, rerender.id);

// Or apply a plain-language instruction (a targeted re-render):
const version = await client.editExplainer(done.id, 'make scene 2 shorter');
await client.waitForVersion(done.id, version.id);

आवाज वळेरी करप

voices.ts
const voices = await client.listVoices();
// [{ id: 'sketchie:sulafat', name: 'Nora', isDefault: true, preview_url, ... }]

हेर पद्दती: getExplainer, listExplainers, revertExplainer, duplicateExplainer, आनी deleteExplainer.

कमांड लायन

Terminal
# Discover voices
sketchie voices

# Generate (returns the queued record immediately)
sketchie generate "Explain how DNS resolves a domain name" --length 0:30 --aspect 16:9

# Generate and wait for the finished render
sketchie generate "Explain how DNS resolves" --length 1:00 --wait

# Status of an existing explainer
sketchie status <id>

# Conversational edit (a targeted re-render)
sketchie edit <id> "make the title scene shorter" --wait

# List your explainers
sketchie list --limit 20

फ्लॅग आनी वातावरण

फ्लॅगअर्थ
--length <M:SS|sec> लक्ष्य लांबाय, देखीक 0:30, 1:00, वा सेकंद. 30 चो सकारात्मक गुणाकार. ऑटोखातीर सोडात.
--aspect <ratio> 16:9 (मूळ), 9:16, वा 1:1.
--voice <ref> एक आवाज ref (पळयात sketchie voices). पर्याय; मूळ Nora.
--limit <n> list खातीर म्हाकडेच वळी, 1 ते 100 (मूळ 50).
--wait रेंडर पुराय वा अपेशी जायना मेरेन पोल करता.
--json stdout वयर यंत्र-वाचपी आउटपुट.
--api-url <url> /api प्रीफिक्स सयत API बेस URL. Env: SKETCHIE_API_URL.
--api-key <key> तुमची API कि. Env: SKETCHIE_API_KEY. आउटपुटांत केन्नाच प्रिंट जायना.