create_text_file
Generate or overwrite text files with specified content using symbolic operations for precision. Ideal for managing file creation and editing in large code bases.
Instructions
Write a new file (or overwrite an existing file). For existing files, it is strongly recommended to use symbolic operations like replace_symbol_body or insert_after_symbol/insert_before_symbol, if possible. You can also use insert_at_line to insert content at a specific line for existing files if the symbolic operations are not the right choice for what you want to do.
If ever used on an existing file, the content has to be the complete content of that file (so it may never end with something like "The remaining content of the file is left unchanged."). For operations that just replace a part of a file, use the replace_lines or the symbolic editing tools instead. Returns a message indicating success or failure.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
content | Yes | The (utf-8-encoded) content to write to the file. | |
relative_path | Yes | The relative path to the file to create. |