The fastest way to compile and run C code โ single files or full projects, with live watch mode.
No config required to get started.
Direct compilation for single files, cached incremental builds for projects โ only recompiles what changed.
Auto-recompile on file changes using inotifywait, fswatch, entr, or built-in polling as fallback.
Pipe input.txt into stdin and capture program output to output.txt โ perfect for testing scanf-based programs.
Missing or empty .c file? c-runner creates it with Hello World starter code and runs it immediately.
Use config.yml or environment variables to customize source, build directories, and file I/O per project.
Single files compile to a temp binary, run, then clean up automatically โ zero leftover files.
Get up and running in under a minute.
sudo apt update # refresh package list
sudo apt install build-essential inotify-tools # gcc + file watcher for watch modewget https://c-runner.vercel.app/c-runner # download the binary
chmod +x c-runner # make it executable
sudo mv c-runner /usr/local/bin/ # install globally
c-runner --version # verify installationSee c-runner in action.
All available commands at a glance.
c-runner --versionDisplay version and author information.
c-runner --helpShow all available commands and options.
c-runner --initCreate a config.yml with default src_dir, build_dir, and file_mode settings.
c-runner runCompile all .c files in the project and run the executable.
c-runner run --watchAuto-recompile the entire project on any file change.
c-runner main.cCompile and run a .c file. Creates it with starter code if missing or empty.
c-runner main.c --watchAuto-recompile on every save. Creates starter code if file is missing or empty.
c-runner main.c -i input.txtPipe input.txt into stdin โ each line feeds the next scanf call.
c-runner main.c -o output.txtWrite program output to output.txt. Overwrites on every run.
c-runner main.c -i input.txt -o output.txt --watchWatch mode with file I/O โ reruns on .c or input.txt changes.
Customize per project with a simple YAML file.
# GCC Build Configuration
src_dir: src
build_dir: build
# File I/O mode (optional)
# file_mode:
# input: input.txt # pipe this file into stdin
# output: output.txt # write program output to this file
# view_terminal: true # also print output to terminal (default: false)# comment lines are ignored โ use them to document your inputs
10 20 # a and b
# next scanf value
300-i / -o override config.yml values.# are stripped before being piped to stdin.src_dirSource directory (default: .)build_dirBuild directory (default: build)inputStdin source file (default: โ)outputStdout target file (default: โ)view_terminalAlso print to terminal (default: false)sudo rm /usr/local/bin/c-runner