Skip to content

A simple utility to move binaries to bin for easy execution from anywhere.

License

Notifications You must be signed in to change notification settings

tacheraSasi/movebin-zig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

movebin-zig

movebin-zig is a small utility to install (move) a local binary into a system directory such as /usr/local/bin.

Features

  • Copy a binary to /usr/local/bin and avoid accidental overwrites.
  • Prompts before overwriting; supports a force flag to skip confirmation.

Prerequisites

  • Zig (the project uses the included build.zig). Ensure zig is available on your PATH.
  • You will generally need elevated privileges (e.g. sudo) to install into /usr/local/bin.

Installation

macOS (Apple Silicon)

curl -L https://github.com/tacheraSasi/movebin-zig/releases/download/v0.0.3/movebin-v0.0.3-aarch64-macos.tar.gz -o movebin.tar.gz
sudo tar -C /usr/local/bin -xzf movebin.tar.gz
rm movebin.tar.gz

macOS (Intel)

curl -L https://github.com/tacheraSasi/movebin-zig/releases/download/v0.0.3/movebin-v0.0.3-x86_64-macos.tar.gz -o movebin.tar.gz
sudo tar -C /usr/local/bin -xzf movebin.tar.gz
rm movebin.tar.gz

Linux (x86_64)

curl -L https://github.com/tacheraSasi/movebin-zig/releases/download/v0.0.3/movebin-v0.0.3-x86_64-linux.tar.gz -o movebin.tar.gz
sudo tar -C /usr/local/bin -xzf movebin.tar.gz
rm movebin.tar.gz

Linux (aarch64)

curl -L https://github.com/tacheraSasi/movebin-zig/releases/download/v0.0.3/movebin-v0.0.3-aarch64-linux.tar.gz -o movebin.tar.gz
sudo tar -C /usr/local/bin -xzf movebin.tar.gz
rm movebin.tar.gz

Windows (x86_64)

Download the zip from the latest release, extract movebin.exe, and add it to your PATH.

Or with PowerShell:

Invoke-WebRequest -Uri https://github.com/tacheraSasi/movebin-zig/releases/download/v0.0.3/movebin-v0.0.3-x86_64-windows.zip -OutFile movebin.zip
Expand-Archive movebin.zip -DestinationPath C:\Windows\System32
Remove-Item movebin.zip

Build from source

To build the project locally:

zig build

The 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>

Usage

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

Notes

  • The project contains helper utilities in src/utils.zig (for checking file existence, prompting, and handling the -f/--force flags).
  • build.zig is provided; see it for additional build targets.

Contributing

  1. Fork the repository and create a topic branch.
  2. Make your changes and run zig build (or zig test if you add tests).
  3. Open a pull request with a clear description of your changes.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

A simple utility to move binaries to bin for easy execution from anywhere.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages