Skip to content
Hoody.com

The Package Management endpoints let you read, compare, initialize, update, install, and pin package.json dependencies inside a project. Use these endpoints to inspect the current state of a package.json, reconcile declared versus installed packages, scaffold a new manifest, install new dependencies on demand, and lock declared versions to exact pins.

All endpoints are namespaced under the exec service and addressed through the exec container hostname. They accept a JSON request body where applicable and return JSON.

Returns the current package.json for the project, including its raw content, separated dependency maps, scripts, and counts.

This endpoint takes no parameters.

Terminal window
curl -X GET "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/package/read" \
-H "Authorization: Bearer <token>"
{
"path": "/app/package.json",
"content": {
"name": "hoody-exec-project",
"version": "1.0.0",
"description": "Hoody Exec project",
"main": "src/index.ts",
"scripts": {
"start": "bun src/index.ts"
}
},
"dependencies": {
"lodash": "^4.17.21"
},
"devDependencies": {
"typescript": "^5.3.3"
},
"scripts": {
"start": "bun src/index.ts"
},
"dependencyCount": 1,
"devDependencyCount": 1
}

Compares the dependencies declared in package.json against the packages actually installed in node_modules and reports missing, outdated, and extra entries.

This endpoint takes no parameters.

This endpoint accepts an empty JSON object as the request body.

Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/package/compare" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d "{}"
{
"summary": {
"total": 5,
"installed": 3,
"missing": 1,
"outdated": 1,
"extra": 0
},
"missing": ["chalk"],
"outdated": [
{
"package": "lodash",
"declared": "^4.17.21",
"installed": "4.17.20"
}
],
"extra": [],
"allInstalled": false,
"upToDate": false
}

Creates a new package.json at the project root if one does not already exist. Returns the generated manifest and a created flag.

This endpoint takes no parameters.

NameTypeRequiredDefaultDescription
namestringNo"hoody-exec-project"Package name written to package.json.
versionstringNo"1.0.0"Initial version written to package.json.
descriptionstringNo"Hoody Exec project"Description written to package.json.
forcebooleanNofalseOverwrite package.json if it already exists.
Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/package/init" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "hoody-exec-project",
"version": "1.0.0",
"description": "Hoody Exec project",
"force": false
}'
{
"message": "package.json created successfully",
"path": "/app/package.json",
"content": {
"name": "hoody-exec-project",
"version": "1.0.0",
"description": "Hoody Exec project",
"main": "src/index.ts",
"scripts": {
"start": "bun src/index.ts",
"compile:modern": "bun build --compile --external=* --outfile bin/hoody-exec src/index.ts",
"build:openapi": "bun run"
},
"dependencies": {}
},
"created": true
}

Updates an existing package.json by adding or modifying dependencies, scripts, metadata, and by removing named packages.

This endpoint takes no parameters.

NameTypeRequiredDescription
dependenciesstringNoDependency entries to add or update, expressed as a single string in the form accepted by the underlying package manager (for example lodash@^4.17.21).
scriptsstringNoScript entries to add or update, expressed as a single string in name=command form (for example start=bun src/index.ts).
metadataobjectNoAdditional metadata fields to merge into package.json.
removestringNoName of a single dependency to remove from package.json.
Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/package/update" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"dependencies": "lodash@^4.17.21",
"scripts": "start=bun src/index.ts"
}'
{
"message": "package.json updated successfully",
"changes": [
"added lodash@^4.17.21 to dependencies",
"updated script start"
],
"changeCount": 2,
"dependencies": {
"lodash": "^4.17.21"
}
}

Kicks off an installation of the listed packages (or all declared dependencies when the list is omitted) and returns immediately with the command that was launched.

This endpoint takes no parameters.

NameTypeRequiredDefaultDescription
packagesarrayNoPackage specifiers to install (for example ["lodash@^4.17.21"]). When omitted, all declared dependencies are installed.
devbooleanNofalseInstall as devDependencies.
savebooleanNotruePersist installed packages to package.json.
forcebooleanNofalseForce a reinstall even if packages are already installed.
Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/package/install" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"packages": ["lodash@^4.17.21"],
"dev": false,
"save": true,
"force": false
}'
{
"status": "installing",
"command": "bun install lodash@^4.17.21",
"message": "Installation started"
}

Rewrites declared dependency ranges in package.json to exact installed versions, producing reproducible builds. When all declared dependencies are already pinned, the response indicates that nothing changed.

This endpoint takes no parameters.

NameTypeRequiredDescription
packagesarrayNoSubset of package names to pin. When omitted, every declared dependency is pinned.
Terminal window
curl -X POST "https://{projectId}-{containerId}-exec-1.{server}.containers.hoody.com/api/v1/exec/package/pin" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{}'

When at least one dependency is updated:

{
"message": "Dependencies pinned to exact versions",
"pinned": ["lodash"],
"count": 1,
"dependencies": {
"lodash": "4.17.21"
}
}

When every declared dependency is already pinned:

{
"message": "All dependencies are already pinned to exact versions",
"pinned": [],
"count": 0
}