{"id":26338723,"url":"https://github.com/mobydeck/pkgs","last_synced_at":"2026-04-29T01:02:13.628Z","repository":{"id":282606971,"uuid":"949110872","full_name":"mobydeck/pkgs","owner":"mobydeck","description":"Unified Package Manager Interface ","archived":false,"fork":false,"pushed_at":"2025-03-16T16:40:34.000Z","size":65,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-05T09:42:07.258Z","etag":null,"topics":["apk","apt","brew","dnf","golang","package-manager","pacman","yum"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mobydeck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-15T17:45:28.000Z","updated_at":"2025-03-31T06:25:04.000Z","dependencies_parsed_at":"2025-03-16T01:15:16.363Z","dependency_job_id":null,"html_url":"https://github.com/mobydeck/pkgs","commit_stats":null,"previous_names":["mobydeck/pkgs"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/mobydeck/pkgs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobydeck%2Fpkgs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobydeck%2Fpkgs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobydeck%2Fpkgs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobydeck%2Fpkgs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mobydeck","download_url":"https://codeload.github.com/mobydeck/pkgs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mobydeck%2Fpkgs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32405903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apk","apt","brew","dnf","golang","package-manager","pacman","yum"],"created_at":"2025-03-16T03:14:44.913Z","updated_at":"2026-04-29T01:02:13.612Z","avatar_url":"https://github.com/mobydeck.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pkgs - Unified Package Manager Interface\n\n`pkgs` is a command-line tool that provides a unified interface for package management across different operating\nsystems. It wraps around native package managers like `apt`, `dnf`, `yum`, `apk`, `pacman`, and `brew`, allowing you\nto use the same commands regardless of the underlying system.\n\n## Features\n\n- Unified commands across different operating systems (Linux distributions and macOS)\n- Automatic detection of the system's package manager\n- Support for common package management operations\n- Intelligent privilege handling:\n  - Automatic sudo elevation on Linux when required\n  - No sudo usage on macOS with Homebrew (as recommended)\n- Intelligent handling of package manager-specific behaviors\n\n## Supported Package Managers\n\n- `brew` (macOS)\n- `apt` (Debian, Ubuntu)\n- `dnf` (Fedora, RHEL 8+)\n- `yum` (CentOS, RHEL 7 and earlier)\n- `apk` (Alpine)\n- `pacman` (Arch)\n\n## Installation\n\n### From Source\n\n```bash\ngit clone https://github.com/mobydeck/pkgs.git\ncd pkgs\njust build\nsudo just install\n```\n\n### Using Go\n\n```bash\ngit clone https://github.com/mobydeck/pkgs.git\ncd pkgs\ngo build\nsudo mv pkgs /usr/local/bin/\n```\n\n### Just Commands\n\nThe project includes a justfile with the following commands:\n\n```bash\n# Build the application\njust build\n\n# Install the application to /usr/local/bin\njust install\n\n# Clean build artifacts\njust clean\n\n# Show the current version\njust version\n\n# Build for specific platforms\njust build-linux-amd64\njust build-macos-arm64\njust build-windows-amd64\n\n# Build for all platforms\njust build-all\n\n# Create release packages\njust package\n```\n\n## Usage\n\n### Basic Commands\n\nThese commands handle the package manager-specific details, making it easier to manage packages across different systems:\n\n```bash\n# Install packages\npkgs install nginx\npkgs i vim git curl\n\n# Reinstall packages\npkgs reinstall nginx\npkgs ri vim git curl\n\n# Remove packages\npkgs remove nginx\npkgs rm vim git curl\n\n# Search for packages\npkgs search nginx\npkgs s python\n\n# Show package information\npkgs info nginx\npkgs show vim\n\n# Update package lists\npkgs update\npkgs up\n\n# Upgrade all packages\npkgs upgrade\npkgs ug\n\n# Remove unused packages\npkgs autoremove\n\n# Clean package cache\npkgs clean\n\n# Show which package manager is being used\npkgs which\n\n# Show only the package manager name (useful for scripting)\npkgs which -s\n```\n\nFor example, a script could now do something like:\n```bash\nPM=$(pkgs which -s)\nif [ \"$PM\" = \"apt\" ]; then\n    # Do something specific for apt systems\nelif [ \"$PM\" = \"brew\" ]; then\n    # Do something specific for Homebrew systems\nfi\n```\n\n## Repository Management\n\nThese commands handle the package manager-specific details, making it easier to manage repositories across different systems:\n\n```bash\n# Add a repository key\npkgs add-key [name] url\n\n# Examples:\n# For apt-based systems (Debian/Ubuntu)\npkgs add-key nodesource https://deb.nodesource.com/gpgkey/nodesource.gpg.key\n\n# For Alpine Linux\npkgs add-key alpine-key https://alpine-keys.example.com/key.rsa.pub\n\n# Add a repository\npkgs add-repo [name] url\n\n# Examples:\n# For apt-based systems (Debian/Ubuntu)\npkgs add-repo nodesource \"deb [signed-by=/etc/apt/keyrings/nodesource.asc] https://deb.nodesource.com/node_20.x nodistro main\"\n\n# For dnf/yum-based systems (Fedora/RHEL/CentOS)\npkgs add-repo https://download.docker.com/linux/fedora/docker-ce.repo\n\n# For Alpine Linux\npkgs add-repo edge-testing https://dl-cdn.alpinelinux.org/alpine/edge/testing\n\n# For Homebrew\npkgs add-repo homebrew/cask-fonts\n\n# Enable a repository\npkgs enable-repo name\n\n# Examples:\n# For apt-based systems (Debian/Ubuntu)\npkgs enable-repo nodesource\n\n# For dnf/yum-based systems\npkgs enable-repo docker-ce\n\n# For Alpine Linux\npkgs enable-repo edge-testing\n\n# Disable a repository\npkgs disable-repo name\n\n# Examples:\n# For apt-based systems (Debian/Ubuntu)\npkgs disable-repo nodesource\n\n# For dnf/yum-based systems\npkgs disable-repo docker-ce\n\n# For Alpine Linux\npkgs disable-repo edge-testing\n\n# List all repositories with their status (enabled/disabled)\npkgs list-repos\n```\n\n## Help and Version\n\n```bash\n# Show general help\npkgs --help\n\n# Show command-specific help\npkgs install --help\n\n# Show version information\npkgs --version\n```\n\n## Non-Interactive Mode\n\nFor CI/CD pipelines and automation scripts, you can use the `--yes` or `-y` flag to run commands non-interactively:\n\n```bash\n# Install packages without prompting\npkgs -y install nginx\n\n# Update and upgrade without prompting\npkgs -y update \u0026\u0026 pkgs -y upgrade\n\n# Remove packages without prompting\npkgs -y remove nginx\n```\n\nThis flag automatically adds the appropriate non-interactive flag to the underlying package manager:\n- `-y` for apt, dnf, and yum\n- `--noconfirm` for pacman\n- No additional flag for brew and apk (as they're already non-interactive by default)\n\nAlternatively, you can set the `PKGS_YES` environment variable to achieve the same effect:\n\n```bash\n# Set the environment variable for the current session\nexport PKGS_YES=true\n\n# Now all commands will run in non-interactive mode\npkgs install nginx\npkgs update\npkgs remove nginx\n\n# You can also set it for a single command\nPKGS_YES=1 pkgs install nginx\n```\n\nThe `PKGS_YES` environment variable accepts the following values (case-insensitive):\n- `true`, `yes`, `1`, `y`: Enable non-interactive mode\n- Any other value or unset: Use the default interactive mode\n\n## Package Manager Specifics\n\n### Homebrew (macOS)\n\nOn macOS systems, `pkgs` automatically detects and uses Homebrew. Some key differences when using Homebrew:\n\n- Commands never use sudo (as recommended by Homebrew)\n- `autoremove` runs both `brew autoremove` to remove unused dependencies and `brew cleanup` to remove old versions\n- `remove` uses `brew uninstall` instead of remove/purge\n- `reinstall` uses `brew reinstall` to reinstall packages\n- `add-repo` uses `brew tap` to add new taps\n- `add-key` is not applicable for Homebrew\n- `list-repos` shows all taps\n\n### Linux Package Managers\n\nEach Linux package manager has its own specific implementation:\n\n- `apt` (Debian/Ubuntu): \n  - Uses `--purge` for thorough removal\n  - Uses `--reinstall` flag for reinstalling packages\n  - `add-key` saves keys to `/etc/apt/keyrings/name.asc`\n  - `add-repo` creates files in `/etc/apt/sources.list.d/name.list`\n  - `enable-repo` uncomments entries in repository files\n  - `disable-repo` comments out entries in repository files\n  - `list-repos` shows repositories from `/etc/apt/sources.list` and `/etc/apt/sources.list.d/`\n- `dnf`/`yum` (RedHat): \n  - Uses `check-update` for the update command\n  - Has a dedicated `reinstall` command\n  - `add-repo` creates files in `/etc/yum.repos.d/` directory\n  - `add-key` provides guidance for using `rpm --import`\n  - `enable-repo` sets `enabled=1` in repository files\n  - `disable-repo` sets `enabled=0` in repository files\n  - `list-repos` shows repositories from `/etc/yum.repos.d/`\n- `apk` (Alpine): \n  - Uses `add` and `del` instead of install/remove\n  - Uses `add --force-overwrite` for reinstalling\n  - `add-key` adds keys to `/etc/apk/keys/`\n  - `add-repo` adds repositories to `/etc/apk/repositories`\n  - `enable-repo` uncomments repository entries\n  - `disable-repo` comments out repository entries\n  - `list-repos` shows repositories from `/etc/apk/repositories`\n- `pacman` (Arch): \n  - Uses special flags like `-S`, `-Rns`, etc.\n  - Uses `-S --needed` for reinstalling packages\n  - `add-key` provides guidance for using `pacman-key --add`\n  - `add-repo` provides guidance for manually editing `/etc/pacman.conf`\n  - `enable-repo` and `disable-repo` provide guidance for manually editing `/etc/pacman.conf`\n  - `list-repos` shows repositories from `/etc/pacman.conf`\n\n#### Privilege Elevation on Linux\n\nOn Linux systems, package management operations typically require root privileges. The `pkgs` tool will:\n\n1. Check if the current user has root privileges\n2. If not, automatically use `sudo` to elevate privileges for commands that require it\n3. If `sudo` is not available, provide a clear error message\n\nCommands that require privilege elevation:\n- install\n- reinstall\n- remove\n- update\n- upgrade\n- autoremove\n- clean\n- add-key\n- add-repo\n- enable-repo\n- disable-repo\n- list-repos\n\n## License\n\nMIT License\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobydeck%2Fpkgs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmobydeck%2Fpkgs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmobydeck%2Fpkgs/lists"}