Skip to content

Add deepstudio/private-install-v2.ps1 and private-install-v2.sh with Azure CLI token auth, auto-install, Node.js management, and colorized UI#716

Draft
Copilot wants to merge 8 commits intomainfrom
copilot/improve-private-install-script
Draft

Add deepstudio/private-install-v2.ps1 and private-install-v2.sh with Azure CLI token auth, auto-install, Node.js management, and colorized UI#716
Copilot wants to merge 8 commits intomainfrom
copilot/improve-private-install-script

Conversation

Copy link

Copilot AI commented Feb 6, 2026

Description

New cross-platform install scripts (PowerShell for Windows, Bash for Mac/Linux) that eliminate manual PAT creation by leveraging existing az login sessions, with a polished interactive console experience, guided setup flow, and automatic prerequisite management.

Key changes:

Node.js management:

  • Checks if Node.js is installed; if not, prompts the user to install it (winget on Windows, brew/apt/dnf/yum/pacman on Mac/Linux)
  • If Node.js is installed but version is older than 22, prompts the user to upgrade via the platform package manager
  • Handles winget "already installed" exit code (-1978335189) gracefully, with uninstall+reinstall fallback if upgrade fails
  • Falls back with a manual download link if user declines or package manager is unavailable

Azure CLI & token auth:

  • Uses az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 to obtain a temporary Azure DevOps token from the user's active Azure CLI session — no PAT creation needed
  • If Azure CLI is not installed, prompts the user to install it (winget on Windows, brew/apt/pip on Mac/Linux); if declined, falls back to manual PAT entry
  • If Azure CLI is installed but no login session exists, automatically triggers az login and retries token fetch
  • Prompts for ADO org name with a default of "microsoft" (press Enter to accept), used to construct the registry URL
  • Falls back to manual PAT entry if az CLI install is declined or token acquisition fails

