Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,29 @@ running processes, wait 5s, and then send a `SIGKILL` to all remaining processes
It runs the processes in `Procfile.dev` "as-is";
It does not load environment variables from `.env` before running.

## File watching

Add `# watch: PATTERNS` to automatically restart a process when files change:

```txt
web: bundle exec ruby cmd/web.rb # watch: lib/**/*.rb,ui/**/*.haml
esbuild: bun run buildwatch
```

Patterns are relative to the directory containing `Procfile.dev`.
Glob patterns support `*` (single directory) and `**` (recursive).
Processes without a watch annotation run without file watching.
Changes are debounced (500ms) to avoid rapid restarts.
On change, procman sends SIGINT, waits for the process to exit, then restarts it.

`procman` is distributed via Go source code,
not via a Homebrew package.

`procman` depends on [github.com/creack/pty](https://github.com/creack/pty/tree/master)
for a PTY interface.
`procman` depends on:

- [creack/pty](https://github.com/creack/pty) for PTY interface
- [fsnotify/fsnotify](https://github.com/fsnotify/fsnotify) for file watching
- [bmatcuk/doublestar](https://github.com/bmatcuk/doublestar) for glob patterns

## Developing

Expand Down
8 changes: 7 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@ module github.com/croaky/procman

go 1.25

require github.com/creack/pty v1.1.24
require (
github.com/bmatcuk/doublestar/v4 v4.10.0
github.com/creack/pty v1.1.24
github.com/fsnotify/fsnotify v1.9.0
)

require golang.org/x/sys v0.13.0 // indirect
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
github.com/bmatcuk/doublestar/v4 v4.10.0 h1:zU9WiOla1YA122oLM6i4EXvGW62DvKZVxIe6TYWexEs=
github.com/bmatcuk/doublestar/v4 v4.10.0/go.mod h1:xBQ8jztBU6kakFMg+8WGxn0c6z1fTSPVIjEY1Wr7jzc=
github.com/creack/pty v1.1.24 h1:bJrF4RRfyJnbTJqzRLHzcGaZK1NeM5kTC9jGgovnR1s=
github.com/creack/pty v1.1.24/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE=
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
Loading