pedit

module
v0.5.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2026 License: MIT

README

pedit — Pair edit your local files.

CI Release OpenSSF Scorecard

https://github.com/user-attachments/assets/14bec9ab-8c14-495c-8faf-9cdd98d8fd5b

pedit is a CLI that lets people edit your local files together in their browsers. Edits are saved back to your file:

❯ pedit notes.md

  notes.md is ready to write together.

  Send this link to the people you want to invite:
    https://edit.piconic.ai/r/<room-id>#<key>

  Press Ctrl+C when you are done. Everything is saved to notes.md.
  To share another file in this room, type its path and press Enter.
  Press Ctrl+L for links that can only comment or read.

  ● Alice and Bob are here

No install or account needed for collaborators on the public server.

People in the room can also comment on text, table cells and canvas nodes; comments never go into the file. The printed link lets people edit; Ctrl+L shows links that let them only comment or only read.

What it looks like. Carol shares a file with pedit; Alice and Bob edit it in their browsers. The first three are Alice's view; the last is Bob's, opened from a comment-only link:

A CSV file as a table, with Alice's selected cell and Bob's selected cell outlined in their colors
Markdown, with a live preview and Bob's cursor CSV as a table, with Bob's selected cell
A canvas file as a board of nodes, edges and a group, with the node Bob has selected outlined
Canvas as a board, with Bob's selected node Comments, from a comment-only link

Why pedit?

Local files work naturally with coding agents and your own editor. Keeping documents in Git makes changes reviewable and preserves their history, but asking someone to clone a repository and open a pull request adds friction to a quick editing session.

pedit lets you invite people into the file with a link and edit together in their browsers. They do not need to set up your development environment. The edits land in the same local file, ready for your next agent task, review or commit.

Install

macOS / Linux:

curl -fsSL https://edit.piconic.ai/install.sh | sh

Windows (PowerShell):

irm https://edit.piconic.ai/install.ps1 | iex

install.ps1 adds the install directory to your user PATH; set PEDIT_NO_MODIFY_PATH=1 to skip that.

install.sh and install.ps1 are served by the relay. To install from GitHub instead, use one of the methods below.

Homebrew (macOS / Linux):

brew install piconic-ai/tap/pedit

mise:

mise use -g github:piconic-ai/pedit

Go 1.25+:

go install github.com/piconic-ai/pedit/cmd/pedit@latest

Binaries: GitHub Releases (macOS / Linux / Windows · amd64 / arm64). Every archive carries a build provenance attestation, which the install scripts check when the GitHub CLI is installed; see verifying releases to check one yourself.

Usage

Sharing a file

Run pedit <file> and send the printed link. Edits are saved to your file as they come in, and if the connection drops, keep pedit running: it reconnects with the same link and merges what was written meanwhile. Ctrl+C saves and leaves.

A room opened from existing files is kept for a day after you leave: the link keeps working, and what guests write while you are away waits on the relay, encrypted. Run pedit notes.md again (or pedit resume) to take their edits in and carry on, pedit rooms to list kept rooms, and pedit close to end one for good (resume and close are not available on Windows yet). --keep 7d keeps it longer (7 days at most on the public relay); --keep 0 opens a room that ends when you leave. See sessions for how reconnecting, saving and kept rooms work.

Joining from the command line

Collaborators who would rather stay in their own editor join from the command line instead. Given the link, pedit mirrors the shared file to a temporary copy and keeps it in sync both ways until they leave or the host closes the room; the copy is removed then, like closing a browser tab:

❯ pedit 'https://edit.piconic.ai/r/<room-id>#<key>'

  Joined. Your copy of the shared file:
    /tmp/pedit-<room-id>-2271/00-notes.md
    Copied to your clipboard.

  Edit it with any editor; changes sync both ways while you are in the room.
  Press Ctrl+C to leave. The copies are temporary and removed then.

Quote the link in the shell: # starts a comment otherwise. Copy out what you want to keep before you leave. A canvas comes as its JSON Canvas, under .json (00-board.json). See sessions for how copies are named and synced.

Several files in one room

Name several files to share them in one room, under one link. Guests switch between them with the tabs above the editor:

❯ pedit agenda.md docs/spec.md board.canvas

While sharing, type the path of another file and press Enter to add it to the room, without a new link: a meeting can start with the agenda and bring in the spec when it comes up. Only the host adds files; nobody in the room can ask for one. A room shares up to 20 files, each a regular UTF-8 file, as when sharing one. Paths are shown relative to the directory pedit runs in.

A guest who joins from the command line gets a copy of each text file in the same temporary directory, including files the host adds later: docs/spec.md is copied to 01-docs-spec.md. Canvases are for the browser.

Comments

In the browser, select some text, a cell of a table (or a whole row or column), or a node of a canvas, and write a comment in the panel beside it. Everyone in the room sees it at once, marked where it points, and can reply or resolve it; resolved threads stay under Resolved, to read again or reopen. You can edit or delete your own comments from their ⋮ menu (deleting asks first). Each file's tab (or its name, in a room of one file) shows how many of its comments are still open, and the speech bubble in the header, or Ctrl/⌘+Alt+M, shows or hides the comments. A comment never goes into the file: the host keeps the comments of each file in .pedit/meta/<path>.json, and the next session shows them again, found by the text, cells or node they pointed at. A comment follows its place as people edit, and says so when that text changed or is gone. A comment goes on up to 1,000 characters of text, or of a cell.

