Package Management
Chuks has a built-in package manager. Packages are installed directly from the CLI.
Adding a Package
Section titled “Adding a Package”Use chuks add to install a package and add it to your project’s chuks.json:
chuks add diInstall a specific version:
chuks add di@1.0.0This does three things:
- Downloads the package into
chuks_packages/<name>/ - Adds
"<name>": "^<version>"to thedependenciesinchuks.json - 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()Installing All Dependencies
Section titled “Installing All Dependencies”When you clone a project or want to reinstall everything listed in chuks.json:
chuks installThis reads the dependencies map from chuks.json and downloads each one from the registry.
Removing a Package
Section titled “Removing a Package”chuks remove diThis deletes chuks_packages/di/ and removes the entry from chuks.json.
Updating Packages
Section titled “Updating Packages”Update a specific package to its latest version:
chuks update diUpdate all dependencies at once:
chuks updateIf a package is already at the latest version, it is skipped.
Listing Installed Packages
Section titled “Listing Installed Packages”chuks listShows 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 missingA missing status means the dependency is declared in chuks.json but the chuks_packages/ directory doesn’t exist. Run chuks install to fix it.
Package Info
Section titled “Package Info”View details about a package from the registry:
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... ...Publishing a Package
Section titled “Publishing a Package”To publish your own package to the registry:
- Make sure your project has a
chuks.jsonwith 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"}-
Include a
README.mdin the project root (required). -
Commit and push your code to the repository.
-
Run:
chuks publishThis will:
- Read
chuks.jsonandREADME.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.
Project Structure
Section titled “Project Structure”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.
Command Summary
Section titled “Command Summary”| Command | Description |
|---|---|
chuks add <package> | Install a package and add to dependencies |
chuks add <package>@<version> | Install a specific version |
chuks install | Install 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 list | List installed packages and their status |
chuks info <package> | Show package details from the registry |
chuks publish | Publish the current package to the registry |