{"id":29014010,"url":"https://github.com/drqedwards/cpm-cli","last_synced_at":"2025-06-25T20:12:37.388Z","repository":{"id":296652288,"uuid":"994050166","full_name":"drQedwards/CPM-cli","owner":"drQedwards","description":"C Package Manager CLI","archived":false,"fork":false,"pushed_at":"2025-06-11T04:41:27.000Z","size":3596,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-25T06:35:23.965Z","etag":null,"topics":["c","cpm","npm","packages"],"latest_commit_sha":null,"homepage":"https://CPM.io","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/drQedwards.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","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-06-01T04:55:28.000Z","updated_at":"2025-06-05T00:48:20.000Z","dependencies_parsed_at":"2025-06-25T06:47:02.155Z","dependency_job_id":null,"html_url":"https://github.com/drQedwards/CPM-cli","commit_stats":null,"previous_names":["qchains/cpm-cli","drqedwards/cpm-cli"],"tags_count":3,"template":true,"template_full_name":null,"purl":"pkg:github/drQedwards/CPM-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drQedwards%2FCPM-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drQedwards%2FCPM-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drQedwards%2FCPM-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drQedwards%2FCPM-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drQedwards","download_url":"https://codeload.github.com/drQedwards/CPM-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drQedwards%2FCPM-cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261945404,"owners_count":23234243,"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","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":["c","cpm","npm","packages"],"created_at":"2025-06-25T20:12:36.087Z","updated_at":"2025-06-25T20:12:37.351Z","avatar_url":"https://github.com/drQedwards.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CPM - C Package Manager\n\nA hardened C implementation of NPM with Q promises and PMLL (Package Manager Linked List) support.\n\n## Features\n\n- **🚀 Full NPM CLI Compatibility**: All standard npm commands implemented in C\n- **⚡ Q Promises**: Asynchronous operations with promise-like syntax in C\n- **🔗 PMLL**: Advanced package management with linked list data structures\n- **🔒 Hardened Security**: Memory-safe C implementation with robust error handling\n- **🔄 Bidirectional NPM Support**: `npm install cpm` and `cpm install npm` both work\n- **🎯 Performance**: Native C speed for package operations\n\n## Installation\n\n### Via NPM (Recommended)\n```bash\nnpm install -g cpm\n```\n\n### From Source\n```bash\ngit clone https://github.com/cpm/cpm.git\ncd cpm\nnpm install\nnpm run build\n```\n\n## System Requirements\n\n- GCC compiler\n- libcurl development libraries\n- libjson-c development libraries\n- pthread support\n\n### Install Dependencies\n\n**Ubuntu/Debian:**\n```bash\nsudo apt-get install build-essential libcurl4-openssl-dev libjson-c-dev\n```\n\n**CentOS/RHEL:**\n```bash\nsudo yum groupinstall \"Development Tools\"\nsudo yum install libcurl-devel json-c-devel\n```\n\n**macOS:**\n```bash\nxcode-select --install\nbrew install curl json-c\n```\n\n## Usage\n\nCPM provides a complete npm-compatible CLI:\n\n### Package Installation\n```bash\ncpm install express           # Install latest version\ncpm install lodash@4.17.21    # Install specific version\ncpm install --save-dev jest   # Install as dev dependency\ncpm install                   # Install from package.json\n```\n\n### Package Management\n```bash\ncpm uninstall package-name    # Remove package\ncpm update                    # Update all packages\ncpm update package-name       # Update specific package\ncpm list                      # List installed packages\n```\n\n### Package Information\n```bash\ncpm info package-name         # Show package details\ncpm audit                     # Audit for vulnerabilities\n```\n\n### Project Management\n```bash\ncpm init                      # Initialize new package.json\n```\n\n### Options\n```bash\n--save, -S          Save to dependencies\n--save-dev, -D      Save to devDependencies  \n--global, -g        Install globally\n--verbose, -v       Verbose output\n--dry-run          Show what would be done\n--help, -h         Show help\n```\n\n## Q Promises in C\n\nCPM includes a comprehensive Q Promise implementation for asynchronous operations:\n\n```c\n#include \"cpm.h\"\n\nQPromise* promise = q_promise_new();\n\n// Async operation\nq_promise_then(promise, on_success);\nq_promise_catch(promise, on_error);\n\n// Resolve/reject\nq_promise_resolve(promise, result_data);\nq_promise_reject(promise, \"Error message\");\n\n// Await-style\nAwaitResult result = q_await(promise);\nif (result.error) {\n    // Handle error\n} else {\n    // Use result.result\n}\n```\n\n## PMLL (Package Manager Linked List)\n\nAdvanced package management with linked list operations:\n\n```c\nPMLL* list = pmll_new();\n\nPackage package = {\n    .name = \"express\",\n    .version = \"4.18.0\",\n    .description = \"Fast, minimalist web framework\"\n};\n\npmll_add_package(list, \u0026package);\nPackage* found = pmll_find_package(list, \"express\");\npmll_remove_package(list, \"express\");\npmll_free(list);\n```\n\n## Bidirectional NPM Compatibility\n\nCPM maintains full bidirectional compatibility with NPM:\n\n```bash\n# These all work seamlessly\nnpm install cpm\ncpm install npm\ncpm install express\nnpm install express\n```\n\n## API Reference\n\n### Core Functions\n- `cpm_init()` - Initialize CPM context\n- `cpm_install()` - Install packages\n- `cpm_uninstall()` - Remove packages\n- `cpm_update()` - Update packages\n- `cpm_list()` - List packages\n- `cpm_info()` - Package information\n- `cpm_audit()` - Security audit\n\n### Q Promise Functions\n- `q_promise_new()` - Create new promise\n- `q_promise_resolve()` - Resolve promise\n- `q_promise_reject()` - Reject promise\n- `q_promise_then()` - Success callback\n- `q_promise_catch()` - Error callback\n- `q_await()` - Await promise result\n\n### PMLL Functions\n- `pmll_new()` - Create new list\n- `pmll_add_package()` - Add package\n- `pmll_find_package()` - Find package\n- `pmll_remove_package()` - Remove package\n- `pmll_check_conflicts()` - Check version conflicts\n\n## Architecture\n\nCPM is built with a modular architecture:\n\n- **Core Engine**: Package management logic in C\n- **Q Promises**: Asynchronous operation handling\n- **PMLL**: Linked list-based package storage\n- **HTTP Client**: libcurl-based registry communication\n- **JSON Parser**: libjson-c for metadata handling\n- **NPM Wrapper**: Node.js compatibility layer\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch\n3. Make your changes\n4. Add tests\n5. Submit a pull request\n\n## License\n\nMIT License - see LICENSE file for details\n\n## Security\n\nCPM is designed with security in mind:\n- Memory-safe operations\n- Input validation\n- Secure HTTP communications\n- Buffer overflow protection\n\nReport security issues to security@cpm.dev\n\n## Performance\n\nCPM provides significant performance improvements over NPM:\n- Native C speed\n- Optimized memory usage\n- Efficient dependency resolution\n- Fast I/O operations\n\n## Support\n\n- GitHub Issues: https://github.com/cpm/cpm/issues\n- Documentation: https://cpm.dev/docs\n- Community: https://discord.gg/cpm\n\n---\n\n**CPM - Package Management, Reimagined in C** 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrqedwards%2Fcpm-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrqedwards%2Fcpm-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrqedwards%2Fcpm-cli/lists"}