agentleFS
nasroykhnasroykh/foxmayn_frappe_cli/skills/ffc-files-collab/SKILL.md

ffc-files-collab

Skill16 starsChanged 37 days agoMITView on GitHub

Work with what surrounds a Frappe/ERPNext document using ffc - upload and attach files, list attachments, download files, save a print as PDF, add comments, assign users, add or remove tags, share or unshare, and read a document's history (who changed which field, comments, linked documents, timeline) with ffc doc-info. Use it whenever the user wants to attach or fetch a file, print an invoice to PDF, comment on or assign a record, tag or share it, or asks "who changed this and when", even without naming ffc. Read ffc-core first for flags and safety rules.

The file

Files
SKILL.md

Files, PDFs, collaboration and document history

Users are User IDs (usually emails), not full names. Every write here takes --dry-run; reads (attachments, download, pdf, doc-info) do not.

Files

ffc upload contract.pdf -d Customer -n "ACME Corp" --json             # private by default
ffc upload logo.png -d Item -n ITEM-001 --field image --public --json  # also sets Item.image
cat notes.txt | ffc upload - --filename notes.txt -d ToDo -n TD-0001
ffc attachments -d Customer -n "ACME Corp" --json
ffc download /private/files/contract.pdf -o contract.pdf              # --force to replace, -o - for stdout
ffc pdf -d "Sales Invoice" -n SINV-0001 --format "Standard" --no-letterhead -o inv.pdf

upload FILE (- = stdin, then --filename is required): -d, -n (required), --public (default private: only users who may read the document), --folder (default Home/Attachments), --field F (also sets that Attach field: a second request), --dry-run (shows name and size, never content).

  • The document must exist. A file over the site's Max File Size (25 MiB unless System Settings says otherwise) is refused before sending (exit 6); the site's allowed extensions apply. Uploads are never retried. Stdin is read into memory, up to 128 MiB.

attachments: -d, -n (required), -l (default 100, 0 = all), --all, --page-size. Rows: name, file_name, file_url, is_private, file_size, attached_to_field, folder, creation, oldest first.

download FILE_URL: /files/..., /private/files/... or a full URL of the configured site itself (another host is refused, exit 2). -o/--output-file (default: the file's name in the current directory; - = stdout, binary refused on a terminal), --force. Written through a temp file, so an interrupted download leaves nothing. A missing private file and a forbidden one are both 403 (exit 5).

pdf: -d, -n (required), --format (Print Format), --letterhead NAME or --no-letterhead, --lang (e.g. fr), -o/--output-file (default <name>.pdf, - = stdout except on a terminal), --force. Only a real PDF is saved. Frappe v16 limits concurrent PDFs: a 503 is retried twice. A 500 OSError means the site's wkhtmltopdf failed (site-side problem). Raise --timeout for long documents.

Collaboration

ffc comment -d Task -n TASK-0042 "Waiting for the PO" --json
git log -1 --format=%B | ffc comment -d Task -n TASK-0042 -
ffc assign -d Task -n TASK-0042 --to jane@example.com,bob@example.com --priority High --date 2026-11-01 --json
ffc unassign -d Task -n TASK-0042 --to bob@example.com --json
ffc tag -d Customer -n "Acme Ltd" vip export --json
ffc untag -d Customer -n "Acme Ltd" VIP --json
ffc share -d Project -n PROJ-0001 --user jane@example.com --write --dry-run --json
ffc unshare -d Project -n PROJ-0001 --user jane@example.com --json
CommandFlagsBehaviour
comment TEXT-d, -n, --htmlplain text escaped (line breaks kept); - reads stdin; --html sends HTML (Frappe sanitises). @mentions in plain text notify no one
assign-d, -n, --to (CSV, required), --priority Low/Medium/High, --date YYYY-MM-DD, --descriptionone open ToDo per user; already assigned is reported, not duplicated; Frappe notifies and shares read-only with an assignee who cannot read the document
unassign-d, -n, --tocancels the users' open ToDos; not assigned is reported
tag TAG...-d, -nneeds write permission; no commas in a tag; existing tag (same case) reported
untag TAG...-d, -ncase-insensitive; missing tag reported; Tag records stay
share-d, -n, --user or --everyone, --write, --submit, --share, --notify, -yread always granted; sharing again replaces that share's rights; widens access, so it asks unless --yes
unshare-d, -n, --user or --everyoneremoves the share; role-based access unchanged

Each command reads the current state first and reports it (e.g. assigned/already_assigned, added/already_tagged, the share's rights).

Document history: doc-info

ffc doc-info -d "Sales Invoice" -n ACC-SINV-2026-00001 --json             # versions, comments, files, assignments, shares, tags, workflow log
ffc doc-info -d "Sales Invoice" -n ACC-SINV-2026-00001 --links --json     # + linked document counts per DocType
ffc doc-info -d ToDo -n TD-0001 --timeline --json                         # + activity timeline (Frappe releases from 2026)
ffc doc-info -d Customer -n "Acme" --onload --json                        # + __onload (e.g. billing this year); WRITES a view log
  • Reads get_docinfo, which changes nothing. --onload loads the form like the desk: it adds a View Log / seen mark and runs the controller's onload, so ask first.
  • JSON keys: doctype, name, permissions, versions ({name, by, at, changed:[{field, from, to}], rows_added, rows_removed, impersonated_by}, newest first, last 10, only with Track Changes), comments ({name, by, at, text}), communications, attachments, assignments, shares, tags, workflow_log, links ({doctype, count, open_count, capped, timed_out, internal, names}), timeline, onload, notes.
  • A child-row change shows as items[2].qty. Version values are formatted strings, not numbers. Fields the user may not read are left out of versions and counted in hidden_fields.
  • Link counts come from the DocType's dashboard, stop at 100 (capped) and ignore permissions. A DocType without a dashboard has no links: use list-docs --filters on the linking DocType. "link counts timed out" in notes means links is absent, not empty.
  • --full prints the raw responses (JSON only). For Single DocTypes -n can be omitted.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.