Comments are kept for files inside the project: the directory of .pedit/config.yaml, or the one you run pedit in when there is none. Commit .pedit/meta/ to keep them with the files. See the design for how they are anchored.

Comments from scripts and agents

A script or an AI agent can read and answer comments without a browser. It runs the session itself, with --json, and reads what happens in the room as JSON lines on stdout (messages for people go to stderr):

pedit notes.md --json --name tate-pm &   # {"event":"ready",...}, then
                                          # {"event":"comment","thread":"…","body":"…",...}
pedit comments list                       # the open threads (--all, --json)
pedit comments reply <thread> "Done."     # prints the reply's id
pedit comments resolve <thread>           # or reopen

The pedit comments commands talk to the session running on the same machine, so the agent is one participant, named by --name. An agent that is a guest does the same with pedit <share link> --json. With no session running, pedit comments list --file notes.md lists the comments as the host saved them last. pedit comments --help says more, and the design how it works.

The link pedit prints lets people edit. To let someone only comment, or only read, press Ctrl+L while sharing, or choose Share in the browser's header, and send one of these instead:

  Links with less access:
    Comment only  https://edit.piconic.ai/r/<room-id>#c.<key>
    Read only     https://edit.piconic.ai/r/<room-id>#r.<key>
Link Read the files and comments Write comments Edit the files
Edit ✓ ✓ ✓
Comment only ✓ ✓
Read only ✓

A comment-only link is offered while some file keeps comments. Each link also gives the ones below it, never the ones above, and every peer checks what the others may do, not the relay. A comment-only link also joins from the command line, to read and answer comments (its copies of the files are not sent back); a read-only link opens in a browser.

Configuration and templates

Run pedit at a Git repository root to create .pedit/config.yaml and .pedit/templates/ with editable Markdown, CSV, and Canvas defaults.

server: https://edit.piconic.ai
output: notes
keep: 7d   # optional: how long pedit <file> keeps its room (1d if unset, 0 turns it off)

Add your own template files directly to .pedit/templates/:

pedit                          # notes/pedit-<time>.md
pedit --csv                    # notes/pedit-<time>.csv
pedit --canvas                 # notes/pedit-<time>.canvas
pedit -t minutes.md             # notes/minutes-<time>.md
pedit -t minutes.md -d meetings # meetings/minutes-<time>.md

.canvas files use JSON Canvas, an open format for whiteboard-style diagrams.

-t / --template selects a template; -t csv and -t canvas select default.csv and default.canvas. -d / --directory overrides output. New files get a timestamp and a counter if needed. Existing files are preserved.

Configuration is found from the current directory up to the Git root. output is relative to the project; -d is relative to the current directory. Without configuration, the public server and built-in defaults work immediately. Set server in the config instead of PEDIT_SERVER.

Privacy and security

In a browser, the editor's code comes from the relay, so you trust whoever runs it and Cloudflare, which hosts it: a modified editor could read the key and plaintext. The command line runs no code from the relay: guests can join with pedit '<link>' instead of a browser, using a pedit installed from Homebrew, go install or a release archive you verify, not from install.sh or install.ps1, which the relay serves. Or self-host the relay and editor. See security design for the encryption and what it does not protect against, and the public relay for what edit.piconic.ai logs and keeps. The public relay's terms of use and privacy policy are on the relay itself.

This is a simplified illustration: pedit encrypts document updates rather than raw text. The relay sees the room ID and encrypted bytes, but not the key. Edits in the opposite direction follow the same process.

  • End-to-end encryption. Document updates and pasted images are encrypted on your devices. The relay receives ciphertext; the key stays in the link's #fragment and is never sent to the server.
  • Local files, temporary sessions. The relay never stores plaintext. Kept rooms retain encrypted text until their deadline. Live rooms attempt to delete encrypted images when the host leaves (what the public relay keeps).
  • Private local copies. On Unix, new CLI join copies and saved attachments use owner-only permissions, further restricted by your umask. Updates retain an existing document's permissions; existing files are not retroactively made private.
  • Comments are encrypted too. They travel as updates of a document of their own, end to end like edits, and only the host saves them, in .pedit/meta/; commit that only if you want them in the repository. The editor lets you change or delete only your own comments, but anyone with an edit or comment-only link could change or delete any comment.
  • The link grants editing access. Anyone with the full link can read and edit during the session. Share it only with people you trust, or send a comment-only or read-only link, which cannot change the files: editors sign what they send, and every peer drops what a link cannot sign. Closing a session does not erase copies participants have made.
  • Room IDs alone do not grant access. Clients derive a separate admission token from the fragment key. The relay checks this token before accepting connections or attachment requests; the token cannot decrypt content.
  • Your relay, your access rules. Use the public relay at edit.piconic.ai, or self-host to require sign-in with Cloudflare Access.
  • Only the files you share. The CLI reads and writes the files you name, images in assets/ beside each, its own .pedit/ configuration and a cache, and runs only a clipboard tool and, for Access, cloudflared. See what pedit does on your computer for every file and what you accept.

