[PR #58] [CLOSED] Feat: Add OPEN_TERMINAL_NPM_PACKAGES Environment Variable #116

Closed
opened 2026-10-18 21:10:56 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-terminal/pull/58
Author: @dennypradipta
Created: 3/12/2026
Status: ❌ Closed

Base: main ← Head: install-npm-packages


📝 Commits (2)

  • 088465b Feat: Install NPM Packages
  • ceb46ad Use sudo for global packages

📊 Changes

2 files changed (+12 additions, -6 deletions)

View changed files

📝 README.md (+6 -6)
📝 entrypoint.sh (+6 -0)

📄 Description

Summary

This PR adds support for the OPEN_TERMINAL_NPM_PACKAGES environment variable, allowing users to install npm packages globally at container startup in Docker mode. This brings npm package installation parity with the existing OPEN_TERMINAL_PACKAGES (apt) and OPEN_TERMINAL_PIP_PACKAGES (pip) environment variables.

Changes

1. entrypoint.sh

Added npm package installation logic that runs when OPEN_TERMINAL_NPM_PACKAGES is set:

# Auto-install npm packages
if [ -n "${OPEN_TERMINAL_NPM_PACKAGES:-}" ]; then
    echo "Installing npm packages: $OPEN_TERMINAL_NPM_PACKAGES"
    sudo npm install -g $OPEN_TERMINAL_NPM_PACKAGES
fi

2. README.md

Updated the "Customizing the Docker Environment" section with:

  • Example usage showing all three package variables together
  • Documentation table entry for OPEN_TERMINAL_NPM_PACKAGES

Usage

docker run -d --name open-terminal -p 8000:8000 \
  -e OPEN_TERMINAL_PACKAGES="something" \
  -e OPEN_TERMINAL_PIP_PACKAGES="something" \
  -e OPEN_TERMINAL_NPM_PACKAGES="something" \
  ghcr.io/open-webui/open-terminal

Testing

To test this change:

# Build the image locally
docker build -t open-terminal:test .

# Run with npm packages
docker run -d --name open-terminal-test -p 8000:8000 \
  -e OPEN_TERMINAL_NPM_PACKAGES="eslint" \
  open-terminal:test

# Verify installation
docker exec open-terminal-test eslint --version

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-terminal/pull/58 **Author:** [@dennypradipta](https://github.com/dennypradipta) **Created:** 3/12/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `install-npm-packages` --- ### 📝 Commits (2) - [`088465b`](https://github.com/open-webui/open-terminal/commit/088465baf88c37fac07c07fafb6a5af955aaa488) Feat: Install NPM Packages - [`ceb46ad`](https://github.com/open-webui/open-terminal/commit/ceb46adcb2870fcab55ae87cb048918068e1111b) Use sudo for global packages ### 📊 Changes **2 files changed** (+12 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+6 -6) 📝 `entrypoint.sh` (+6 -0) </details> ### 📄 Description ## Summary This PR adds support for the `OPEN_TERMINAL_NPM_PACKAGES` environment variable, allowing users to install npm packages globally at container startup in Docker mode. This brings npm package installation parity with the existing `OPEN_TERMINAL_PACKAGES` (apt) and `OPEN_TERMINAL_PIP_PACKAGES` (pip) environment variables. ## Changes ### 1. `entrypoint.sh` Added npm package installation logic that runs when `OPEN_TERMINAL_NPM_PACKAGES` is set: ```bash # Auto-install npm packages if [ -n "${OPEN_TERMINAL_NPM_PACKAGES:-}" ]; then echo "Installing npm packages: $OPEN_TERMINAL_NPM_PACKAGES" sudo npm install -g $OPEN_TERMINAL_NPM_PACKAGES fi ``` ### 2. `README.md` Updated the "Customizing the Docker Environment" section with: - Example usage showing all three package variables together - Documentation table entry for `OPEN_TERMINAL_NPM_PACKAGES` ## Usage ```bash docker run -d --name open-terminal -p 8000:8000 \ -e OPEN_TERMINAL_PACKAGES="something" \ -e OPEN_TERMINAL_PIP_PACKAGES="something" \ -e OPEN_TERMINAL_NPM_PACKAGES="something" \ ghcr.io/open-webui/open-terminal ``` ## Testing To test this change: ```bash # Build the image locally docker build -t open-terminal:test . # Run with npm packages docker run -d --name open-terminal-test -p 8000:8000 \ -e OPEN_TERMINAL_NPM_PACKAGES="eslint" \ open-terminal:test # Verify installation docker exec open-terminal-test eslint --version ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-18 21:10:56 +00:00
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/open-terminal#116
No description provided.