Nimble: Packages and Project Management
24.1 Creating a Project
nimble init myapp # interactive: library, binary, or hybrid
nimble build # build binaries listed in .nimble
nimble run myapp # build and run
nimble install # install the current package
nimble test
nimble develop # link the package for local development24.2 The .nimble File
# myapp.nimble
version = "0.1.0"
author = "Your Name"
description = "A sample app"
license = "MIT"
srcDir = "src"
bin = @["myapp"]
requires "nim >= 2.0.0"
requires "jsony >= 1.1.5", "cligen"
requires "https://github.com/user/repo#head"
task docs, "Generate docs":
exec "nim doc --project --outdir:htmldocs src/myapp.nim"
before build:
echo "Building..."24.3 Managing Dependencies
Packages are listed in the nim-lang/packages registry (packages.json). Publish with nimble publish.
Local dependency mode (nimbledeps/), plus atlas as an alternative workspace manager.
nimble install jsony # install a package globally
nimble search http
nimble list --installed
nimble refresh # update the package list
nimble lock # nimble.lock for reproducible builds
nimble setup # creates nimble.paths for the compiler
nimble uninstall jsony24.4 Popular Packages
jester, prologue, happyx, mummy, karax (frontend), httpbeast jsony, json_serialization cligen, docopt, argparse, illwill (TUI), nimwave chronos (Status) malebolgia, taskpools, weave, threading db_connector, norm (ORM), debby, tiny_sqlite, lowdb nimx, owlkettle (GTK4), uing, fidget, nigui, wNim (Windows) naylib (raylib), nimgl, sdl2/sdl3 wrappers, godot-nim arraymancer, datamancer, ggplotnim, nimpy (Python interop), numericalnim regex, results, questionable, fusion, pixie (2D graphics), zippy (compression), nimcrypto
nimpy (call Python from Nim and write Python extensions in Nim), nimporter