@@ -141,23 +141,24 @@ main()
141141Loads agent definitions from ` .agents ` directories on disk.
142142
143143``` typescript
144- import { loadLocalAgents } from ' @codebuff/sdk'
144+ import { loadLocalAgents , CodebuffClient } from ' @codebuff/sdk'
145145
146146// Load from default locations (.agents in cwd, parent, or home)
147147const agents = await loadLocalAgents ({ verbose: true })
148148
149- // Load from a specific directory
150- const agents = await loadLocalAgents ({ agentsPath: ' ./my-agents' })
149+ // Or load from a specific directory
150+ // const agents = await loadLocalAgents({ agentsPath: './my-agents' })
151151
152- // Load and validate agents (invalid agents are filtered out)
153- const agents = await loadLocalAgents ({ validate: true , verbose: true })
152+ // Or load and validate agents (invalid agents are filtered out)
153+ // const agents = await loadLocalAgents({ validate: true, verbose: true })
154154
155155// Access source file path for debugging
156156for (const agent of Object .values (agents )) {
157157 console .log (` ${agent .id } loaded from ${agent ._sourceFilePath } ` )
158158}
159159
160160// Use the loaded agents with client.run()
161+ const client = new CodebuffClient ({ apiKey: process .env .CODEBUFF_API_KEY })
161162const result = await client .run ({
162163 agent: ' my-custom-agent' ,
163164 agentDefinitions: Object .values (agents ),
0 commit comments