Files
oh-my-pi/packages/coding-agent/examples/sdk/01-minimal.ts
T
can1357 790a5370bb feat: renamed binary from pi to omp with config migration support
- Renamed CLI binary and package from 'pi' to 'omp' across all platforms and installers.
- Changed environment variable prefix from PI_* to OMP_* with automatic migration support.
- Changed configuration directory from ~/.pi/ to ~/.omp/ with multi-path fallback discovery.
- Added getConfigDirPaths(), findConfigFile(), and readConfigFile() functions for config resolution across .omp, .pi, and .claude directories.
2026-01-03 15:54:45 +01:00

23 lines
629 B
TypeScript

/**
* Minimal SDK Usage
*
* Uses all defaults: discovers skills, hooks, tools, context files
* from cwd and ~/.omp/agent. Model chosen from settings or first available.
*/
import { createAgentSession } from "@oh-my-pi/pi-coding-agent";
const { session } = await createAgentSession();
session.subscribe((event) => {
if (event.type === "message_update" && event.assistantMessageEvent.type === "text_delta") {
process.stdout.write(event.assistantMessageEvent.delta);
}
});
await session.prompt("What files are in the current directory?");
session.state.messages.forEach((msg) => {
console.log(msg);
});
console.log();