Security & UX:

  • Registry URL stored as base64 to prevent plain-text search/exposure; masked in all console output (e.g., https://micr****t.com/****)
  • Prompts Start deepstudio-server now? [Y/n] after install; Enter or y launches immediately
  • Rainbow-colored ASCII art "DeepStudio Installer v2" banner at startup
  • Colorized semantic output: Info (cyan), Warn (yellow), Fail (red), Success (green), Dim (gray)
  • Styled Unicode box-drawing layouts for settings panel, PAT prompt, success/error banners
  • Emojis throughout the flow (📦 🔧 🧪 📝 🔍 🔑 📄 🎉 🚀 🏢 📥 ⚙️ ⬆️) for a delightful interactive experience

Cross-platform support:

  • private-install-v2.ps1 — PowerShell script for Windows (uses winget for package management)
  • private-install-v2.sh — Bash script for Mac/Linux (auto-detects brew, apt, dnf, yum, pacman)
  • Both scripts share the same logic, interactive flow, and colorized output style

All existing functionality from private-install.ps1 is preserved (isolated npmrc, dry-run, verbose/log modes, cleanup).

Linked GitHub issue ID:

Pull Request Checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Code compiles correctly with all tests are passed.
  • I've read the contributing guide and followed the recommended practices.
  • Wikis or README have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

If this introduces a breaking change for Hydra Lab users, please describe the impact and migration path.

  • Yes
  • No

How you tested it

  • PowerShell parser validation ([System.Management.Automation.Language.Parser]::ParseFile) — no parse errors
  • Bash syntax validation (bash -n) — no syntax errors
  • Verified base64-encoded registry URL decodes correctly at runtime
  • Verified registry URL is masked in all console output
  • Verified ADO org name prompt defaults to "microsoft" and constructs correct registry URL
  • Verified Node.js version check correctly parses node --version output and compares against minimum version 22
  • Verified winget "already installed" exit code (-1978335189) is handled gracefully
  • New files only; no changes to existing scripts

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Technical design
  • Build related changes
  • Refactoring (no functional changes, no api changes)
  • Code style update (formatting, renaming) or Documentation content changes
  • Other (please describe):

Feature UI screenshots or Technical design diagrams

N/A — CLI scripts, no UI.

Original prompt

under the deepstudio folder, create a new private install , call deepstudio/private-install-v2.ps1 and do what's in deepstudio/private-install.ps1, but improve it with:

  1. for the ado token input, if the user already have done az login command, use it to get the authenticate with the registery of https://microsoft.pkgs.visualstudio.com/OS/_packaging/DeepStudio/npm/registry/ directly and so we don't need user to provide the token any more. If possible we don't need to create a new ADO path token at all and we just get a temp token to access it.

And after the install, give the user a input to ask whether we should start the deepstudio-server directly, if user enter or hit y, we launch it.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 6, 2026 07:11
…d auto-launch prompt

Co-authored-by: hydraxman <8344245+hydraxman@users.noreply.github.com>
Co-authored-by: hydraxman <8344245+hydraxman@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve deepstudio/private-install script for ADO token handling Add deepstudio/private-install-v2.ps1 with Azure CLI token auth and auto-launch Feb 6, 2026
Copilot AI requested a review from hydraxman February 6, 2026 07:13
@hydraxman
Copy link
Member

for this url, store it in base64 format please, don't want other to see or search it:
https://microsoft.pkgs.visualstudio.com/OS/_packaging/DeepStudio/npm/registry/
@copilot

Co-authored-by: hydraxman <8344245+hydraxman@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 6, 2026

for this url, store it in base64 format please, don't want other to see or search it:
https://microsoft.pkgs.visualstudio.com/OS/_packaging/DeepStudio/npm/registry/
@copilot

Done in 561c165. The registry URL is now stored as a base64 string ($DefaultRegistryB64) and decoded at runtime with [System.Convert]::FromBase64String(). The plaintext URL no longer appears anywhere in the file.

@hydraxman
Copy link
Member

@copilot this is great enough, 2 tips:
don't output the registery url on console or mask the most part of it
Improve the overall console ouput to make it beautiful and print a rainbow color DeepStuidio Installer banner, and improve the other interactive output to make it appealing and delightful

Co-authored-by: hydraxman <8344245+hydraxman@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 6, 2026

@copilot this is great enough, 2 tips:
don't output the registery url on console or mask the most part of it
Improve the overall console ouput to make it beautiful and print a rainbow color DeepStui...

Done in ec3bf6e. Changes:

  1. Registry URL masked — console now shows https://micr****t.com/**** instead of the full URL (via Mask-Url helper)
  2. Rainbow ASCII banner — 6-color gradient "DeepStudio Installer v2" banner at startup
  3. Colorized output — Info (cyan), Warn (yellow), Fail (red), Success (green), Dim (gray) with consistent indentation
  4. Styled box layouts — Unicode box-drawing characters for settings panel, PAT prompt, success/error banners
  5. Emojis — 📦 🔧 🧪 📝 🔍 🔑 📄 🎉 🚀 throughout the flow

Copilot AI changed the title Add deepstudio/private-install-v2.ps1 with Azure CLI token auth and auto-launch Add deepstudio/private-install-v2.ps1 with Azure CLI token auth, auto-launch, and colorized UI Feb 6, 2026
@hydraxman
Copy link
Member

@copilot if we find out the user has not install az cli, we pop up and ask whether want to install az cli, if user says no, we fall back to pat ask, but if user says yes, we help user install it via command (maybe winget?) and then ask user to do az login, and then we fetch token.

And in the fetch token process, ask the user to enter the ADO org name, the default value is microsoft so user can put just enter to go with microsoft.

…efault

Co-authored-by: hydraxman <8344245+hydraxman@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 6, 2026

@copilot if we find out the user has not install az cli, we pop up and ask whether want to install az cli, if user says no, we fall back to pat ask, but if user says yes, we help user install it via c...

Done in 0598855. Changes:

  1. Azure CLI install prompt — When az is not found, shows a styled prompt asking Install Azure CLI now via winget? [Y/n]. If yes, runs winget install --id Microsoft.AzureCLI and refreshes PATH. If no or winget unavailable, falls back to PAT.
  2. Auto az login — If az is installed but no valid session exists, automatically prompts az login and retries token fetch after login.
  3. ADO org name input — Prompts Enter ADO org name [microsoft] with a default of "microsoft" (press Enter to accept). The registry URL is constructed from the org name.

Copilot AI changed the title Add deepstudio/private-install-v2.ps1 with Azure CLI token auth, auto-launch, and colorized UI Add deepstudio/private-install-v2.ps1 with Azure CLI token auth, auto-install, and colorized UI Feb 6, 2026
@hydraxman
Copy link
Member

@copilot before any nodejs script / command run, we check if node is installed and if not we try to use winget to install after confirming with user. if it's installed, we check the version, need to older than 22, we need to confirm with user and upgrade it with winget.

…rement

Co-authored-by: hydraxman <8344245+hydraxman@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 6, 2026

@copilot before any nodejs script / command run, we check if node is installed and if not we try to use winget to install after confirming with user. if it's installed, we check the version, need to o...

Done in 1faa019. The Require-Npm function has been replaced with Require-Node which:

  1. Checks if Node.js is installed — if not, prompts Install Node.js via winget? [Y/n] and runs winget install --id OpenJS.NodeJS.LTS
  2. Checks version >= 22 — if older, shows current vs required version in a styled box and prompts Upgrade Node.js to latest LTS via winget? [Y/n], then runs winget upgrade --id OpenJS.NodeJS.LTS
  3. Falls back gracefully — if user declines or winget is unavailable, shows the manual download link and exits
  4. Final npm check — verifies npm is available after install/upgrade (in case a terminal restart is needed)

Copilot AI changed the title Add deepstudio/private-install-v2.ps1 with Azure CLI token auth, auto-install, and colorized UI Add deepstudio/private-install-v2.ps1 with Azure CLI token auth, auto-install, Node.js management, and colorized UI Feb 6, 2026
@hydraxman
Copy link
Member

@copilot for the power shell, I saw a issue, it prints below, so the upgrade logic is not working yet, and after get it fixed, add a shell in the same folder to run this in mac and linux with same logic and ouput log

┌─────────────────────────────────────────────────────┐
│ ⚙️ Node.js is not installed │
│ Node.js >= 22 is required to continue. │
└─────────────────────────────────────────────────────┘

📥 Install Node.js via winget? [Y/n]:
📥 Installing Node.js via winget...

Found an existing package already installed. Trying to upgrade the installed package...
No available upgrade found.
No newer package versions are available from the configured sources.
✖ winget install returned exit code -1978335189.

[process exited with code 1 (0x00000001)]

…/Linux

Co-authored-by: hydraxman <8344245+hydraxman@users.noreply.github.com>
Copy link
Author

Copilot AI commented Feb 6, 2026

@copilot for the power shell, I saw a issue, it prints below, so the upgrade logic is not working yet, and after get it fixed, add a shell in the same folder to run this in mac and linux with same log...

Done in 37ae4d2. Two fixes:

PowerShell fix:

  • The winget install "already installed" exit code (-1978335189 / APPINSTALLER_CLI_ERROR_PACKAGE_ALREADY_INSTALLED) is now treated as success instead of a failure
  • Extracted Install-NodeViaWinget and Upgrade-NodeViaWinget helpers for cleaner flow
  • Upgrade-NodeViaWinget has a fallback: if winget upgrade fails, it tries winget uninstall + winget install to force a clean reinstall

New shell script (private-install-v2.sh):

  • Same logic and colorized output as the PowerShell version
  • Auto-detects system package manager (brew, apt, dnf, yum, pacman)
  • Node.js install/upgrade, Azure CLI install, az login token auth, PAT fallback, ADO org prompt, post-install launch — all matching the PS1 flow
  • Rainbow banner, Unicode box-drawing, emojis, and colored output

Copilot AI changed the title Add deepstudio/private-install-v2.ps1 with Azure CLI token auth, auto-install, Node.js management, and colorized UI Add deepstudio/private-install-v2.ps1 and private-install-v2.sh with Azure CLI token auth, auto-install, Node.js management, and colorized UI Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants