{"id":29215223,"url":"https://github.com/devnadeemashraf/depman","last_synced_at":"2025-09-07T01:04:59.541Z","repository":{"id":293346574,"uuid":"983721717","full_name":"devnadeemashraf/depman","owner":"devnadeemashraf","description":"A library written in Go for managing external system-level dependencies in your applications.","archived":false,"fork":false,"pushed_at":"2025-05-17T11:18:09.000Z","size":5398,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-03T00:08:29.298Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/devnadeemashraf.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,"zenodo":null}},"created_at":"2025-05-14T20:14:06.000Z","updated_at":"2025-05-17T11:18:12.000Z","dependencies_parsed_at":"2025-05-14T22:35:26.355Z","dependency_job_id":null,"html_url":"https://github.com/devnadeemashraf/depman","commit_stats":null,"previous_names":["devnadeemashraf/depman"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devnadeemashraf/depman","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnadeemashraf%2Fdepman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnadeemashraf%2Fdepman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnadeemashraf%2Fdepman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnadeemashraf%2Fdepman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devnadeemashraf","download_url":"https://codeload.github.com/devnadeemashraf/depman/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devnadeemashraf%2Fdepman/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273983110,"owners_count":25202095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2025-07-03T00:08:36.082Z","updated_at":"2025-09-07T01:04:59.510Z","avatar_url":"https://github.com/devnadeemashraf.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# depman - External Dependency Management Solution\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/devnadeemashraf/depman)](https://goreportcard.com/report/github.com/devnadeemashraf/depman)\n[![GoDoc](https://godoc.org/github.com/devnadeemashraf/depman?status.svg)](https://godoc.org/github.com/devnadeemashraf/depman)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Overview\n\n`depman` is a Go library for managing external system-level dependencies in your applications. It ensures that all required external tools and applications are properly installed before your main application runs.\n\nUnlike traditional package managers that handle code libraries, `depman` focuses on system dependencies like Node.js, Python, or database servers that your application needs to function properly.\n\nWith a single YAML configuration file, `depman` validates, installs, and verifies external dependencies across Windows, Linux, and macOS, providing a seamless bootstrapping experience.\n\n## Features\n\n- **Cross-platform support** for Windows, Linux, and macOS\n- **Semantic versioning** to specify exact versions or version constraints\n- **Dependency discovery** across standard system locations\n- **Installation verification** to ensure dependencies are correctly installed\n- **Customizable installation commands** for platform-specific needs\n- **Environment variable management** to configure dependencies properly\n\n## Installation\n\nTo add `depman` to your Go project:\n\n```bash\ngo get github.com/devnadeemashraf/depman\n```\n\n## Quick Start\n\n### 1. Create a dependency configuration file\n\nCreate an `app-dependencies.yml` file in your project root:\n\n```yaml\nversion: \"1.0\"\nname: \"My Application\"\ndescription: \"Dependencies for my application\"\ndependencies:\n  - name: \"nodejs\"\n    description: \"JavaScript runtime\"\n    version:\n      required: \"16.15.1\"\n      constraint: \"^16.0.0\"\n    platforms:\n      windows:\n        installer:\n          type: \"msi\"\n          url: \"https://nodejs.org/dist/v16.15.1/node-v16.15.1-x64.msi\"\n        commands:\n          install: [\"msiexec\", \"/i\", \"{download_path}\", \"/quiet\"]\n          verify: [\"node\", \"--version\"]\n          uninstall: [\"msiexec\", \"/x\", \"{product_id}\", \"/quiet\"]\n      linux:\n        installer:\n          type: \"binary\"\n          url: \"https://nodejs.org/dist/v16.15.1/node-v16.15.1-linux-x64.tar.xz\"\n        commands:\n          install: [\"tar\", \"-xf\", \"{download_path}\", \"-C\", \"/usr/local/\"]\n          verify: [\"node\", \"--version\"]\n      darwin:\n        installer:\n          type: \"pkg\"\n          url: \"https://nodejs.org/dist/v16.15.1/node-v16.15.1.pkg\"\n        commands:\n          install: [\"installer\", \"-pkg\", \"{download_path}\", \"-target\", \"/\"]\n          verify: [\"node\", \"--version\"]\n```\n\n### 2. Use `depman` in your application\n\nImport and use `depman` to ensure dependencies are installed at application startup:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/devnadeemashraf/depman/pkg/depman\"\n)\n\nfunc main() {\n\t// Initialize dependency manager\n\tmanager, err := depman.NewManager(\"\")\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to initialize dependency manager: %v\", err)\n\t}\n\n\t// Check and install dependencies\n\tresults, err := manager.EnsureDependencies()\n\tif err != nil {\n\t\tlog.Fatalf(\"Dependency error: %v\", err)\n\t}\n\n\t// Check if all dependencies are satisfied\n\tfor name, status := range results {\n\t\tif !status.Installed || !status.Compatible {\n\t\t\tlog.Fatalf(\"Dependency %s is not properly installed or incompatible\", name)\n\t\t}\n\t}\n\n\t// Continue with your application logic\n\tfmt.Println(\"All dependencies are installed and verified!\")\n\t// ...\n}\n```\n\n## API Reference\n\n### Core Functions\n\n#### NewManager\n\n```go\nfunc NewManager(configPath string) (*Manager, error)\n```\n\nCreates a new dependency manager using the specified configuration file path. If `configPath` is empty, it searches for the file in standard locations.\n\n#### EnsureDependencies\n\n```go\nfunc (m *Manager) EnsureDependencies() (map[string]*DependencyStatus, error)\n```\n\nChecks and installs all dependencies if needed, returning their status.\n\n#### CheckDependency\n\n```go\nfunc (m *Manager) CheckDependency(dep *Dependency) (*DependencyStatus, error)\n```\n\nChecks if a specific dependency is installed and compatible.\n\n#### InstallDependency\n\n```go\nfunc (m *Manager) InstallDependency(dep *Dependency) error\n```\n\nInstalls a specific dependency according to platform requirements.\n\n### Configuration File Format\n\nThe `app-dependencies.yml` file defines all the dependencies your project needs:\n\n```yaml\nversion: \"1.0\" # Configuration file version\nname: \"Application Name\" # Your application name\ndescription: \"Description\" # Brief description\n\ndependencies:\n  - name: \"dependency-name\" # Unique identifier for the dependency\n    description: \"...\" # What this dependency is used for\n    version:\n      required: \"1.2.3\" # Exact version required\n      constraint: \"^1.2.0\" # Semver constraint (flexible version range)\n    platforms:\n      windows: # Windows-specific configuration\n        installer:\n          type: \"msi\" # Installation type (msi, exe, zip, etc.)\n          url: \"https://...\" # Download URL\n          checksum: \"sha256:...\" # Verification checksum\n        commands:\n          install: [\"...\", \"...\"] # How to install the dependency\n          verify: [\"...\", \"...\"] # How to verify the installation\n          uninstall: [\"...\", \"...\"] # How to uninstall\n      linux:# Linux-specific configuration\n        # Similar structure as Windows\n      darwin:# macOS-specific configuration\n        # Similar structure as Windows\n    environment:\n      path: [\"{install_dir}/bin\"] # Paths to add to PATH\n      variables: # Environment variables to set\n        KEY: \"value\"\n    dependencies: [] # Other dependencies this one requires\n```\n\n## Advanced Usage\n\n### Accessing Dependency Status\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/devnadeemashraf/depman/pkg/depman\"\n)\n\nfunc main() {\n\t// Create a new dependency manager\n\tmanager, _ := depman.NewManager(\"\")\n\n\t// Just check dependencies without installing\n\tstatuses, _ := manager.CheckAllDependencies()\n\n\t// Print status report\n\tfor name, status := range statuses {\n\t\tfmt.Printf(\"Dependency: %s\\n\", name)\n\t\tfmt.Printf(\"  Installed: %v\\n\", status.Installed)\n\t\tfmt.Printf(\"  Current Version: %s\\n\", status.CurrentVersion)\n\t\tfmt.Printf(\"  Update Required: %s\\n\", status.RequiredUpdate)\n\t\tfmt.Printf(\"  Compatible: %v\\n\", status.Compatible)\n\n\t\tif status.Error != nil {\n\t\t\tfmt.Printf(\"  Error: %v\\n\", status.Error)\n\t\t}\n\t\tfmt.Println()\n\t}\n}\n```\n\n### Custom Dependency Path\n\n```go\n// Use a custom path for the dependency configuration\nmanager, err := depman.NewManager(\"./config/dependencies.yml\")\n```\n\n## Development\n\n### Requirements\n\n- Go 1.19 or higher\n- Make (for using the provided Makefile)\n- golangci-lint (for linting)\n\n### Useful Commands\n\nThe project includes a Makefile with several useful commands:\n\n```bash\nmake help         # Show available commands\nmake build        # Build the library\nmake test         # Run tests\nmake test-verbose # Run tests with verbose output\nmake coverage     # Generate test coverage report\nmake lint         # Run linters\nmake clean        # Clean up build artifacts\n```\n\n_Note: You should have make installed on your system to use the Makefile._\n\n### Project Structure\n\n```\ndepman/\n├── internal/       # Private application packages\n├── pkg/\n│   └── depman/     # Public API packages\n├── .vscode/        # VS Code settings\n├── coverage/       # Test coverage reports\n├── Makefile        # Build automation\n├── go.mod          # Go modules definition\n└── README.md       # This file\n```\n\n## FAQ\n\n**Q: How is this different from package managers like NPM, Pip, or Go Modules?**\nA: `depman` focuses on system-level dependencies (like Node.js, Python, or Git), not code libraries used within your application.\n\n**Q: Does depman handle permission issues for system-level installations?**\nA: `depman` will attempt to install dependencies with the current user's permissions. For system-level installations that require elevated privileges, you may need to run your application with appropriate permissions.\n\n**Q: What happens if a dependency can't be installed?**\nA: `depman` returns detailed error information that your application can use to provide appropriate feedback to users.\n\n**Q: Can I use this to bootstrap CI/CD environments?**\nA: Yes! `depman` is perfect for ensuring CI/CD environments have the correct dependencies installed.\n\n## Contributing\n\nContributions are welcome! Here's how you can contribute:\n\n1. Fork the repository\n2. Create a feature branch: `git checkout -b feature/amazing-feature`\n3. Commit your changes: `git commit -m 'Add amazing feature'`\n4. Push to the branch: `git push origin feature/amazing-feature`\n5. Open a Pull Request\n\nPlease read CONTRIBUTING.md for detailed contribution guidelines.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n## Acknowledgments\n\n- [Masterminds/semver](https://github.com/Masterminds/semver) for semantic versioning support\n- [yaml.v3](https://gopkg.in/yaml.v3) for YAML parsing\n\n---\n\n_Built with ❤️ by [Nadeem Ashraf](https://github.com/devnadeemashraf)_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevnadeemashraf%2Fdepman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevnadeemashraf%2Fdepman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevnadeemashraf%2Fdepman/lists"}