You must also trust participant devices and browsers. Infrastructure can see IP addresses, room IDs, request timing and ciphertext sizes; infrastructure and Access logs have separate retention settings and are not erased when a room closes.

Markdown previews can embed players such as YouTube, Figma or Miro, and public source files on GitHub. An embed loads only when someone clicks "Load from" on it (or chose "Always load" for its provider), so nobody contacts a third party just because a URL was written in the file. See embeds for the list and options. With Access, avatars may load from an identity provider or Gravatar using an email hash.

Besides the relay, the CLI itself connects only to api.github.com, to check for a newer release, and keeps the answer for a day; it never downloads or installs one.

To report a vulnerability, see SECURITY.md.

Self-host

The public relay at edit.piconic.ai is shared, so it has limits:

Public relay
People in a room The host and 4 guests
Images 5 MiB each, 50 MiB per session
New rooms 20 a minute from one network
Connections 60 a minute from one network
Session length 24 hours
File size About 1 MiB, on any relay (details)

Self-host when you need more, or when you want to limit who can join editing sessions. Cloudflare Access lets you allow specific email addresses or identity provider groups; participants need both an allowed identity and the session link.

Deploy to Cloudflare

The button copies only the server workspace (packages/), without the Go CLI. Deploy the relay and browser editor to your Cloudflare account, then:

# Set server: https://<worker>.<subdomain>.workers.dev in .pedit/config.yaml
pedit notes.md

See self-hosting notes for requirements and Access setup.

Contributing

See CONTRIBUTING.md for development setup and pull requests.

Directories

Path Synopsis
cmd
pedit command
Command pedit shares a local text file and co-edits it with others in their browser.
Command pedit shares a local text file and co-edits it with others in their browser.
internal
access
Package access signs in to a pedit server behind Cloudflare Access with cloudflared, so that sharing a file stays a single command.
Package access signs in to a pedit server behind Cloudflare Access with cloudflared, so that sharing a file stays a single command.
attach
Package attach saves images pasted into the shared document next to the host's file, and uploads them again for peers who could not fetch them.
Package attach saves images pasted into the shared document next to the host's file, and uploads them again for peers who could not fetch them.
canvas
Package canvas reads and writes JSON Canvas files (https://jsoncanvas.org) and moves them in and out of a shared document.
Package canvas reads and writes JSON Canvas files (https://jsoncanvas.org) and moves them in and out of a shared document.
clipboard
Package clipboard copies text with the platform's clipboard command.
Package clipboard copies text with the platform's clipboard command.
fileowner
Package fileowner tells who owns a file on Windows, by SID.
Package fileowner tells who owns a file on Windows, by SID.
filewriter
Package filewriter writes the shared document back to the host's file.
Package filewriter writes the shared document back to the host's file.
flock
Package flock takes an exclusive advisory lock on an open file without waiting.
Package flock takes an exclusive advisory lock on an open file without waiting.
lineend
Package lineend holds a file whose lines all end in CRLF as LF in a document, and writes it back with CRLF.
Package lineend holds a file whose lines all end in CRLF as LF in a document, and writes it back with CRLF.
merge
Package merge applies edits made to the file outside pedit onto the shared text.
Package merge applies edits made to the file outside pedit onto the shared text.
meta
Package meta reads and writes the metadata file pedit keeps for a shared file under .pedit/meta/, which holds its comments (#121).
Package meta reads and writes the metadata file pedit keeps for a shared file under .pedit/meta/, which holds its comments (#121).
protocol/prototest
Package prototest provides an in-memory stand-in for the Worker.
Package prototest provides an in-memory stand-in for the Worker.
serve
Package serve holds a file's Yjs document for a local app: clients, one per stream on pedit's standard streams (stdio.go), speak the y-websocket protocol (sync and awareness, unencrypted), and pedit alone writes the file and merges saves made by other editors.
Package serve holds a file's Yjs document for a local app: clients, one per stream on pedit's standard streams (stdio.go), speak the y-websocket protocol (sync and awareness, unencrypted), and pedit alone writes the file and merges saves made by other editors.
session
Package session shares a local file in a pedit room.
Package session shares a local file in a pedit room.
sessiondir
Package sessiondir lets short commands reach a running pedit session on the same machine: a session registers a directory of its own under the user's configuration, and a command leaves a request there and waits for the answer (docs/design/comments-cli.md).
Package sessiondir lets short commands reach a running pedit session on the same machine: a session registers a directory of its own under the user's configuration, and a command leaves a request there and waits for the answer (docs/design/comments-cli.md).
suggest
Package suggest finds files whose names are close to one that does not exist, to turn a typo into a ready-to-run command.
Package suggest finds files whose names are close to one that does not exist, to turn a typo into a ready-to-run command.
packages
serve/test/fakepedit command
Command fakepedit stands in for pedit in the @pedit/serve tests.
Command fakepedit stands in for pedit in the @pedit/serve tests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL