watchfiles(1)
π watchfiles(1) π
okay so this is the manual page for watchfiles, which lives in the General Commands Manual section (section 1, bestie, the commands section, iykyk) π«Ά
β¨ NAME β¨
watchfiles β Simple, modern and high performance file watching π₯
πΈ SYNOPSIS πΈ
watchfiles [--ignore-paths <IGNORE_PATHS>] [--target-type (command |
function | auto)] [--filter <FILTER>] [--args <ARGS>] [--verbose]
[--non-recursive] [--verbosity (warning | info | debug)]
[--sigint-timeout <SIGINT_TIMEOUT>] [--grace-period <GRACE_PERIOD>]
[--sigkill-timeout <SIGKILL_TIMEOUT>] [--ignore-permission-denied]
target [paths ...]
watchfiles (-h | --help)
watchfiles (-V | --version)
no cap, that first line is giving a lot, but it's just the full list of everything you can pass in one go π
π¦ DESCRIPTION π¦
watchfiles watches one or more directories and executes either a Shell command or a Python function on file changes. that's the whole vibe. files change, stuff runs. iconic behaviour honestly β¨
π ARGUMENTS π
targetβ Command or dotted function path to run. this is the thing that actually goes off when your files do something πpathsβ Filesystem paths to watch, defaults to current directory. leave it out and it just watches wherever you're standing π«Ά
π OPTIONS π
-h|--helpβ Show this help message and exit. classic. we love a help flag π--ignore-paths <IGNORE_PATHS>β Specify directories to ignore, to ignore multiple paths use a comma as separator, e.g."env"or"env,node_modules". commas, bestie, not spaces π--target-type (command | function | auto)β Whether the target should be intercepted as a shell command or a Python function, defaults to"auto"which infers the target type from the target string. auto is out here doing detective work π--filter <FILTER>β Which files to watch, defaults to"default"which uses theDefaultFilter,"python"uses thePythonFilter,"all"uses no filter, any other value is interpreted as a Python function/class path which is imported. so"all"is the no-thoughts-just-vibes option π--args <ARGS>β Arguments to set onsys.argvbefore calling target function, used only if the target is a function. note the only if β command targets don't get this π--verboseβ Set log level to"debug", wins over--verbose... no wait, wins over--verbosity. okay bestie,--verboseis the main character here, it beats--verbosityevery single time π--non-recursiveβ Do not watch for changes in sub-directories recursively. it stays in its lane, respectfully π¦--verbosity (warning | info | debug)β Log level, defaults to"info"β--sigint-timeout <SIGINT_TIMEOUT>β How long to wait for the sigint timeout before sending sigkill. the escalation pipeline π--grace-period <GRACE_PERIOD>β Number of seconds after the process is started before watching for changes. give it a lil minute to get ready π§--sigkill-timeout <SIGKILL_TIMEOUT>β How long to wait for the sigkill timeout before issuing a timeout exception. yeah, if even that doesn't land, you get an exception π--ignore-permission-deniedβ Ignore permission denied errors while watching files and directories. the "i don't see it, i don't care" option, lowkey valid πΈ-V|--versionβ Show program's version number and exit π
okay real talk for a sec:--sigint-timeoutand--sigkill-timeoutare the ones where things get intense β signals are getting sent. read those two properly before you go wild, bestie π«Ά
π₯ EXAMPLES π₯
Watching the current directory and calling a Python function:
$ watchfiles foobar.main
Watching Python files in two local directories and calling a Shell command:
$ watchfiles --filter python 'pytest --lf' src tests
see how the second one is watching src and tests and only paying attention to python files? ate. π
π BUGS π
Bugs can be reported to your distribution's bug tracker or upstream at <https://github.com/samuelcolvin/watchfiles/issues>. pls be nice when you file them, the maintainers are people too π₯Ί
π AUTHOR π
Louis-Philippe VΓ©ronneau
aaaand that's the whole page bestie, 2024 edition of watchfiles(1) from the General Commands Manual β go watch some files, you're gonna slay πβ¨π
π¦ where this page comes from
- ubuntu resolute: python3-watchfiles 1.1.1-2build1 Β· MIT
- ubuntu stonking: python3-watchfiles 1.2.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms