{"id":25931156,"url":"https://github.com/nwiizo/cargo-autodd","last_synced_at":"2025-08-31T22:13:55.014Z","repository":{"id":277844950,"uuid":"933705369","full_name":"nwiizo/cargo-autodd","owner":"nwiizo","description":"A tool that automatically manages Rust dependencies by analyzing your source code and updating Cargo.toml","archived":false,"fork":false,"pushed_at":"2025-03-15T11:37:10.000Z","size":596,"stargazers_count":47,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-29T23:51:42.422Z","etag":null,"topics":["rust","rust-lang"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/cargo-autodd","language":"Rust","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/nwiizo.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-02-16T14:06:51.000Z","updated_at":"2025-06-19T04:16:40.000Z","dependencies_parsed_at":"2025-02-16T15:21:01.219Z","dependency_job_id":"cc04ca7e-4903-4e43-926f-a533ea720e30","html_url":"https://github.com/nwiizo/cargo-autodd","commit_stats":null,"previous_names":["nwiizo/cargo-autodd"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/nwiizo/cargo-autodd","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwiizo%2Fcargo-autodd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwiizo%2Fcargo-autodd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwiizo%2Fcargo-autodd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwiizo%2Fcargo-autodd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nwiizo","download_url":"https://codeload.github.com/nwiizo/cargo-autodd/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nwiizo%2Fcargo-autodd/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273047150,"owners_count":25036302,"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-08-31T02:00:09.071Z","response_time":79,"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":["rust","rust-lang"],"created_at":"2025-03-03T23:58:07.969Z","updated_at":"2025-08-31T22:13:55.008Z","avatar_url":"https://github.com/nwiizo.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# 📦 cargo-autodd\n\nA Cargo subcommand that automatically manages dependencies in your Rust projects.\n\n## 🔍 Overview\n\ncargo-autodd simplifies Rust dependency management by automatically adding required crates to your Cargo.toml based on `use` statements, `extern crate` declarations, and direct references in your code.\n\n![cargo-autodd demo](.github/cargo-autodd_01.gif)\n\n## ✨ Features\n\n- 🔎 Scans Rust source files for imports and direct references\n- 🤖 Automatically detects required dependencies\n- ⬆️ Updates Cargo.toml with the latest stable versions (including patch versions)\n- 🗑️ Removes unused dependencies\n- 📊 Generates dependency usage reports\n- 🔒 Checks for security vulnerabilities\n- 🏢 Supports Cargo workspaces and monorepo structures\n- 🛡️ Handles internal crates with path dependencies correctly\n- 🐛 Debug mode for detailed analysis\n- 🔍 Detects direct references without use statements (e.g., `serde_json::Value`)\n- 🔄 Preserves original crate names (handles dashes and underscores correctly)\n\n## 📥 Installation\n\n```bash\ncargo install cargo-autodd\n```\n\n## ⚙️ Requirements\n\n- 🦀 Rust 1.56.0 or later\n- 📦 Cargo\n\n## 🚀 Usage\n\n### Command Line Interface\n\n```bash\n# Show help information\ncargo autodd --help\n\n# Analyze and update dependencies in the current project\ncargo autodd\n\n# Run with debug mode for detailed analysis\ncargo autodd --debug\n# or\ncargo autodd -d\n```\n\n### Update Dependencies\n\n```bash\n# Check and update all dependencies to their latest versions\ncargo autodd update\n```\n\n### Generate Reports\n\n```bash\n# Generate a detailed dependency usage report\ncargo autodd report\n```\n\n### Security Check\n\n```bash\n# Check for security vulnerabilities\ncargo autodd security\n```\n\n### Monorepo Usage\n\n```bash\n# Run in the root of your workspace to analyze all crates\ncargo autodd\n\n# Run in a specific crate directory within the workspace\ncd crates/my-crate\ncargo autodd\n```\n\nWhen using cargo-autodd in a monorepo:\n- Internal crates with `path` dependencies are automatically detected\n- The tool respects `publish = false` settings\n- Dependencies are correctly managed across the workspace\n\n### Debug Mode\n\nIn debug mode, the following detailed information is displayed:\n\n- 🔍 Path of detected Rust files\n- 📝 Content of each line being processed\n- 🔎 Detected `use` statements and base crate names\n- 📦 Details of nested imports\n- 🔧 Detection of `extern crate` statements\n- 📊 Analysis results of each file\n- 📋 Final list of crate references\n\n## 🔄 How It Works\n\n1. 📝 Analyzes your Rust source files\n2. 🔍 Detects import statements, external crate declarations, and direct references\n3. ⚡ Updates Cargo.toml with required dependencies\n4. ✅ Verifies changes with `cargo check`\n5. 🔒 Checks for security vulnerabilities\n6. 📊 Generates detailed reports about dependency usage\n\n## 🏢 Monorepo Support\n\ncargo-autodd fully supports Cargo workspaces and monorepo structures:\n\n- 🔄 Correctly detects and handles internal crates within a workspace\n- 🛡️ Respects `publish = false` settings for internal crates\n- 🔗 Properly handles path dependencies in both standard and inline table formats:\n  ```toml\n  # Both formats are supported:\n  internal-crate = { path = \"../internal-crate\" }\n  \n  [dependencies.another-internal-crate]\n  path = \"../another-internal-crate\"\n  ```\n- 🚫 Avoids searching for internal crates on crates.io\n- 🧩 Works with workspace inheritance for dependency management\n\nThis ensures that your internal crates that aren't meant to be published to crates.io are handled correctly, avoiding errors like `Crate 'internal_crate' not found on crates.io`.\n\n## 👥 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## 📜 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## 👤 Author\n\nnwiizo ([@nwiizo](https://x.com/nwiizo))\n\n## 🎉 Related Projects\n\n- [cargo.nvim](https://github.com/nwiizo/cargo.nvim)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwiizo%2Fcargo-autodd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnwiizo%2Fcargo-autodd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnwiizo%2Fcargo-autodd/lists"}