# Is a package to trawl through the files in a package/folder and surface all the packages used within?

**URL:** <https://discourse.julialang.org/t/is-a-package-to-trawl-through-the-files-in-a-package-folder-and-surface-all-the-packages-used-within/75929>\
**Category:** General Usage\
**Created:** [February 7, 2022, 1:10am UTC](https://discourse.julialang.org/t/is-a-package-to-trawl-through-the-files-in-a-package-folder-and-surface-all-the-packages-used-within/75929 "2022-02-07T01:10:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [February 7, 2022, 1:10am UTC](https://discourse.julialang.org/t/is-a-package-to-trawl-through-the-files-in-a-package-folder-and-surface-all-the-packages-used-within/75929/1 "2022-02-07T01:10:24Z")

</div>

R’s renv has a function called `renv::init()` which does that.

Also, for bonus points, is there a package to automatically put bounds on the Project.toml for each package that is used?

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [February 7, 2022, 3:25am UTC](https://discourse.julialang.org/t/is-a-package-to-trawl-through-the-files-in-a-package-folder-and-surface-all-the-packages-used-within/75929/2 "2022-02-07T03:25:54Z")

</div>

Would this work for you?  
`find . -name "*.jl" -exec grep using {} \; | sort | uniq`

---

<div class="post-metadata">

**Author:** ![simonbyrne](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simonbyrne/32/19_2.png) [@simonbyrne](https://discourse.julialang.org/u/simonbyrne)\
**Post date:** [February 10, 2022, 5:44am UTC](https://discourse.julialang.org/t/is-a-package-to-trawl-through-the-files-in-a-package-folder-and-surface-all-the-packages-used-within/75929/3 "2022-02-10T05:44:41Z")

</div>

The Manifest.toml contains all the dependencies of the current project, and their versions.

---

<div class="post-metadata">

**Author:** ![GunnarFarneback](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunnarfarneback/32/1827_2.png) [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Post date:** [February 10, 2022, 8:33am UTC](https://discourse.julialang.org/t/is-a-package-to-trawl-through-the-files-in-a-package-folder-and-surface-all-the-packages-used-within/75929/4 "2022-02-10T08:33:36Z")

</div>

> [@xiaodai](#):
>
> Also, for bonus points, is there a package to automatically put bounds on the Project.toml for each package that is used?

It’s not automatic, but [PackageCompatUI](https://github.com/GunnarFarneback/PackageCompatUI.jl) makes it quite convenient to add compat bounds.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [February 11, 2022, 6:21am UTC](https://discourse.julialang.org/t/is-a-package-to-trawl-through-the-files-in-a-package-folder-and-surface-all-the-packages-used-within/75929/5 "2022-02-11T06:21:12Z")

</div>

> [@xiaodai](#):
>
> is there a package to automatically put bounds on the Project.toml for each package that is used?

[CompatHelperLocal](https://juliahub.com/ui/Packages/CompatHelperLocal/x5A3V/) _(disclaimer: my package)_ does exactly this (and more): checks whether all dependencies have a `compat` entry, and whether the entries are up to date. If not, suggests the replacement `[compat]` section to put into `Project.toml`.
