Skip to content

Package Management

Chuks has a built-in package manager. Packages are installed directly from the CLI.

Use chuks add to install a package and add it to your project’s chuks.json:

Terminal window
chuks add di

Install a specific version:

Terminal window
chuks add di@1.0.0

This does three things:

  1. Downloads the package into chuks_packages/<name>/
  2. Adds "<name>": "^<version>" to the dependencies in chuks.json
  3. Increments the download count in the registry

After installing, import the package using the pkg/ prefix:

import { Container } from "pkg/di"
var c = new Container()

When you clone a project or want to reinstall everything listed in chuks.json:

Terminal window
chuks install

This reads the dependencies map from chuks.json and downloads each one from the registry.

Terminal window
chuks remove di

This deletes chuks_packages/di/ and removes the entry from chuks.json.

Update a specific package to its latest version:

Terminal window
chuks update di

Update all dependencies at once:

Terminal window
chuks update

If a package is already at the latest version, it is skipped.

Terminal window
chuks list

Shows all dependencies from chuks.json along with their version and whether the package files are present on disk:

PACKAGE VERSION STATUS
──────────────────────────────────────────────────
di ^1.0.0 installed
cron ^1.0.0 installed
postgres ^1.0.0 missing

A missing status means the dependency is declared in chuks.json but the chuks_packages/ directory doesn’t exist. Run chuks install to fix it.

View details about a package from the registry:

Terminal window
chuks info di
di@1.0.0
────────────────────────────────────────
Dependency injection container for Chuks
Author: Chuks Team
License: MIT
Entry: src/index.chuks
Repository: https://github.com/chuks-lang/DI
Keywords: di,ioc,container,dependency-injection
Downloads: 42
Published: 2026-03-23 16:52:44
README:
────────────────────────────────────────
# di
A dependency injection container for Chuks...
...

To publish your own package to the registry:

  1. Make sure your project has a chuks.json with the required fields:
{
"name": "my_package",
"version": "1.0.0",
"description": "What it does",
"entry": "src/index.chuks",
"author": "Your Name",
"license": "MIT",
"keywords": ["keyword1", "keyword2"],
"repository": "https://github.com/your-org/your-repo"
}
  1. Include a README.md in the project root (required).

  2. Commit and push your code to the repository.

  3. Run:

Terminal window
chuks publish

This will:

  • Read chuks.json and README.md
  • Compute a SHA-256 checksum
  • POST the package to the registry
  • Create and push a git tag (v1.0.0)

To publish a new version, bump the version field in chuks.json and run chuks publish again.

After installing packages, your project will look like this:

my_project/
├── chuks.json
├── src/
│ └── main.chuks
├── chuks_packages/
│ ├── di/
│ │ ├── chuks.json
│ │ └── src/
│ │ └── index.chuks
│ └── cron/
│ ├── chuks.json
│ └── src/
│ └── index.chuks
└── build/

The chuks_packages/ directory should be added to your .gitignore. Dependencies are restored with chuks install.

CommandDescription
chuks add <package>Install a package and add to dependencies
chuks add <package>@<version>Install a specific version
chuks installInstall all dependencies from chuks.json
chuks remove <package>Remove a package and its dependency entry
chuks update [package]Update one or all packages to latest
chuks listList installed packages and their status
chuks info <package>Show package details from the registry
chuks publishPublish the current package to the registry