{"id":13593933,"url":"https://github.com/itchyny/rexdep","last_synced_at":"2026-02-28T09:32:48.871Z","repository":{"id":57501123,"uuid":"45774704","full_name":"itchyny/rexdep","owner":"itchyny","description":"Roughly extract dependency relation from source code","archived":false,"fork":false,"pushed_at":"2021-09-18T14:30:30.000Z","size":88,"stargazers_count":177,"open_issues_count":0,"forks_count":9,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-01T23:13:38.739Z","etag":null,"topics":["cli-utility","dependency-graph","go","golang"],"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/itchyny.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}},"created_at":"2015-11-08T09:43:10.000Z","updated_at":"2024-10-21T08:20:13.000Z","dependencies_parsed_at":"2022-09-14T19:41:42.265Z","dependency_job_id":null,"html_url":"https://github.com/itchyny/rexdep","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/itchyny/rexdep","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Frexdep","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Frexdep/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Frexdep/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Frexdep/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itchyny","download_url":"https://codeload.github.com/itchyny/rexdep/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itchyny%2Frexdep/sbom","scorecard":{"id":496882,"data":{"date":"2025-08-11","repo":{"name":"github.com/itchyny/rexdep","commit":"a4bfba20eacd6dd87e4c9a3fadc520753842ad41"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.1,"checks":[{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/itchyny/rexdep/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/itchyny/rexdep/ci.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/itchyny/rexdep/release.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/itchyny/rexdep/release.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yaml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/itchyny/rexdep/release.yaml/main?enable=pin","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yaml:1","Warn: no topLevel permission defined: .github/workflows/release.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.3.2 not signed: https://api.github.com/repos/itchyny/rexdep/releases/49795656","Warn: release artifact v0.3.1 not signed: https://api.github.com/repos/itchyny/rexdep/releases/36179050","Warn: release artifact v0.3.0 not signed: https://api.github.com/repos/itchyny/rexdep/releases/27678715","Warn: release artifact v0.2.0 not signed: https://api.github.com/repos/itchyny/rexdep/releases/23102778","Warn: release artifact v0.1.0 not signed: https://api.github.com/repos/itchyny/rexdep/releases/16082030","Warn: release artifact v0.3.2 does not have provenance: https://api.github.com/repos/itchyny/rexdep/releases/49795656","Warn: release artifact v0.3.1 does not have provenance: https://api.github.com/repos/itchyny/rexdep/releases/36179050","Warn: release artifact v0.3.0 does not have provenance: https://api.github.com/repos/itchyny/rexdep/releases/27678715","Warn: release artifact v0.2.0 does not have provenance: https://api.github.com/repos/itchyny/rexdep/releases/23102778","Warn: release artifact v0.1.0 does not have provenance: https://api.github.com/repos/itchyny/rexdep/releases/16082030"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T20:38:24.696Z","repository_id":57501123,"created_at":"2025-08-19T20:38:24.696Z","updated_at":"2025-08-19T20:38:24.696Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29929350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"online","status_checked_at":"2026-02-28T02:00:07.010Z","response_time":90,"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":["cli-utility","dependency-graph","go","golang"],"created_at":"2024-08-01T16:01:26.530Z","updated_at":"2026-02-28T09:32:48.819Z","avatar_url":"https://github.com/itchyny.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# rexdep\n[![CI Status](https://github.com/itchyny/rexdep/workflows/CI/badge.svg)](https://github.com/itchyny/rexdep/actions)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/itchyny/rexdep/blob/main/LICENSE)\n[![release](https://img.shields.io/github/release/itchyny/rexdep/all.svg)](https://github.com/itchyny/rexdep/releases)\n\n### Roughly extract dependency relation from source code\nThe rexdep command is a tool for extracting dependency relation from software.\nThe command enables us to see the dependency relation among files, modules or packages written in any programming languages.\n\n[![rexdep](https://raw.githubusercontent.com/wiki/itchyny/rexdep/image/rexdep.png)](https://raw.githubusercontent.com/wiki/itchyny/rexdep/image/rexdep.png)\n\nWhen we see a large project, we want to understand the code structure intuitively.\nWe sometimes join a project at work, the project has lots of source code.\nWe sometimes want to make pull requests to famous OSS software, but the software is too large.\nHow can we understand the file structure of a huge project without reading through the software?\n\nIt is a good solution to check the module dependency relations among the software.\nA module in a software depends on other modules in that software.\nSome module depends on many other modules or another module does not depend on others.\nExtracting the module dependency enables us to understand the relationship among the modules.\nWe can use the dependency graph to read the software top down or bottom up.\nWe sometimes find the core modules in the project because such modules are depended by many other modules.\n\nSo, how can we extract dependency relation from a code base of software?\n\nThe idea of rexdep is very simple; in many cases, we can extract the module names by a regular expression.\nLet me explain by a simple example in C language, where we want to extract the dependency relations between the files, rather than modules.\nConsider a situation that `test1.c` includes `test2.c` and `test3.c`.\n```c\n/* This is test1.c */\n#include \"test2.c\"\n#include \"test3.c\"\n\nint main...\n```\nThe file `test1.c` depends on `test2.c` and `test3.c`.\nThis relation can be easily extracted using a simple regular expression.\n```bash\n $ grep '^#include \".*\"' test1.c | sed 's/^#include *\"\\(.*\\)\"/\\1/'\ntest2.c\ntest3.c\n```\nThis way can be applied for many languages.\nFor example, `import` keyword is used in Python and Haskell and `require` in Ruby.\n\nThe rexdep command enables us to specify the `pattern`, the regular expression to extract the module dependency from source codes.\nFor the above example, we can use rexdep to extract the dependency between the C source codes.\n```bash\n $ rexdep --pattern '^\\s*#include\\s*\"(\\S+)\"' test1.c\ntest1.c test2.c\ntest1.c test3.c\n```\nThe captured string is regarded as the file names included by the source code.\nWe can of course specify multiple files.\nWe can also specify directories and rexdep recursively investigate the source files under the subdirectories.\nAllowing the user to specify by regular expression, it can be used for various languages; `^\\s*#include\\s*[\u003c\"](\\S+)[\u003e\"]` for C language or `^\\s*import +(?:qualified +)?([[:alnum:].]+)` for Haskell language.\n\nThere are some other tools targeting on specific languages.\nFor example, there are some UML class diagram generating tools for object-oriented languages.\nThey investigate source codes at the level of abstract syntax tree and therefore much powerful.\nThe rexdep command, on the other hand, simply checks the source code by a regular expression given by the user.\nIt may not as powerful as AST-level tools, but the idea is very simple and can be used for many languages.\nNow you understand what rexdep stands for; *roughly extract dependency relation*.\n\n## Installation\n### Homebrew\n```bash\nbrew install itchyny/tap/rexdep\n```\n\n### Build from source\n```bash\ngo install github.com/itchyny/rexdep@latest\n```\n\n## Usage\n### Basic usage: --pattern, --format\nConsider the following sample file.\n```bash\n $ cat test1\nimport test2\nimport test3\n```\nWe want to extract the dependency relation from this file `test1`.\nSpecify `--pattern` the regular expression to extract the module names it imports.\n```bash\n $ rexdep --pattern 'import +(\\S+)' test1\ntest1 test2\ntest1 test3\n```\nThe output result shows that `test1` depends on `test2` and `test3`.\nEach line contains the space separated module names.\nThe captured strings in the `--pattern` argument are interpreted as the module names imported by each file.\nThe regular expression is compiled to `Regexp` type of Go language, so refer to the [document](https://golang.org/s/re2syntax) for the regexp syntax or try `go doc regexp/syntax`.\n\nNote that on Windows environment, use double quotes instead of single quotes (for example: `rexdep --pattern \"import +(\\S+)\" test1`).\n\nWe can use the rexdep command to output in the dot language\n```bash\n $ rexdep --pattern 'import +(\\S+)' --format dot test1\ndigraph \"graph\" {\n  \"test1\" -\u003e \"test2\";\n  \"test1\" -\u003e \"test3\";\n}\n```\nand it works perfectly with graphviz (dot command).\n```bash\n $ rexdep --pattern 'import +(\\S+)' --format dot test1 | dot -Tpng -o test.png\n```\n![example](https://raw.githubusercontent.com/wiki/itchyny/rexdep/image/example-1.png)\n\nAlso, it works for multiple files.\n```bash\n $ rexdep --pattern 'import +(\\S+)' --format dot test{1,2,3,4}\ndigraph \"graph\" {\n  \"test1\" -\u003e \"test2\";\n  \"test1\" -\u003e \"test3\";\n  \"test2\" -\u003e \"test4\";\n  \"test3\" -\u003e \"test4\";\n}\n $ rexdep --pattern 'import +(\\S+)' --format dot test{1,2,3,4} | dot -Tpng -o test.png\n```\n![example](https://raw.githubusercontent.com/wiki/itchyny/rexdep/image/example-2.png)\n\nThis is a basic example of rexdep.\n\nYou can also change the output format to JSON,\n```bash\n $ rexdep --pattern 'import +(\\S+)' --format json test{1,2,3,4}\n{\n  \"test1\": [\n    \"test2\",\n    \"test3\"\n  ],\n  \"test2\": [\n    \"test4\"\n  ],\n  \"test3\": [\n    \"test4\"\n  ]\n}\n```\nwhich may be piped to [jq](https://stedolan.github.io/jq/) command.\n\n### Module name: --module\nThe rexdep command uses the filenames to identify each file.\nThis is useful for C language but not for many other languages.\nFor example, we write `module ModuleName where` in Haskell.\nConsider the following two files.\n```bash\n $ cat Foo.hs\nmodule Foo where\nimport Bar\nimport System.Directory\n $ cat Bar.hs\nmodule Bar where\nimport System.IO\n```\nFirstly, we try the following command.\n```bash\n $ rexdep --pattern 'import (\\S+)' Foo.hs Bar.hs\nFoo.hs Bar\nFoo.hs System.Directory\nBar.hs System.IO\n```\nThe result looks bad and we will not be able to obtain the dependency graph we really want.\n\nWe have to tell rexdep to extract the module name as well.\nThe rexdep command enables us to specify the module name pattern.\nWe specify a regular expression to the argument of --module.\n```bash\n $ rexdep --pattern 'import (\\S+)' --module 'module (\\S+)' Foo.hs Bar.hs\nFoo Bar\nFoo System.Directory\nBar System.IO\n```\nNow it looks fine.\n\nA file sometimes contains multiple modules.\nWhen rexdep finds a new module in the file, the following packages will be regarded as imported by the new module.\nFor example, let us consider the following sample file.\n```bash\n $ cat sample1\nmodule A\nimport B\nimport C\n\nmodule B\nimport C\n\nmodule C\nimport D\n```\nIn this example, three modules exist in one file.\nThe following command works nice for this sample.\n```bash\n $ rexdep --pattern 'import (\\S+)' --module 'module (\\S+)' sample1\nA B\nA C\nB C\nC D\n```\nLet me show another example.\n```bash\n $ cat sample2\nA depends on B, C and D.\nB depends on C and D.\nC depends on D.\nD does not depend on other modules.\n```\nCan we extract the relations between them? With rexdep, the answer is yes.\n```bash\n $ rexdep --pattern 'depends on ([A-Z]+)(?:, ([A-Z]+))?(?:, ([A-Z]+))?(?: and ([A-Z]+))?' --module '^([A-Z]+) depends on ' sample2\nA B\nA C\nA D\nB C\nB D\nC D\n```\nThis example does not look like a practical use case.\nHowever, consider the following Makefile.\n```make\n $ cat Makefile\nall: clean build\n\nbuild: deps\n\tgo build\n\ninstall: deps\n\tgo install\n\ndeps:\n\tgo get -d -v .\n\nclean:\n\tgo clean\n\n.PHONY: all build install deps clean\n```\nNow rexdep can extract the target dependency relation from this Makefile.\n```sh\n $ rexdep --pattern '^[^.][^:]+: +(\\S+)(?: +(\\S+))?(?: +(\\S+))?' --module '^([^.][^:]+):' Makefile\nall build\nall clean\nbuild deps\ninstall deps\n```\nThe rexdep command enables the user to specify a regular expression and still seems to be useful for pretty complicated pattern like the above example.\n\n### Extraction range: --start, --end\nThe rexdep command checks the regular expression of `--pattern` against each line of files.\nHowever, it is sometimes difficult to extract from multiline syntax.\nHere's an example.\n```go\n $ cat sample.go\npackage main\n\n// \"foo\"\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/urfave/cli\"\n)\n\nfunc main() {\n\tfmt.Printf(\"Hello\")\n\t// ...\n```\nThe rexdep enables you to specify the range to extract from.\n```\n $ rexdep --pattern '\"(\\S+)\"' --module '^package +(\\S+)' --start '^import +\\($' --end '^\\)$' sample.go\nmain fmt\nmain github.com/urfave/cli\nmain os\n```\nWhen the argument of `--start` is specified, rexdep finds the line which matches to the regular expression.\nAfter it hits the starting line, it turns the internal enabled flag on and starts the extraction with the regular expression of `--patern`.\nThen it finds the ending line, it turns the enabled flag off and stops the extraction procedure.\n\nBoth starting and ending lines are inclusive.\nFor example, see the following example.\n```scala\nobject Foo extends Bar with Baz with Qux {\n  // random comment: X extends Y\n  // random comment: Y with Z\n}\n\nobject Qux\n  extends Quux\n     with Quuy\n     with Quuz {\n  // with Qyyy\n}\n```\nFirstly, we try with only `--pattern` and `--module` to extract the inheritance relation.\n```\n $ rexdep --pattern '(?:(?:extends|with) +([[:alnum:]]+))(?: +(?:extends|with) +([[:alnum:]]+))?(?: +(?:extends|with) +([[:alnum:]]+))?' --module '^object +(\\S+)' sample.scala\nFoo Bar\nFoo Baz\nFoo Qux\nFoo Y\nFoo Z\nQux Quux\nQux Quuy\nQux Quuz\nQux Qyyy\n```\nThis result is a failure; it keeps the extraction procedure inside bodies of the objects.\nFor this example, `--start` and `--end` work well.\n```sh\n $ rexdep --pattern '(?:(?:extends|with) +([[:alnum:]]+))(?: +(?:extends|with) +([[:alnum:]]+))?(?: +(?:extends|with) +([[:alnum:]]+))?' --module '^object +(\\S+)' --start '^object' --end '{' sample.scala\nFoo Bar\nFoo Baz\nFoo Qux\nQux Quux\nQux Quuy\nQux Quuz\n```\nThe rexdep command stops the extraction when it finds the line matches against the regular expression of `--end`.\n\n### Output: --format, --output\nWe can change the output format with --format option.\nThe rexdep command outputs the module names each line with a space by default.\nIn order to see the dependency graph, which is a very common case, you can specify `--format dot` and pipe the output to the dot command.\nYou can also use `--format json` and pipe to the jq command.\n\nThe rexdep uses the standard output to print the result.\nWhen you specify a filename to the --output option, the rexdep command outputs the result to the specified file.\n\n## Examples\n### [Git](https://github.com/git/git)\n```sh\n $ git clone --depth 1 https://github.com/git/git\n $ rexdep --pattern '^\\s*#include\\s*[\u003c\"](\\S+)[\u003e\"]' --format dot ./git/*.h | dot -Tpng -o git.png\n```\n[![git](https://raw.githubusercontent.com/wiki/itchyny/rexdep/image/git-1.png)](https://raw.githubusercontent.com/wiki/itchyny/rexdep/image/git.png)\nThe code base of Git is large and the above example checks only header files. The above image (click to see the full image) reveals the relationship between the header files.\n\n### [Vim](https://github.com/vim/vim)\n```sh\n $ git clone --depth 1 https://github.com/vim/vim\n $ rexdep --pattern '^\\s*#include\\s*[\u003c\"](\\S+)[\u003e\"]' --format dot ./vim/src/*.{c,h} | dot -Tpng -o vim.png\n```\n[![vim](https://raw.githubusercontent.com/wiki/itchyny/rexdep/image/vim-1.png)](https://raw.githubusercontent.com/wiki/itchyny/rexdep/image/vim.png)\nWe notice that the structure is flat and many files include `vim.h`.\n\n### [consul](https://github.com/hashicorp/consul)\n```sh\n $ git clone --depth 1 https://github.com/hashicorp/consul\n $ rexdep --pattern '\"github.com/(?:hashicorp/consul/(?:\\S+/)*)?(\\S+)\"' --module '^package +(\\S+)' --start '^import +[\"(]' --end '^\\)$|^import +\"' --format dot $(find ./consul/ -name '*.go' | grep -v '_test') | dot -Tpng -o consul.png\n```\n[![consul](https://raw.githubusercontent.com/wiki/itchyny/rexdep/image/consul-1.png)](https://raw.githubusercontent.com/wiki/itchyny/rexdep/image/consul.png)\nIt is difficult to extract dependency relation between files from Go source codes. We can use functions from the other files at the same directory without writing import. Instead, we can extract dependency relation between packages. The rexdep command extract the imported packages between the lines matched by the `start` and `end` arguments.\n\n### [pandoc](https://github.com/jgm/pandoc)\n```sh\n $ git clone --depth 1 https://github.com/jgm/pandoc\n $ rexdep --pattern '^\\s*import +(?:qualified +)?([[:alnum:].]+Pandoc[[:alnum:].]*)' --module '^module +([[:alnum:].]+Pandoc[[:alnum:].]*)' --format dot --recursive ./pandoc/src/ | dot -Tpng -o pandoc.png\n```\n[![pandoc](https://raw.githubusercontent.com/wiki/itchyny/rexdep/image/pandoc-1.png)](https://raw.githubusercontent.com/wiki/itchyny/rexdep/image/pandoc.png)\nWe can flexibly limit the modules by specific words.\n\n### [lens](https://github.com/ekmett/lens)\n```sh\n $ git clone --depth 1 https://github.com/ekmett/lens\n $ rexdep --pattern '^\\s*import +(?:qualified +)?(\\S+Lens\\S*)' --module '^module +(\\S+Lens\\S*)' --format dot --recursive ./lens/src/ | dot -Tpng -o lens.png\n```\n[![lens](https://raw.githubusercontent.com/wiki/itchyny/rexdep/image/lens-1.png)](https://raw.githubusercontent.com/wiki/itchyny/rexdep/image/lens.png)\nIt is very fun to see the dependency graph of cool libraries like lens, isn't it?\n\n## Bug Tracker\nReport bug at [Issues・itchyny/rexdep - GitHub](https://github.com/itchyny/rexdep/issues).\n\n## Author\nitchyny (https://github.com/itchyny)\n\n## License\nThis software is released under the MIT License, see LICENSE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitchyny%2Frexdep","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitchyny%2Frexdep","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitchyny%2Frexdep/lists"}