mirror of
https://github.com/trycua/computer.git
synced 2026-02-18 04:19:38 -06:00
Add missing line breaks and fix code blocks in MDX
This commit is contained in:
@@ -13,16 +13,20 @@ Execute shell commands and get detailed results:
|
||||
|
||||
<Tabs items={['Python', 'TypeScript']}>
|
||||
<Tab value="Python">
|
||||
|
||||
```python
|
||||
# Run shell command result = await
|
||||
computer.interface.run_command(cmd) # result.stdout, result.stderr, result.returncode
|
||||
# Run shell command
|
||||
result = await computer.interface.run_command(cmd) # result.stdout, result.stderr, result.returncode
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="TypeScript">
|
||||
|
||||
```typescript
|
||||
// Run shell command const result = await
|
||||
computer.interface.runCommand(cmd); // result.stdout, result.stderr, result.returncode
|
||||
// Run shell command
|
||||
const result = await computer.interface.runCommand(cmd); // result.stdout, result.stderr, result.returncode
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -32,6 +36,7 @@ Precise mouse control and interaction:
|
||||
|
||||
<Tabs items={['Python', 'TypeScript']}>
|
||||
<Tab value="Python">
|
||||
|
||||
```python
|
||||
# Basic clicks
|
||||
await computer.interface.left_click(x, y) # Left click at coordinates
|
||||
@@ -50,6 +55,7 @@ Precise mouse control and interaction:
|
||||
|
||||
</Tab>
|
||||
<Tab value="TypeScript">
|
||||
|
||||
```typescript
|
||||
// Basic clicks
|
||||
await computer.interface.leftClick(x, y); // Left click at coordinates
|
||||
@@ -75,6 +81,7 @@ Text input and key combinations:
|
||||
|
||||
<Tabs items={['Python', 'TypeScript']}>
|
||||
<Tab value="Python">
|
||||
|
||||
```python
|
||||
# Text input
|
||||
await computer.interface.type_text("Hello") # Type text
|
||||
@@ -88,6 +95,7 @@ Text input and key combinations:
|
||||
|
||||
</Tab>
|
||||
<Tab value="TypeScript">
|
||||
|
||||
```typescript
|
||||
// Text input
|
||||
await computer.interface.typeText("Hello"); // Type text
|
||||
@@ -108,20 +116,24 @@ Mouse wheel and scrolling control:
|
||||
|
||||
<Tabs items={['Python', 'TypeScript']}>
|
||||
<Tab value="Python">
|
||||
|
||||
```python
|
||||
# Scrolling
|
||||
await computer.interface.scroll(x, y) # Scroll the mouse wheel
|
||||
await computer.interface.scroll_down(clicks) # Scroll down await
|
||||
computer.interface.scroll_up(clicks) # Scroll up
|
||||
await computer.interface.scroll_down(clicks) # Scroll down
|
||||
await computer.interface.scroll_up(clicks) # Scroll up
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="TypeScript">
|
||||
```typescript
|
||||
// Scrolling
|
||||
await computer.interface.scroll(x, y); // Scroll the mouse wheel
|
||||
|
||||
```typescript
|
||||
// Scrolling
|
||||
await computer.interface.scroll(x, y); // Scroll the mouse wheel
|
||||
await computer.interface.scrollDown(clicks); // Scroll down
|
||||
await computer.interface.scrollUp(clicks); // Scroll up
|
||||
await computer.interface.scrollUp(clicks); // Scroll up
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -131,21 +143,22 @@ Screen capture and display information:
|
||||
|
||||
<Tabs items={['Python', 'TypeScript']}>
|
||||
<Tab value="Python">
|
||||
```python
|
||||
# Screen operations
|
||||
await computer.interface.screenshot() # Take a screenshot
|
||||
await computer.interface.get_screen_size() # Get screen dimensions
|
||||
|
||||
```python
|
||||
# Screen operations
|
||||
await computer.interface.screenshot() # Take a screenshot
|
||||
await computer.interface.get_screen_size() # Get screen dimensions
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="TypeScript">
|
||||
```typescript
|
||||
// Screen operations
|
||||
await computer.interface.screenshot(); // Take a screenshot
|
||||
await computer.interface.getScreenSize(); // Get screen dimensions
|
||||
|
||||
|
||||
```typescript
|
||||
// Screen operations
|
||||
await computer.interface.screenshot(); // Take a screenshot
|
||||
await computer.interface.getScreenSize(); // Get screen dimensions
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
@@ -155,20 +168,20 @@ System clipboard management:
|
||||
|
||||
<Tabs items={['Python', 'TypeScript']}>
|
||||
<Tab value="Python">
|
||||
```python
|
||||
# Clipboard operations await
|
||||
computer.interface.set_clipboard(text) # Set clipboard content await
|
||||
computer.interface.copy_to_clipboard() # Get clipboard content
|
||||
|
||||
```python
|
||||
# Clipboard operations
|
||||
await computer.interface.set_clipboard(text) # Set clipboard content
|
||||
await computer.interface.copy_to_clipboard() # Get clipboard content
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="TypeScript">
|
||||
```typescript
|
||||
// Clipboard operations
|
||||
|
||||
```typescript
|
||||
// Clipboard operations
|
||||
await computer.interface.setClipboard(text); // Set clipboard content
|
||||
await computer.interface.copyToClipboard(); // Get clipboard content
|
||||
|
||||
```
|
||||
|
||||
</Tab>
|
||||
@@ -201,6 +214,7 @@ Direct file and directory manipulation:
|
||||
|
||||
</Tab>
|
||||
<Tab value="TypeScript">
|
||||
|
||||
```typescript
|
||||
# File existence checks
|
||||
await computer.interface.fileExists(path); // Check if file exists
|
||||
@@ -228,20 +242,21 @@ Access system accessibility information:
|
||||
|
||||
<Tabs items={['Python', 'TypeScript']}>
|
||||
<Tab value="Python">
|
||||
```python
|
||||
# Get accessibility tree
|
||||
await computer.interface.get_accessibility_tree()
|
||||
|
||||
```python
|
||||
# Get accessibility tree
|
||||
await computer.interface.get_accessibility_tree()
|
||||
```
|
||||
|
||||
</Tab>
|
||||
<Tab value="TypeScript">
|
||||
```typescript
|
||||
// Get accessibility tree
|
||||
await computer.interface.getAccessibilityTree();
|
||||
|
||||
```
|
||||
</Tab>
|
||||
```typescript
|
||||
// Get accessibility tree
|
||||
await computer.interface.getAccessibilityTree();
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
|
||||
## Delay Configuration
|
||||
@@ -250,6 +265,7 @@ Control timing between actions:
|
||||
|
||||
<Tabs items={['Python']}>
|
||||
<Tab value="Python">
|
||||
|
||||
```python
|
||||
# Set default delay between all actions (in seconds)
|
||||
computer.interface.delay = 0.5 # 500ms delay between actions
|
||||
@@ -269,6 +285,7 @@ Manage Python environments:
|
||||
|
||||
<Tabs items={['Python']}>
|
||||
<Tab value="Python">
|
||||
|
||||
```python
|
||||
# Virtual environment management
|
||||
await computer.venv_install("demo_venv", ["requests", "macos-pyxa"]) # Install packages in a virtual environment
|
||||
@@ -277,4 +294,4 @@ Manage Python environments:
|
||||
```
|
||||
|
||||
</Tab>
|
||||
</Tabs>
|
||||
</Tabs>
|
||||
|
||||
Reference in New Issue
Block a user