Uh oh!
There was an error while loading. Please reload this page.
forked from MervinPraison/PraisonAI
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcursor_cli_example.py
More file actions
Latest commit
37 lines (30 loc) · 982 Bytes
/
Copy pathcursor_cli_example.py
File metadata and controls
37 lines (30 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
"""
Cursor CLI Integration Example
Demonstrates how to use Cursor CLI as an agent tool in PraisonAI.
"""
importasyncio
frompraisonai.integrationsimportCursorCLIIntegration
asyncdefmain():
# Create Cursor CLI integration
cursor=CursorCLIIntegration(
workspace=".",
output_format="json",
force=True,
model="gpt-4o",
stream_partial=True
)
# Check availability
print(f"Cursor CLI available: {cursor.is_available}")
print(f"Force mode: {cursor.force}")
print(f"Model: {cursor.model}")
# Execute a coding task
result=awaitcursor.execute("List files in the current directory")
print(f"Result: {result}")
# Stream output
print("\nStreaming output:")
asyncforeventincursor.stream("Explain the project"):
content=event.get("content", "")
ifcontent:
print(content, end="", flush=True)
if__name__=="__main__":
asyncio.run(main())