host-file-editing

Read, write, and patch files on the A0 CLI host machine remotely.

19.1k|3.8k|Updated Jun 10, 2024
One-click install
npx skills add https://github.com/agent0ai/agent-zero --skill host-file-editing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: host-file-editing
Source: https://github.com/agent0ai/agent-zero/tree/main/plugins/_a0_connector/skills/host-file-editing
Command: npx skills add https://github.com/agent0ai/agent-zero --skill host-file-editing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When Agent Zero runs inside Docker or on a server, it cannot directly touch files on the user's local machine. This Skill guides safe use of the text_editor_remote tool so the agent can inspect and edit files on the connected A0 CLI host without confusing them with server-side files.

Core Features & Use Cases

  • Remote file inspection: Read files on the machine where A0 CLI is running, keeping a clear boundary from Docker/server files.
  • Precise patching: Apply exact replacements with old_text/new_text, context-anchored patch_text hunks, or line-range edits based on the latest remote read.
  • Access mode handling: Respect Read only versus Read&Write modes, recover from stale-edit rejections by rereading, and handle CLI disconnects gracefully.
  • Use Case: A user asks the agent to fix a typo in a config file on their laptop. The agent reads the file via text_editor_remote, applies a context-anchored patch, and confirms the change without touching the container filesystem.

Quick Start

Ask the agent to read and update a specific file on your local computer through the connected A0 CLI, for example to patch a line in a local configuration file.

Frequently Asked Questions about host-file-editing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I edit files on my local machine from Agent Zero?

Connect A0 CLI to your Agent Zero instance, then ask the agent to edit the local file. The agent uses text_editor_remote to read, write, or patch files on the CLI host rather than inside the Docker container.

How do I patch a file remotely without replacing the whole file?

Use patch with old_text and new_text for exact replacements, or patch_text with an @@ anchor line plus + and - prefixed lines for context-anchored edits. Line-range edits with the edits parameter work when based on the latest remote read.

Why are my remote file writes blocked in Agent Zero?

Writes are blocked when local file access is set to Read only mode. Switch the A0 CLI local file access to Read&Write by pressing F3, then retry the write or patch operation.

What happens when a remote patch is rejected as stale?

A stale rejection means the file changed since the last read, so line numbers no longer match. Reread the file with text_editor_remote and retry the patch using the updated line ranges.

When should I use server-side file tools instead of text_editor_remote?

Use server-side tools whenever the task belongs inside Agent Zero's own runtime or Docker container. Reserve text_editor_remote strictly for files on the machine where A0 CLI is running.