| Crates.io | runproclike |
| lib.rs | runproclike |
| version | 0.2.1 |
| created_at | 2024-12-26 00:38:50.127047+00 |
| updated_at | 2025-09-06 03:20:05.366509+00 |
| description | runproclike is a CLI utility that analyzes a running process by its PID and prints the command and its environment in a reproducible form. |
| homepage | https://github.com/PauloMigAlmeida/runproclike |
| repository | https://github.com/PauloMigAlmeida/runproclike.git |
| max_upload_size | |
| id | 1495305 |
| size | 66,087 |
runproclike is a lightweight command-line utility that analyzes a running process by its PID and prints the command and its environment in a reproducible form. It's especially useful for debugging, replicating process states, or migrating workloads.
runproclike extends this concept to Linux processes.runproclike --pid 19352
sudo -i -u \#1000 <<EOF
# change cwd user to match the target process
cd /home/paulo/workspace/runproclike
# export env variables to match the target process
export WAYLAND_DISPLAY='wayland-0'
export USER='paulo'
export XDG_MENU_PREFIX='gnome-'
export LANG='en_NZ.UTF-8'
# cmdline to match the target process
/bin/bash \
--rcfile \
/home/paulo/IDE/RustRover-2024.3.2/plugins/terminal/shell-integrations/bash/bash-integration.bash \
-i
EOF
export PATH=~/.cargo/bin/:$PATH
cargo install runproclike
Don't want to build and install anything? All good, you can leverage the docker image built precisely for that!
docker run \
--rm \
--privileged \
--pid=host \
ghcr.io/paulomigalmeida/runproclike:latest \
--pid <pid>
git clone https://github.com/PauloMigAlmeida/runproclike.git
cd runproclike
cargo build --release
runproclike [OPTIONS] --pid <PID>
Usage: runproclike [OPTIONS] --pid <PID>
Options:
-p, --pid <PID> PID of the process of interest
--command-only print the command line of the process without the path, cwd, env, etc.
--omit-comments Omit comments from the output.
-h, --help Print help
-V, --version Print version
runproclike inspects a process's details by reading procfs files and outputs the information needed to recreate the process in a shell.
Contributions are welcome! Please follow these steps: