Files
pmg/README.md
T

119 lines
2.8 KiB
Markdown
Raw Normal View History

2025-04-23 02:21:44 +05:30
# PMG (Package Manager Guard)
2025-05-14 14:46:43 +05:30
PMG is a wrapper for package managers to protect developers from installing malicious packages.
2025-04-23 02:21:44 +05:30
2025-05-14 14:46:43 +05:30
## TL;DR
2025-04-23 02:21:44 +05:30
2025-05-14 14:46:43 +05:30
Set up `pmg` to protect you development environment:
```
echo "alias npm='pmg npm'" >> ~/.zshrc
echo "alias pnpm='pmg pnpm'" >> ~/.zshrc
source ~/.zshrc
```
Continue using your favorite package manager as usual:
```
npm install <package-name>
pnpm add <package-name>
```
2025-04-23 02:21:44 +05:30
## 📑 Table of Contents
2025-05-14 14:46:43 +05:30
- [PMG (Package Manager Guard)](#pmg-package-manager-guard)
- [TL;DR](#tldr)
- [📑 Table of Contents](#-table-of-contents)
- [Features](#features)
- [Supported Ecosystems](#supported-ecosystems)
- [Installation](#installation)
- [Binaries](#binaries)
- [Build from Source](#build-from-source)
- [Usage](#usage)
- [Debugging](#debugging)
2025-05-14 14:46:43 +05:30
- [PMG in Action](#pmg-in-action)
- [Malicious Package Detection](#malicious-package-detection)
- [Bulk Package Analysis](#bulk-package-analysis)
- [Contributing](#contributing)
2025-04-23 02:21:44 +05:30
## Features
2025-05-14 14:46:43 +05:30
- 🚫 Malicious package identification using [SafeDep Cloud](https://docs.safedep.io/cloud/malware-analysis)
- 🌲 Deep dependency analysis and transitive dependency resolution
- ⚡ Fast and efficient package verification
- 🔄 Seamless integration with existing package managers
2025-04-23 02:21:44 +05:30
## Supported Ecosystems
2025-05-14 14:46:43 +05:30
PMG supports the following package ecosystems:
| Ecosystem | Status | Command |
| --------- | --------- | --------------------------- |
| NPM | ✅ Active | `pmg npm install <package>` |
| PNPM | ✅ Active | `pmg pnpm add <package>` |
| PyPI | 🚧 Planned | |
| Go | 🚧 Planned | |
2025-05-14 14:46:43 +05:30
> Want us to support your favorite package manager? [Open an issue](https://github.com/safedep/pmg/issues) and let us know!
2025-04-23 02:21:44 +05:30
## Installation
2025-05-14 14:46:43 +05:30
### Binaries
Download the latest binary from the [releases page](https://github.com/safedep/pmg/releases).
### Build from Source
2025-04-23 02:21:44 +05:30
> Ensure $(go env GOPATH)/bin is in your $PATH
```bash
2025-04-28 20:02:20 +05:30
go install github.com/safedep/pmg@latest
2025-04-23 02:21:44 +05:30
```
## Usage
2025-05-14 14:46:43 +05:30
Install a package with `npm` or `pnpm`:
```bash
pmg npm install <package-name>
pmg pnpm add <package-name>
```
Set shell alias for convenience:
```bash
alias npm="pmg npm"
alias pnpm="pmg pnpm"
```
Continue using your favorite package manager as usual:
```bash
npm install <package-name>
```
```bash
pnpm add <package-name>
```
### Debugging
Use the `--debug` flag to enable debug mode:
```bash
pmg --debug npm install <package-name>
```
2025-05-14 14:46:43 +05:30
### PMG in Action
#### Malicious Package Detection
![pmg scan malicious package](./docs/assets/pmg-malicious-pkg.png)
#### Bulk Package Analysis
![pmg scan & install multiple package](./docs/assets/pmg-scan-multiple-pkgs.png)
2025-04-23 02:21:44 +05:30
## Contributing
2025-05-14 14:46:43 +05:30
Refer to [CONTRIBUTING.md](CONTRIBUTING.md)