append-text-to-file
Append Text To File
Input Parameters
| Parameter | Required | Description | Example |
|---|---|---|---|
file_path |
Yes | Path to the file to update | ~/Downloads/poem.txt |
new_content |
Yes | The text content to append to the file | And as the algorithms learn and grow, |
| Through neural networks, row by row, | |||
| We stand together, human and machine, | |||
| Building worlds we've never seen. | |||
preserve_formatting |
No | Whether to maintain existing line breaks and spacing | true |
Procedure
- Locate the target file using
findcommand or ask user for file path if not provided - Retrieve the current file content to understand context and formatting
- Prepare the new content to append, ensuring it matches the existing style and format
- Append the new content to the file using
write_filetool with the combined original + new content - Verify the file was updated by checking file size and displaying the appended section
- Confirm success with user, showing what was added
Output
Updated file with appended content. Returns confirmation message with file size change (bytes before/after) and preview of the newly added text.
Reference Commands
cat {{FILE_PATH}} && echo '{{NEW_CONTENT}}' >> {{FILE_PATH}}
Example
add another verse to the poem file
append a new section to the document
update the file with additional content
add a closing paragraph to the text file
extend the story with one more chapter
Notes
- Always retrieve and display the current file content before appending to understand context
- Ensure new content matches the existing formatting, style, and tone
- Use write_file tool rather than shell append (>>) for reliable file handling
- Consider asking user for clarification on placement if file has multiple sections
More from dalehurley/phpbot
desktop-control
Control the mouse, keyboard, and read screen content via accessibility. Use this skill when the user asks to click somewhere on screen, type text into an app, move the mouse, press keyboard shortcuts, read what's on screen, get the accessibility tree of the current window, automate desktop interactions, or control the computer.
39summarize-unread-emails
Retrieve and summarize all unread emails from your inbox, organized by category, sender, and date. Use this skill when the user asks to summarize unread emails, get an overview of unread messages, organize inbox emails, or review pending email communications. Provides a structured summary with categorization and timeline analysis.
20open-application
Open or launch applications on your computer by name. Use this skill when the user asks to open, launch, or start an application like Mail, Finder, Safari, Chrome, or any other installed macOS application. Works with both built-in and third-party applications.
10homebrew
Install, manage, and search for software packages on macOS using Homebrew. Use this skill when the user asks to install software, apps, CLI tools, developer utilities, programming languages, databases, or any package on a Mac. Supports formulae (CLI tools) and casks (GUI apps). Can also search, update, upgrade, uninstall, and diagnose Homebrew issues.
10csv-tools
Parse, query, filter, sort, transform, and summarize CSV and JSON data files. Use this skill when the user asks to view a CSV, filter data, get statistics from a data file, convert CSV to JSON or vice versa, sort data, or analyze tabular data.
9get-weather-forecast
Retrieve current weather conditions and multi-day forecasts for any location using the wttr.in API. Use this skill when the user asks for weather information, weather forecast, current conditions, temperature, or weather updates for a specific city or location. Provides detailed weather data including temperature, wind, precipitation, and visibility.
8