movebin-zig is a small utility to install (move) a local binary into a system directory such as /usr/local/bin.
- Copy a binary to
/usr/local/binand avoid accidental overwrites. - Prompts before overwriting; supports a force flag to skip confirmation.
- Zig (the project uses the included
build.zig). Ensurezigis available on your PATH. - You will generally need elevated privileges (e.g.
sudo) to install into/usr/local/bin.
curl -L https://github.com/tacheraSasi/movebin-zig/releases/latest/download/movebin-darwin-arm64.tar.gz -o movebin.tar.gz
sudo tar -C /usr/local/bin -xzf movebin.tar.gz
rm movebin.tar.gzcurl -L https://github.com/tacheraSasi/movebin-zig/releases/latest/download/movebin-darwin-amd64.tar.gz -o movebin.tar.gz
sudo tar -C /usr/local/bin -xzf movebin.tar.gz
rm movebin.tar.gzcurl -L https://github.com/tacheraSasi/movebin-zig/releases/latest/download/movebin-linux-amd64.tar.gz -o movebin.tar.gz
sudo tar -C /usr/local/bin -xzf movebin.tar.gz
rm movebin.tar.gzcurl -L https://github.com/tacheraSasi/movebin-zig/releases/latest/download/movebin-linux-arm64.tar.gz -o movebin.tar.gz
sudo tar -C /usr/local/bin -xzf movebin.tar.gz
rm movebin.tar.gzcurl -L https://github.com/tacheraSasi/movebin-zig/releases/latest/download/movebin-windows-amd64.zip -o movebin.zip
# Extract and place movebin.exe somewhere in your PATHOr with PowerShell (admin):
Invoke-WebRequest -Uri https://github.com/tacheraSasi/movebin-zig/releases/latest/download/movebin-windows-amd64.zip -OutFile movebin.zip
Expand-Archive movebin.zip -DestinationPath C:\Windows\System32
Remove-Item movebin.zipTo build the project locally:
zig buildThe built executable is placed under zig-out/bin/movebin.
To run the program directly from the build output:
./zig-out/bin/movebin <path/to/binary>A Makefile is also provided for convenience:
| Command | Description |
|---|---|
make build |
Build the project |
make run |
Build and run |
make test |
Run tests |
make lint |
Check formatting |
make clean |
Remove build artifacts |
make build-all |
Cross-compile for all platforms |
make release |
Build archives and create a GitHub release |
Basic usage:
sudo movebin <binary_path> [args...]If a file already exists at the destination the program prompts before overwriting. You can skip the prompt with the force flag:
sudo movebin -f <binary_path>
sudo movebin --force <binary_path>Example:
sudo movebin ./my-tool
# destination will be: /usr/local/bin/my-tool- The project contains helper utilities in
src/utils.zig(for checking file existence, prompting, and handling the-f/--forceflags). build.zigis provided; see it for additional build targets.
- Fork the repository and create a topic branch.
- Make your changes and run
zig build(orzig testif you add tests). - Open a pull request with a clear description of your changes.
This project is licensed under the MIT License - see the LICENSE file for details.