-
Notifications
You must be signed in to change notification settings - Fork 62
Quickstart script for Chat UI template #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Quickstart script for Chat UI template #64
Conversation
Created scripts/setup-local-dev-env.sh - an interactive wizard that: - Validates prerequisites (Databricks CLI, jq, authentication) - Guides users through environment configuration - Auto-detects workspace URL and database settings - Creates .env.local with proper configuration Updated README.md to document the new quick start process using the setup script. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Created scripts/setup.sh - a unified interactive setup wizard featuring: - Arrow-key navigation with visual menu system - Complete first-time setup workflow (auth, deployment, database, local env) - Diagnostics and troubleshooting tools - State persistence across sessions - Smart auto-detection with manual override options Removed scripts: - setup-local-dev-env.sh (functionality integrated) - enable-history-database.sh (functionality integrated) Updated README.md to reference the new unified setup wizard throughout. The new wizard provides a professional guided experience for: • Prerequisites verification • Databricks authentication • Serving endpoint configuration • Database mode selection (ephemeral/persistent) • Bundle deployment with progress tracking • Local environment setup • Database migrations • Status checks and diagnostics 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Improvements to make the menu system more robust: - Fixed read_key() to not suppress stdin (removed 2>/dev/null from initial read) - Improved arrow key detection by properly concatenating escape sequences - Added direct number selection [0-9] as fallback for arrow keys - Display menu item numbers to show available numeric shortcuts - Updated help text to indicate both arrow and number navigation options This resolves issues where the menu would hang waiting for input in certain terminal environments. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Changes: - Separated echo prompt from read command for better compatibility - Changed from 'read -p' to simple 'read -r' with preceding echo - Added terminal interactivity check to fail fast if not in interactive mode - Updated help text to emphasize number selection as alternative to arrows This should resolve the hanging issue on macOS where the initial Enter press wasn't being registered. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Use 'read -n1 -s' to read a single character instead of waiting for Enter. This is more reliable across different terminal configurations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
The bug: read -rsn1 returns a newline character (\n or \r) when Enter is pressed, not an empty string. The original check for empty string never matched, causing the menu to ignore Enter key presses. Fixed by checking for both newline characters and empty string: - Empty string: "" - Newline: $'\n' - Carriage return: $'\r' This resolves the menu freezing issue on macOS. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Removed complex arrow key navigation which was incompatible with macOS terminal buffering. The new menu system: - Renders once per selection - Uses standard 'read -r -p' for input - Number-based selection (type 0-8 and press Enter) - Simple, reliable, and compatible across all terminals This eliminates all the issues with: - read -rsn1 hanging - Escape sequences being split across reads - Terminal-specific buffering problems 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
All DEBUG messages now go to /tmp/setup-wizard-debug.log (file descriptor 3) instead of stderr. This prevents DEBUG output from interfering with the terminal display and menu rendering. Users can still monitor debug output with: tail -f /tmp/setup-wizard-debug.log 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…p/bundle names, and auto-start 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
bbqiu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from running through this myself, a few nits:
- when i selected "y" for customizing the name, the script did not wait for my input
- script did not wait for me to select an option when deploying the app to databricks
- can we change the default to not be gpt-5-1 if it doesn't work right now (tracked in https://databricks.atlassian.net/browse/ML-59783)
- Move name validation to after user customization choice - Auto-truncate default app names that exceed 30 char limit - Add validation loops for custom app/bundle names with clear length limits - Update top-level bundle name in databricks.yml (fixes deployment path) - Clear .databricks cache before deployment to prevent stale state - Change default endpoint to databricks-claude-sonnet-4 - Allow users to press Enter to accept default endpoint Fixes issues where: - Script would fail if default name was too long - Custom names weren't validated for length - Deployment used wrong workspace path after customization - Bundle cache caused deployment to use old names 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
I couldn't reproduce but I have done some more testing and made the customizing name more robust. I also only tried this with zsh but it should work across macOS and linux |
bbqiu
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah going through this again, if you type any letters other than y or n, the script treats it as a yes (don't have to be "y" or "n", it'll proceed to the next steps). if we fix this, i think this looks great!
|
I can't reproduce it? Screen.Recording.2025-11-27.at.16.05.00.mov |
eLysgaard
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add an entry in CLAUDE.md that mentions, suggests, and instructs claude how to this script?
Added comprehensive documentation for the three new convenience scripts: - quickstart.sh: Interactive setup wizard for first-time users - start-app.sh: Simple local development server starter - cleanup-database.sh: Database instance cleanup tool Updated Essential Commands section with Quick Start Scripts subsection and added Convenience Scripts to File Locations Reference. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Added guidance for Claude Code to ask users 4 key questions before running the quickstart script: 1. Serving endpoint availability and name 2. App/bundle name customization preferences 3. Persistent chat history (database) requirements 4. Deployment timing (now vs later) This ensures the script runs smoothly and matches user expectations. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
|
jenkins merge |

Summary
Added convenience scripts to streamline the initial setup and daily development workflow for the Databricks Chatbot template.
New Scripts
1.
scripts/quickstart.sh- Automated First-Time SetupA comprehensive, linear setup script that guides users through the complete initial configuration. In an ideal scenario (full setup with database and deployment), the
script performs these steps:
1. Prerequisites Installation
jq(JSON parsing),nvm(Node Version Manager), and Databricks CLI2. Configuration Files Setup
.env.localfrom.env.example(if not already present).env.localalready exists3. Databricks Authentication
.env.local(e.g.,DATABRICKS_CONFIG_PROFILE=default)4. Application Configuration
databricks-gpt-4-turbo)databricks.ymland.env.localwith the endpoint namedatabricks.ymlnpm installto set up project dependencies5. Deployment & Database Provisioning
databricks bundle deploy -t dev.env.local:PGUSER(your Databricks username)PGHOST(database hostname)PGDATABASE=databricks_postgresPGPORT=5432npm run db:migrateto set up the database schemaAdditional Features:
Result: After the ideal flow completes, you have:
.env.local)npm run devwith full functionality2.
scripts/start-app.sh- Quick App StartupA simple convenience script for daily development:
npm installto ensure dependencies are up-to-datenpm run devFiles Changed
scripts/quickstart.sh- New comprehensive setup script (542 lines)scripts/start-app.sh- New startup convenience script (23 lines)README.md- Updated to feature these scripts as the recommended setup methodserver/src/index.ts- Clarified backend server port in console outputTesting
Please test the following scenarios:
Scenario 1: Entirely Local (No Database, No Deployment)
./scripts/quickstart.sh.env.localcontainsDATABRICKS_CONFIG_PROFILEandDATABRICKS_SERVING_ENDPOINT.env.localnpm run devScenario 2: Local with Existing Database
databricks bundle deploywith database enabled)./scripts/quickstart.shPGHOSTto.env.local(along withPGUSER,PGDATABASE,PGPORT)Scenario 3: Full Deploy (First-Time Setup)
./scripts/quickstart.shon a clean install.env.localnpm run devor./scripts/start-app.shAdditional Test Cases
databricks.ymlBenefits