import { MorphClient } from '@morphllm/morphsdk';
const morph = new MorphClient({ apiKey: "YOUR_API_KEY" });
// 1. Edit code (10,500 tokens/s)
await morph.fastApply.execute({
target_filepath: 'src/auth.ts',
instructions: 'Add null check',
code_edit: '// ... existing code ...\nif (!user) throw new Error("Invalid");\n// ... existing code ...'
});
// 2. Search code (under 6 seconds)
const results = await morph.warpGrep.execute({
searchTerm: 'Where is JWT validation?',
repoRoot: '.'
});
// 3. Test in browser, return a video and logs
await morph.browser.execute({
task: 'Test login flow',
url: 'https://myapp.e2b.dev',
model: 'gemini-flash-latest' // morph-computer-use-v0 in beta
});
// 4. Version control
await morph.git.push({ dir: './my-project' });