Skip to content

Nyxz1828/Remote_Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FakeOpenClaw

FakeOpenClaw is a command-based AI agent that can receive prompts from the terminal or Google Sheets, ask an OpenRouter model what to do next, execute one command at a time, and write AI replies back to a Google Sheets reply log.

Table Of Contents

Project Files

  • main.py: Main agent loop.
  • Agent.md: System rules for how the AI must respond.
  • Skill.md: List of available tool skills and command examples.
  • google_sheet.py: Google Sheets input, output, and sheet operation helpers.
  • google.py: Original Google Sheets prompt helper.
  • sele.py: Selenium browser control implementation.
  • google.json: Google service account credentials file.
  • downloads/: Local download and screenshot folder.

Setup

  1. Install Python dependencies used by the project:
pip install openrouter gspread google-auth selenium yt-dlp python-dotenv
  1. Put your Google service account JSON credentials in:
google.json
  1. Set your OpenRouter API key:
$env:OPENROUTER_API_KEY="your_openrouter_api_key"
  1. Optional: choose a model. If omitted, main.py uses openai/gpt-5.4.
$env:OPENROUTER_MODEL="openai/gpt-5.4"

Google Sheets Setup

  1. Create or open a Google Sheet.
  2. Share the sheet with the service account email inside google.json.
  3. Set the spreadsheet id:
$env:GOOGLE_SHEET_ID="your_google_sheet_id"
  1. Create these worksheets:
  • Cy: prompt input queue.
  • reply: AI reply log.
  • Schedule: allowed AI sheet workspace.
  • Financial: allowed AI sheet workspace.
  • Sheet1: allowed AI sheet workspace.

Default cells and sheets:

  • Prompt sheet: Cy
  • Prompt cell: I2
  • Reply sheet: reply
  • Poll interval: 5 seconds
  • Sheet download folder: C:\Users\<user>\Downloads

Useful optional environment variables:

$env:GOOGLE_SHEET_NAME="Cy"
$env:GOOGLE_PROMPT_CELL="I2"
$env:GOOGLE_REPLY_SHEET_NAME="reply"
$env:GOOGLE_POLL_SECONDS="5"
$env:GOOGLE_DOWNLOAD_DIR="C:\Users\User\Downloads"

Run The Agent

Run with terminal input:

python main.py

Run with Google Sheets input:

$env:GOOGLE_SHEET_ID="your_google_sheet_id"
$env:OPENROUTER_API_KEY="your_openrouter_api_key"
python main.py

When Google Sheets input is enabled, put the user prompt in Cy!I2. The program waits until that cell has text.

How It Functions

  1. main.py builds a system prompt by combining Agent.md and Skill.md.
  2. It reads user input from Google Sheets if GOOGLE_SHEET_ID is set.
  3. Otherwise, it reads user input from the terminal.
  4. It sends the conversation to OpenRouter.
  5. The AI must reply with either:
COMMAND: {...}

or:

DONE: final answer
  1. If the reply is a command, main.py executes it and sends the result back to the AI.
  2. Every raw AI reply is appended to the reply worksheet.
  3. When the AI returns DONE, main.py removes everything below the header row in Cy.
  4. The program then waits for the next prompt.

Skills Available

Google Prompt Input

  • Reads prompts from Cy!I2 when GOOGLE_SHEET_ID is set.
  • Appends AI replies to the reply worksheet.
  • Clears all rows below the Cy header after one prompt finishes.

Google Sheets Control

Allowed worksheets for AI sheet commands:

  • Schedule
  • Financial
  • Sheet1

Supported sheet commands:

{"type": "sheet", "action": "read", "range": "A1:D10"}
{"type": "sheet", "action": "read"}
{"type": "sheet", "action": "update_cell", "cell": "A2", "value": "new value"}
{"type": "sheet", "action": "update_range", "range": "A2:B3", "values": [["A2", "B2"], ["A3", "B3"]]}
{"type": "sheet", "action": "append_row", "values": ["col 1", "col 2", "col 3"]}
{"type": "sheet", "action": "clear", "range": "A2:D20"}
{"type": "sheet", "action": "download", "format": "csv"}
{"type": "sheet", "action": "download", "format": "json"}

If worksheet_name is omitted, the command uses Schedule.

Browser Control

Supported browser commands include:

{"type": "browser", "action": "open_google"}
{"type": "browser", "action": "search", "query": "search words"}
{"type": "browser", "action": "open_youtube"}
{"type": "browser", "action": "open_youtube_video", "url": "https://www.youtube.com/watch?v=VIDEO_ID"}
{"type": "browser", "action": "read_page"}
{"type": "browser", "action": "screenshot", "path": "downloads/page.png"}

Shell Commands

The AI can run shell commands for local files and command-line tools:

{"type": "shell", "command": "yt-dlp -F \"YOUTUBE_URL\""}

Google Sheets Rules

  • Cy is only for prompt input.
  • AI sheet commands must not modify Cy.
  • AI sheet commands are restricted in code to Schedule, Financial, and Sheet1.
  • AI replies are stored in the reply worksheet.
  • Downloads from sheet commands go to the Windows Downloads folder by default.

Flowchart

flowchart TD
    A[Start main.py] --> B[Load Agent.md and Skill.md]
    B --> C{GOOGLE_SHEET_ID set?}
    C -- No --> D[Read prompt from terminal]
    C -- Yes --> E[Wait for prompt in Cy!I2]
    E --> F[Send prompt to OpenRouter]
    D --> F
    F --> G[Receive AI reply]
    G --> H[Append AI reply to reply sheet]
    H --> I{Reply type}
    I -- COMMAND --> J[Parse command JSON]
    J --> K{Command type}
    K -- shell --> L[Run shell command]
    K -- browser --> M[Run Selenium browser action]
    K -- sheet --> N[Validate worksheet is Schedule, Financial, or Sheet1]
    N --> O[Run Google Sheets action]
    L --> P[Send command result back to AI]
    M --> P
    O --> P
    P --> F
    I -- DONE --> Q[Remove all rows below header in Cy]
    Q --> R[Wait for next prompt]
    R --> C
Loading

Troubleshooting

  • If the terminal says it is waiting for Cy!I2, add a prompt to that cell.
  • If Google Sheets access fails, make sure the sheet is shared with the service account email from google.json.
  • If the AI tries to modify Cy, main.py rejects the command.
  • If Google returns a read quota error, the program waits before retrying.
  • If .env parsing warns, use normal dotenv format instead of PowerShell syntax inside .env:
GOOGLE_SHEET_ID=your_google_sheet_id
OPENROUTER_API_KEY=your_openrouter_api_key

About

An AI Agent which acted similar to OpenClaw can be editing Exel, Words, And connected through a messaging APP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages