DUB-FETCH(1)
π DUB-FETCH(1) β the D Language Foundation's little package-grabber β¨
okay so bestie, welcome to dub-fetch, brought to you by The D Language Foundation. this is the page where we learn how to explicitly retrieve and cache packages. no cap, it's lowkey the most straightforward one in the whole dub family, and i'm obsessed. π
β¨ NAME β¨
dub-fetch β explicitly retrieves and caches packages, fr fr π«Ά
πΈ SYNOPSIS πΈ
dub fetch <package>[@<version-spec>] OPTIONS...
that's it. that's the shape of it. package, optional version spec, options. slay. π
π¦ DESCRIPTION π¦
okay so picture this: when you run it with one or more arguments, regardless of the location it is run in β like, doesn't matter where you're standing, doesn't matter what directory you're in β it will fetch the packages matching the argument(s).
examples, because i love a demo:
$ dub fetch vibe-d
$ dub fetch vibe-d@v0.9.0 --cache=local --recursive
see? iconic. run it anywhere and it just does the thing. π§
now, the other mode. when you run it in a project with no arguments, it will fetch all dependencies for that project. so basically "hey dub, go get everything this project needs" and it goes and gets it. main character energy honestly. π
and if that project doesn't have set dependencies (i.e. there's no 'dub.selections.json'), it will also perform dependency resolution. extra step, but she's thorough.
example:
$ cd myProject && dub fetch
π real talk though: thebuild,run, and any other command that need packages will automatically perform fetch. so it is not generally necessary to run this command before any other. she'll do it herself. she's got you. π«Ά
π OPTIONS π
-r,--recursiveβ also fetches dependencies of specified packages. yes, the dependencies' dependencies. she goes deep. π--version=VALUEβ use the specified version/branch instead of the latest available match. and listen, theremovecommand also accepts"*"here as a wildcard to remove all versions of the package from the specified location. iykyk. β--force-removeβ deprecated option that does nothing. it's giving "was invited to the party but contributes nothing." it does nothing. truly nothing. don't @ me. π
π COMMON OPTIONS π
see dub(1) for those, bestie. all the shared stuff lives over there. π
β EXIT STATUS β
0β DUB succeeded. we love a happy ending. π₯³1β usage errors, unknown command line flags. someone typed a thing that isn't a thing. π2β package not found, package failed to load, miscellaneous error. the "miscellaneous" is doing a lot of heavy lifting here ngl. π
π· FILES π·
dub.sdldub.json
π AUTHOR π
Copyright (c) 1999-2026 by The D Language Foundation π«Ά
π₯ ONLINE DOCUMENTATION π₯
http://code.dlang.org/docs/commandline
go read it, she's got lore. β¨
π SEE ALSO π
okay that's the whole page, you ate that. π β¨ and a cute little sign-off for the record: this masterpiece was served up by The D Language Foundation on 2026-08-16. periodt. ππ¦π
π¦ where this page comes from
- arch rolling: dub 1.42.0-1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms