π fwrite
Atomic file creation
Section titled βAtomic file creationβfwrite is part of the fsuite toolkit β a set of fourteen CLI tools built for AI coding agents.
fwrite is the MCP-only atomic file creation tool. It writes or overwrites a file from a string payload. Not available as a CLI binary β agents call it directly through the fsuite MCP server.
Decision rule:
- Brand-new file β
fwrite - Replacing an entire file end-to-end β
fwrite - Any surgical change (line range, symbol, anchor) β
fedit
fedit has analogous functionality (fedit --create, fedit --replace-file) for CLI users without MCP β but if youβre already on the MCP transport, fwrite is one call instead of two flags.
Usage notes
Section titled βUsage notesβThe block below is the script header from the fwrite source β usage, flags, and exit codes documented inline. (Unlike most fsuite tools, fwriteβs primary surface is the MCP tool definition, not a --help flag, so this section captures the script comments rather than runtime help text.)
# modifications. This is the "create" counterpart to fedit's "modify."## Usage:# fwrite <path> --content <text> Create new file# fwrite <path> --content <text> --overwrite Overwrite existing# fwrite <path> --stdin Read content from stdin# fwrite <path> --from <source> Copy from source file## Flags:# --content <text> File content (required unless --stdin or --from)# --overwrite Allow overwriting existing files (default: deny)# --stdin Read content from stdin (for piping)# --from <path> Copy content from another file# --mkdir Create parent directories (default: true)# --no-mkdir Don't create parent directories# --dry-run Show what would happen without writing# --json Output result as JSON# -q, --quiet Suppress output, exit code only## Exit codes:# 0 Success# 1 Missing arguments# 2 File exists (no --overwrite)# 3 Parent directory doesn't exist (--no-mkdir)# 4 Write failed# 5 Source file not found (--from)# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
set -euo pipefailSee also
Section titled βSee alsoβ- fsuite mental model β how fwrite fits into the toolchain
- Cheat sheet β one-line recipes for every tool
- View source on GitHub