JPM(1)
JPM(1) β the Janet Project Manager, a build tool for Janet π β¨
Okay bestie, so jpm is literally the Janet Project Manager β a build tool for Janet β and it's about to be your new fave. The manual page name is JPM(1) (General Commands Manual, if you're keeping score), and I'm gonna walk you through the whole thing, no cap.
β¨ SYNOPSIS β¨
jpm [--flag ...] [--option=value ...] command args...
Like, you give it flags, you give it --option=value pairs, you give it a command, and you give it args. That's the whole vibe. Periodt.
πΈ DESCRIPTION πΈ
So jpm is used for building Janet projects, installing dependencies, installing projects, building native modules, and exporting your Janet project to a standalone executable. I know, iconic multitasker behavior. Although it's not required for working with Janet, it removes like so much of the boilerplate with installing dependencies and building native modules. Think of it as your main character project manager.
Real talk though β jpm requires only janet to run, and it uses git to install dependencies. And yes, bestie, jpm will work without git installed. π«Ά
π DOCUMENTATION π
So jpm has several subcommands, each used for managing either a single Janet project or all Janet modules installed on the system. Global commands β the ones that manage modules at the system level β do things like install and uninstall packages, as well as clear the cache. But the more interesting ones are the local commands. For more information on jpm usage, see https://janet-lang.org/docs/index.html
For information on flags, see the usage documentation in the tool. iykyk.
π COMMANDS π
helpβ Shows the usage text and exits immediately. Like a little goodbye wave. πbuildβ Builds all artifacts specified in theproject.janetfile in the current directory. Artifacts will be created in the./build/directory. Slay.configure[path]β Create a directory for out-of-tree builds, and also set project options. Whilejpmdoes not require an explicit configure step, this can be used to avoid needing to set the same options repeatedly. Out of tree builds are also a convenient way to have multiple configurations at the same time, such as a relase build and a debug build. (Yes, "relase" β that's literally how it's spelled in the original, don't come for me. π)install [repo...]β When run with no arguments, installs all installable artifacts in the current project to the currentJANET_MODPATHfor modules andJANET_BINPATHfor executables and scripts. Can also take an optional git repository URL and will install all artifacts in that repository instead. When run with an argument,installdoes not need to be run from ajpmproject directory. Will also install multiple dependencies in one command. Obsessed with the efficiency.update-installedβ Update to the latest version of all installed packges. Will do this by reinstalling from source control with latest available tag for each bundle. May overwrite any bundles that have been installed to a specific tag. ("packges" is also literally how it's spelled. We keep the typos, they're part of the lore. π)uninstall [name...]β Uninstall a project installed withinstall.uninstallexpects the name of the project, not the repository url, path to installed file, or executable name. The name of the project must be specified at the top of theproject.janetfile in thedeclare-projectform. If no name is given, uninstalls the current project if installed. Will also uninstall multiple packages in one command. Read that again bestie β the name, not the URL. πcleanβ Remove all artifacts created byjpm. This just deletes the build folder. Simple, clean, fresh start energy. π§testβ Runsjpmtests.jpmwill run all janet source files in the test directory as tests. A test is considered failing if it exits with a non-zero exit code. No vibes-based grading here, it's all about that exit code.depsβ Install all dependencies that this project requires recursively.jpmdoes not resolve dependency issues, like conflicting versions of the same module are required, or different modules with the same name. Dependencies are installed withgit, sodepsrequiresgitto be on thePATH. Heads up: it's giving "you're on your own for conflict resolution."clear-cacheβjpmcaches git repositories that are needed to install modules from a remote source in a global cache ($JANET_PATH/.cache). If these dependencies are out of date or too large,clear-cachewill remove the cache andjpmwill rebuild it when needed.clear-cacheis a global command, so aproject.janetis not required. Global queen behavior. πlist-installedβ List all installed packages in the current syspath.list-pkgs [search]β List all package aliases in the current package listing that contain the given search string. If no search string is given, prints the entire listing. Search bar, but make it terminal. πclear-manifestβjpmcreates a manifest directory that contains a list of all installed files. By deleting this directory,jpmwill think that nothing is installed and will try reinstalling everything on thejpm depsorjpm load-lockfilecommands. Be careful with this command, as it may leave extra files on your system and shouldn't be needed most of the time in a healthy install. Okay this one is highkey dangerous, bestie β treat it like the "delete system32" of jpm. β οΈrun [rule]β Run a given rule defined inproject.janet. Project definitions files (project.janet) usually contain a few artifact declarations, which set up rules thatjpmcan then resolve, or execute. Aproject.janetcan also create custom rules to create arbitrary files or run arbitrary code, much likemake.runwill run a single rule or build a single file. Very make-coded of it.rulesβ List all rules that can be run viarun. This is useful for exploring rules in the project. Little peek behind the curtain. π¦rule-tree [root] [depth]β Show rule dependency tree in a pretty format. Optionally provide a rule to use as the tree root, as well as a max depth to print. By default, prints the full tree for all rules. This can be quite long, so it is recommended to give a root rule. Trust β give it a root rule, the full tree is long long. πshow-pathsβ Show all of the paths used when installing and building artifacts. The receipts, basically. π§Ύupdate-pkgsβ Update the package listing by installing the'pkgs'package. Same asjpm install pkgs. Two ways, one vibe.quickbin [entry] [executable]β Create a standalone, statically linked executable from a Janet source file that contains amainfunction. Themainfunction is the entry point of the program and will receive command line arguments as function arguments. The entry file can import other modules, including native C modules, andjpmwill attempt to include the dependencies into the generated executable. Standalone executable arc, we love to see it. π₯replβ Run a repl in the same environment as the test environment. Allows you to use built natives without installing them. Bestie REPL. πdebug-replβ Load the currentproject.janetfile and start a repl in it's environment. This lets a user better debug the project file, as well as run rules manually. For when you gotta go under the hood. ("it's" is in the original too β we don't fix grammar here, we preserve facts.) π«Άmake-lockfile [filename]β Create a lockfile. A lockfile is a record that describes what dependencies were installed at the time of the lockfile's creation, including exact versions. A lockfile can then be later used to set up that environment on a different machine viaload-lockfile. By default, the lockfile is created atlockfile.jdn, although any path can be used. Snapshot of your dependency era. πΈload-lockfile [filename]β Install dependencies from a lockfile previously created withmake-lockfile. By default, will look for a lockfile atlockfile.jdn, although any path can be used. The other half of the lockfile duo. β¨new-project [name]β Create a new Janet project interactively in a directory"name".new-c-project [name]β Create a new C+Janet project interactively in a directory"name". C plus Janet, a collab we didn't know we needed.new-exe-project [name]β Create a new project for an executable in a directory"name".
π ENVIRONMENT π
Okay these env vars are the glue holding the whole operation together. Learn them, love them.
JANET_TREEβ A convenient way to set themodpath,binpath,syspath, andmanpathall at once. This is equivalent to the--treeparameter tojpm. One var to rule them all. πJANET_PATHβ The location to look for Janet libraries. This is the only environment variable Janet needs to find native and source code modules. If noJANET_PATHis set, Janet will look in the default location set at compile time, which can be determined with(dyn :syspath). Literally the one that matters most.JANET_MODPATHβ The location thatjpmwill use to install libraries to. Defaults toJANET_PATH, but you could set this to a different directory if you want to. Doing so would let you import Janet modules on the normal system path (JANET_PATHor(dyn :syspath)), but install to a different directory. It is also a more reliable way to install. This variable is overwritten by the--modpath=/some/pathif it is provided. Fancy install separation, we stan.JANET_HEADERPATHβ The location thatjpmwill look for janet header files (janet.handjanetconf.h) that are used to build native modules and standalone executables. Ifjanet.handjanetconf.hare available as default includes on your system, this value is not required. If not provided, will default to<jpm script location>/../include/janet. The--headerpath=/some/pathoption will override this variable.JANET_LIBPATHβ Similar toJANET_HEADERPATH, this path is wherejpmwill look forlibjanet.afor creating standalone executables. This does not need to be set on a normal install. If not provided, this will default to<jpm script location>/../lib. The--libpath=/some/pathoption will override this variable.JANET_BINPATHβ The directory wherejpmwill install binary scripts and executables to. Defaults to(dyn :syspath)/bin. The--binpath=/some/pathwill override this variable.JANET_BUILDPATHβ The directory wherejpmwill put intermediate files, object code, and compiled executables. Defaults to./build. The--buildpath=/some/pathwill override this variable. You should make that directories above this directory exist before building. (Read that carefully bestie β make those dirs first! Also yes, "that directories" is the original wording, we keep it. π)JANET_PKGLISTβ The git repository URL that contains a listing of packages. This allows installing packages with short names, which is mostly a convenience. However, package dependencies can use short names, package listings can be used to choose a particular set of dependency versions for a whole project. Convenience with a side of dependency control. πJANET_GITβ An optional path to agitexecutable to use to clone git dependencies. By default, uses"git"on the current$PATH. You shouldn't need to set this if you have a normal install ofgit. If it ain't broke. π§JANET_JPM_CONFIGβ An optional path to a config file to load. This option is overridden by the--config-filecommand line option. Command line stays winning. β
π AUTHOR π
Written by Calvin Rose <calsrose@gmail.com>. An absolute legend, we thank him for his service. π«Ά
Okay bestie, that's the whole manual β every flag, every command, every env var, every single detail, preserved like the crown jewels. Now go forth and build something iconic. πβ¨
This was JPM(1) from the General Commands Manual β page version JPM(1), and yes, that footer appears both at the top and the bottom, because symmetry. No date was listed on this page, so no date to give, sorry bestie. π
π¦ where this page comes from
- arch rolling: jpm 1.2.0-1 Β· MIT
- nixos 26.05: jpm 1.2.0
- nixpkgs unstable: jpm 1.2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms