{"id":18961404,"url":"https://github.com/nushell/nupm","last_synced_at":"2026-02-25T12:42:50.821Z","repository":{"id":168047931,"uuid":"643475730","full_name":"nushell/nupm","owner":"nushell","description":"A manager for Nushell packages.","archived":false,"fork":false,"pushed_at":"2025-01-28T15:17:02.000Z","size":103,"stargazers_count":193,"open_issues_count":20,"forks_count":15,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-01-28T16:25:44.358Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nushell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nushell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-21T09:32:44.000Z","updated_at":"2025-01-28T15:17:07.000Z","dependencies_parsed_at":"2024-03-16T18:58:37.834Z","dependency_job_id":"0e853e6f-2c22-4d6d-af91-c5080d9bfa6a","html_url":"https://github.com/nushell/nupm","commit_stats":null,"previous_names":["nushell/nupm"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nushell%2Fnupm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nushell%2Fnupm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nushell%2Fnupm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nushell%2Fnupm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nushell","download_url":"https://codeload.github.com/nushell/nupm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239958284,"owners_count":19724925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T14:12:39.712Z","updated_at":"2026-02-25T12:42:50.815Z","avatar_url":"https://github.com/nushell.png","language":"Nushell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nupm - Nushell package manager\n\n## Table of content\n- [*installation*](#recycle-installation-toc)\n- [*configuration*](#gear-configuration-toc)\n- [*usage*](#rocket-usage-toc)\n  - [*install a package*](#install-a-package-toc)\n  - [*update a package*](#update-a-package-toc)\n  - [*define a package*](#define-a-package-toc)\n- [*running a test suite*](#test_tube-running-a-test-suite-toc)\n  - [*run the tests*](#run-the-tests-of-Nupm-toc)\n- [*design*](#memo-design-of-nupm-toc)\n\n:warning: **This project is in an experimentation stage and not intended for serious use!** :warning:\n\n## :recycle: installation [[toc](#table-of-content)]\n\u003e **Important**\n\u003e `nupm` might use the latest Nushell language features that have not been released in the latest version yet.\n\u003e If that is the case, consider building Nushell from the `main` branch, or installing the [nightly build](https://github.com/nushell/nightly).\n\n`nupm` is a module. Download the repository and treat the [`nupm`](https://github.com/nushell/nupm/tree/main/nupm`) directory as a module. For example:\n* `use nupm/`\n* `overlay use nupm/ --prefix`\n\nBoth of the above commands will make `nupm` and all its subcommands available in your current scope. `overlay use` will allow you to `overlay hide` the `nupm` overlay when you don't need it.\n\n\u003e **Note**\n\u003e `nupm` is able to install itself: from outside the root of your local copy of `nupm`, run\n\u003e ```nushell\n\u003e use nupm/nupm\n\u003e nupm install nupm --force --path\n\u003e ```\n\n## :gear: configuration [[toc](#table-of-content)]\nOne can change the location of the Nupm directory with `$env.NUPM_HOME`, e.g.\n```nushell\n# env.nu\n\n$env.NUPM_HOME = ($env.XDG_DATA_HOME | path join \"nupm\")\n```\n\nBecause Nupm will install modules and scripts in `{{nupm-home}}/modules/` and `{{nupm-home}}/scripts/` respectively, it is a good idea to add these paths to `$env.NU_LIB_DIRS` and `$env.PATH` respectively, e.g. if you have `$env.NUPM_HOME` defined:\n```nushell\n# env.nu\n\n$env.NU_LIB_DIRS = [\n    ...\n    ($env.NUPM_HOME | path join \"modules\")\n]\n\n$env.PATH = (\n    $env.PATH\n        | split row (char esep)\n        | ....\n        | prepend ($env.NUPM_HOME | path join \"scripts\")\n        | uniq\n)\n```\n\n## :rocket: usage [[toc](#table-of-content)]\n\nNupm can install different types of packages, such as modules and scripts. It also provides a mechanism for a custom installation using a `build.nu` file.\n\nAs an illustrative example, the following demonstrates use of a fictional `foo` module-based package.\n\n### install a package [[toc](#table-of-content)]\n\n```nushell\ngit clone https://github.com/nushell/foo.git\nnupm install foo --path\n```\n\nor\n\n```nushell\nnupm install https://github.com/nushell/foo.git --git\n```\n\n### update a package [[toc](#table-of-content)]\n\nAssuming the repository is already cloned, you can update the module package with the following:\n\n```nushell\ndo { cd foo; git pull }\nnupm install foo --force --path\n```\nThis usage will likely change once a dedicated `nupm update` command is added.\n\n### define a package [[toc](#table-of-content)]\n\nIn order to use a module-based package with Nupm, a directory should be structured similar to the following `foo` module:\n\n- `foo/`\n    - `mod.nu`\n    - (other scripts and modules)\n- `nupm.nuon`\n\nThe `nupm.nuon` file is a metadata file that describes the package. It should contain the following fields:\n\n```nushell\n{\n    name: \"foo\"\n    description: \"A package that demonstrates use of Nupm\"\n    type: \"module\"\n    license: \"MIT\"\n}\n```\n\nNupm also supports other types of packages. See [Project Structure](https://github.com/nushell/nupm/blob/main/docs/design/README.md#project-structure-toc) for more details.\n\n## :test_tube: running a test suite [[toc](#table-of-content)]\nas it is done in Nupm, one can define tests in a project and run them with the `nupm test` command:\n- create a Nushell package with a `nupm.nuon` file, let's call this example package `package`\n- create a `tests/` directory next to the `package/` directory\n- `tests/` is a regular Nushell directory module, put a `mod.nu` there and any structure you want\n- import definitions from the package with something like\n```nushell\nuse ../package/foo/bar.nu [baz, brr]\n```\n- all the commands defined in the `tests/` module and `export`ed will run as tests\n- from the root of the repo, run `nupm test`\n\n### run the tests of Nupm [[toc](#table-of-content)]\nfrom the root of Nupm, run\n```nushell\nnupm test\n```\nyou should see something like\n```\nTesting package /home/amtoine/documents/repos/github.com/amtoine/nupm\ntests install-module ... SUCCESS\ntests install-script ... SUCCESS\ntests install-custom ... SUCCESS\nRan 3 tests. 3 succeeded, 0 failed.\n```\n\n## :memo: design of `nupm` [[toc](#table-of-content)]\nplease have a look at [the design document](docs/design/README.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnushell%2Fnupm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnushell%2Fnupm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnushell%2Fnupm/lists"}