diff --git a/ct/gentle-shell.sh b/ct/gentle-shell.sh new file mode 100644 index 0000000000..e9d785bcf3 --- /dev/null +++ b/ct/gentle-shell.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash +_CS_DEFAULT_URL="https://raw.githubusercontent.com/community-scripts/DevScripts/main" +_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func" +source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func") +# Copyright (c) 2021-2026 community-scripts ORG +# Author: Gentleman-Programming +# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE +# Source: https://github.com/Gentleman-Programming/gentle-shell + +APP="gentle-shell" +var_tags="${var_tags:-development;ai;coding-agent}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-4096}" +var_disk="${var_disk:-10}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" +#var_arm64="${var_arm64:-no}" # unset = ask the user; set yes/no only when verified +var_testurl="${var_testurl:-https://github.com/community-scripts/DevScripts/issues/2687}" + +export var_authorized_key="${var_authorized_key:-}" +export var_gh_token="${var_gh_token:-}" + +header_info "$APP" +variables +color +catch_errors + +if [[ -n "${var_projects_mode:-}${var_projects_path:-}${var_projects_storage:-}${var_projects_size:-}" ]]; then + msg_error "Projects storage options were removed; projects always live in /root/projects. Add an mp0 bind mount from the Proxmox UI if you need a host directory." + exit 1 +fi + +function update_script() { + header_info + check_container_storage + check_container_resources + + if ! command -v gentle-shell &>/dev/null; then + msg_error "No ${APP} Installation Found!" + exit 1 + fi + + RELEASE=$(npm view gentle-pi version 2>/dev/null) + if [[ -z "${RELEASE}" ]]; then + msg_error "Unable to reach npm for the latest gentle-pi version." + exit 1 + fi + msg_info "Updating ${APP} (gentle-pi@${RELEASE})" + $STD npm install -g "gentle-pi@${RELEASE}" + msg_ok "Updated ${APP}" + exit +} + +start +build_container +description + +msg_ok "Completed Successfully!\n" +echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}" +echo -e "${INFO}${YW}Run 'gentle-shell' from the Proxmox console; for SSH or Herdr access, add a public key inside the container first.${CL}" diff --git a/install/gentle-shell-install.sh b/install/gentle-shell-install.sh new file mode 100644 index 0000000000..482a786aff --- /dev/null +++ b/install/gentle-shell-install.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: Gentleman-Programming +# License: MIT | https://github.com/community-scripts/DevScripts/raw/main/LICENSE +# Source: https://github.com/Gentleman-Programming/gentle-shell + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +msg_info "Installing Dependencies" +$STD apt install -y git +msg_ok "Installed Dependencies" + +NODE_VERSION="22" setup_nodejs + +fetch_and_deploy_gh_release "gh" "cli/cli" "binary" + +msg_info "Installing gentle-shell (gentle-pi)" +$STD npm install -g gentle-pi +msg_ok "Installed gentle-shell" + +cat <<'EOF' >/usr/local/bin/engram +#!/usr/bin/env sh +# Resolves the newest Engram core published by Gentle Shell into ~/.gentle-shell/runtime. +core=$(ls -1d "${HOME:-/root}"/.gentle-shell/runtime/engram-*/engram 2>/dev/null | sort -V | tail -1) +if [ -z "$core" ]; then + echo "engram: no Gentle Shell published core found." >&2 + echo "engram: start 'gentle-shell' once to publish the Engram core, then retry." >&2 + exit 1 +fi +exec "$core" "$@" +EOF +chmod 755 /usr/local/bin/engram + +if [[ -n "${var_gh_token:-}" ]]; then + msg_info "Authenticating GitHub CLI" + if printf '%s' "${var_gh_token}" | gh auth login --with-token >/dev/null 2>&1; then + msg_ok "Authenticated GitHub CLI" + else + msg_warn "GitHub authentication failed; run 'gh auth login' inside the container later." + fi +fi + +if [[ -z "${var_authorized_key:-}" ]]; then + read -rp "${TAB3}SSH public key for root login (Enter to skip): " -t 120 var_authorized_key || var_authorized_key="" +fi +if [[ -n "${var_authorized_key:-}" && ! "${var_authorized_key}" =~ ^(ssh-|ecdsa-|sk-) ]]; then + msg_warn "Not a public key (expected the contents of ~/.ssh/id_ed25519.pub); skipping SSH key install." + var_authorized_key="" +fi +if [[ -n "${var_authorized_key:-}" ]]; then + msg_info "Installing SSH Access Key" + if ! mkdir -p /root/.ssh || ! chmod 700 /root/.ssh; then + msg_error "Failed to prepare /root/.ssh" + exit 1 + fi + if [[ -s /root/.ssh/authorized_keys && -n "$(tail -c 1 /root/.ssh/authorized_keys)" ]]; then + printf '\n' >> /root/.ssh/authorized_keys + fi + if ! printf '%s\n' "${var_authorized_key}" >> /root/.ssh/authorized_keys || ! chmod 600 /root/.ssh/authorized_keys; then + msg_error "Failed to write /root/.ssh/authorized_keys" + exit 1 + fi + msg_ok "Installed SSH Access Key" +fi + +mkdir -p /root/projects + +motd_ssh +customize +cleanup_lxc diff --git a/json/gentle-shell.json b/json/gentle-shell.json new file mode 100644 index 0000000000..80652c48f2 --- /dev/null +++ b/json/gentle-shell.json @@ -0,0 +1,72 @@ +{ + "name": "gentle-shell", + "slug": "gentle-shell", + "categories": [ + 20 + ], + "date_created": "2026-11-18", + "type": "ct", + "platforms": ["pve"], + "architectures": ["amd64"], + "updateable": true, + "privileged": false, + "interface_port": null, + "documentation": "https://github.com/Gentleman-Programming/gentle-shell", + "website": "https://gentlemanprogramming.com/", + "repository": "https://github.com/Gentleman-Programming/gentle-shell", + "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons@main/webp/gentle-shell.webp", + "description": "gentle-shell is a coding-agent workspace and TUI harness built for Pi: agent orchestration, ODD workflow tracking, native review, diff views and persistent memory, driven from the terminal. This script creates an LXC development server with gentle-shell, git and the GitHub CLI preinstalled, ready to be used over SSH.", + "install_methods": [ + { + "type": "default", + "script": "ct/gentle-shell.sh", + "resources": { + "cpu": 2, + "ram": 4096, + "hdd": 10, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "Run 'gentle-shell' from the Proxmox console or via SSH as root (key-based only); first launch asks for your provider API keys. Herdr uses the SSH key for Add Machine.", + "type": "info" + }, + { + "text": "Projects live in /root/projects. To work on a host directory instead, add an mp0 bind mount to /root/projects from the Proxmox UI.", + "type": "info" + }, + { + "text": "Without a GitHub token, run 'gh auth login' inside the container to authenticate the GitHub CLI.", + "type": "info" + } + ], + "app_vars": [ + { + "name": "var_hostname", + "label": "Machine Name", + "type": "text", + "default": "gentle-shell", + "help": "Container hostname; Herdr shows it as the remote machine name" + }, + { + "name": "var_authorized_key", + "label": "SSH Public Key", + "type": "text", + "help": "Contents of your ~/.ssh/id_ed25519.pub (one line). The container accepts key-based SSH only; Herdr connects with this key. Skip to add it later inside /root/.ssh/authorized_keys" + }, + { + "name": "var_gh_token", + "label": "GitHub Token", + "type": "password", + "secret": true, + "help": "Optional GitHub Personal Access Token: create it at github.com -> Settings -> Developer settings -> Personal access tokens (scope 'repo'). When empty, authenticate later with 'gh auth login' inside the container" + } + ] +}