nimble
Manage Nim language packages
TLDR
Search for packages
Install a package
List installed packages
Create a new Nimble package in the current directory
Build a Nimble package
Install a Nimble package
SYNOPSIS
nimble [options] [command] [arguments]
PARAMETERS
init [project_name]
Initializes a new Nimble project with a basic structure.
install [package_name]
Installs a specified package or all dependencies listed in the .nimble file.
update [package_name]
Updates installed packages to their latest compatible versions.
uninstall [package_name]
Removes an installed package from the system.
build
Compiles the project based on the configuration in the .nimble file, creating an executable.
test
Executes the project's defined tests.
publish
Publishes the current project as a new package to the NimbleDir registry.
tasks
Lists all custom tasks defined within the project's .nimble file.
refresh
Refreshes the local package list cache from the NimbleDir.
search [keyword]
Searches for packages in the NimbleDir registry matching the keyword.
--help [command]
Displays help information for nimble or a specific command.
--version
Shows the installed nimble version.
--verbose
Enables verbose output for more detailed information during execution.
DESCRIPTION
nimble is the official package manager and build tool for the Nim programming language. It streamlines the development workflow by managing project dependencies, allowing developers to install, update, and uninstall packages from the Nim package registry (NimbleDir) or other sources like Git repositories.
Beyond dependency management, nimble facilitates project creation, compilation, testing, and even publishing packages. It interprets a project's .nimble file, which defines metadata, dependencies, and custom tasks. This makes it an indispensable utility for anyone working with Nim, abstracting away complex build configurations and providing a consistent way to manage Nim projects and their external libraries. It integrates deeply with the Nim compiler to provide a seamless build experience.
CAVEATS
nimble is specific to the Nim programming language ecosystem. It requires the Nim compiler and runtime to be installed on your system. It is not a general-purpose Linux utility like ls or grep, but rather an application-specific tool primarily for Nim development. Its functionality is entirely dependent on the presence and structure of a .nimble project file.
THE .NIMBLE FILE
This manifest file, typically named after the project (e.g., myproject.nimble), is central to how nimble understands and manages a project. It defines project metadata, dependencies, source paths, and custom tasks, serving as the core configuration for nimble operations.
NIMBLEDIR REGISTRY
By default, nimble fetches packages from the official NimbleDir registry, a centralized online repository for published Nim packages. Users can also specify Git URLs or local paths for packages not available in the registry.
HISTORY
nimble was developed as an integral part of the Nim programming language project itself, evolving alongside the compiler to provide a comprehensive package management and build system. Its design was influenced by successful package managers in other ecosystems, aiming to offer a user-friendly and efficient tool for Nim developers. It quickly became the de-facto standard for managing Nim projects and dependencies within the Nim community.