### Run Quickstart Script Source: https://github.com/databricks/app-templates/blob/main/e2e-chatbot-app-next/README.md Execute the quickstart script to automate the installation of prerequisites, configuration of authentication, setup of serving endpoints, database provisioning, local environment setup, and database migrations. ```bash ./scripts/quickstart.sh ``` -------------------------------- ### Run Quickstart Setup Script Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/AGENTS.md Execute this command to configure Databricks authentication, install dependencies, set up environment variables, and initialize your agent project. ```bash npm run quickstart ``` -------------------------------- ### Install Dependencies and Start Local Server Source: https://github.com/databricks/app-templates/blob/main/mcp-server-open-api-spec/CLAUDE.MD Use 'uv sync' to install project dependencies and 'uv run custom-server' to start the development server with hot-reloading. ```bash uv sync # Install dependencies uv run custom-server # Start with hot reload ``` -------------------------------- ### Local Setup and Server Start Source: https://context7.com/databricks/app-templates/llms.txt Installs prerequisites, authenticates, and starts the Databricks App Template server locally. Creates an MLflow experiment and writes a .env file. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh nvm use 20 databricks auth login # OAuth (recommended) # OR set DATABRICKS_HOST + DATABRICKS_TOKEN in .env for PAT auth uv run quickstart # Creates MLflow experiment, writes .env, starts server at http://localhost:8000 uv run start-app # Advanced options uv run start-server --reload # hot-reload on code changes uv run start-server --port 8001 # custom port uv run start-server --workers 4 # multiple workers ``` -------------------------------- ### Start Application with Convenience Script Source: https://github.com/databricks/app-templates/blob/main/e2e-chatbot-app-next/README.md Use the start-app.sh script to quickly start the application after initial setup. It ensures dependencies are up-to-date before starting the development server. ```bash ./scripts/start-app.sh ``` -------------------------------- ### Quickstart Environment Setup Source: https://github.com/databricks/app-templates/blob/main/agent-langgraph-advanced/AGENTS.md Use this command to set up the agent environment, configuring Lakebase instance details. Ensure you have read the quickstart skill documentation for available flags. ```bash uv run quickstart --profile --lakebase-provisioned-name ``` -------------------------------- ### CI/CD Workflow Example Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/tests/README.md An example of a CI/CD workflow that includes installing dependencies, running unit tests, starting and running integration tests, and conditionally running E2E tests after deployment. ```bash # Install npm install # Unit tests (always run) npm run test:unit # Start servers in background for integration tests npm run dev & SERVER_PID=$! sleep 10 # Wait for servers to start # Integration tests npm run test:integration # Clean up kill $SERVER_PID # E2E tests (only on deploy) if [ "$DEPLOY" = "true" ]; then databricks bundle deploy export APP_URL=$(databricks apps get agent-lc-ts-dev --output json | jq -r '.url') npm run test:e2e fi ``` -------------------------------- ### Copy Environment Example Source: https://github.com/databricks/app-templates/blob/main/appkit-files/README.md Copy the example environment file to start configuring local development variables. ```bash cp .env.example .env ``` -------------------------------- ### Start Local Development Server Source: https://github.com/databricks/app-templates/blob/main/e2e-chatbot-app-next/CLAUDE.md A simple script to install dependencies and start the local development server for both the client and server components. ```bash ./scripts/start-app.sh # Simple script to install deps and run npm run dev ``` -------------------------------- ### Quick Start Script Source: https://github.com/databricks/app-templates/blob/main/e2e-chatbot-app-next/CLAUDE.md Automates the initial setup, configuration, and deployment of the chatbot application to Databricks. Recommended for new users. ```bash ./scripts/quickstart.sh # Interactive setup wizard (recommended for new users) ``` -------------------------------- ### Start Development Server Manually Source: https://github.com/databricks/app-templates/blob/main/e2e-chatbot-app-next/README.md Manually start the development server by installing dependencies and running the dev script. The app will be accessible on localhost:3000 (frontend) and localhost:3001 (backend). ```bash npm install npm run dev ``` -------------------------------- ### Run Quickstart for Environment Setup Source: https://github.com/databricks/app-templates/blob/main/agent-langgraph/AGENTS.md Use this command to set up the agent environment if the .env file does not exist. Ensure you replace with your Databricks configuration profile name. ```bash uv run quickstart --profile ``` -------------------------------- ### E2E Chatbot App (Next.js) Setup and Deployment Source: https://context7.com/databricks/app-templates/llms.txt Commands for setting up, running, and deploying the E2E Chatbot application. This includes quickstart, manual setup, enabling persistent history and user feedback, running tests, and final deployment. ```bash # Quick setup git clone https://github.com/databricks/app-templates && cd e2e-chatbot-app-next ./scripts/quickstart.sh # Interactive: sets up auth, endpoint, optional DB + feedback ./scripts/start-app.sh # Start after initial setup ``` ```bash # Manual setup npm install cp .env.example .env # Edit .env: set DATABRICKS_CONFIG_PROFILE, SERVING_ENDPOINT_NAME, optional PG* vars npm run dev # Frontend: http://localhost:3000 Backend: http://localhost:3001 ``` ```bash # Enable persistent chat history (Lakebase) # Uncomment database sections in databricks.yml, then: databricks bundle deploy # provisions Lakebase instance (~5 min first time) npm run db:migrate ``` ```bash # Enable user feedback (MLflow assessments) npx tsx scripts/get-experiment-id.ts --endpoint my-agent-endpoint # Add experiment_id to databricks.yml feedback TODO block, then redeploy ``` ```bash # Run tests npm test # both modes: with-db + ephemeral npm run test:with-db # persistent mode only npm run test:ephemeral # no-DB mode only ``` ```bash # Deploy databricks bundle deploy databricks bundle run databricks_chatbot ``` -------------------------------- ### Agent Quickstart Script Source: https://context7.com/databricks/app-templates/llms.txt A bash script for initializing authentication, creating an MLflow experiment, and starting an agent server with a built-in chat UI. This is common to all Python agent templates. ```bash # All Agent Templates Quickstart # Initializes auth, creates an MLflow experiment, and starts the agent server with built-in chat UI. # Run locally: uv run start-app # Deploy: databricks bundle deploy # Run: databricks bundle run ``` -------------------------------- ### Execute Quickstart Script Source: https://github.com/databricks/app-templates/blob/main/agent-openai-agents-sdk-multiagent/AGENTS.md Use this command to set up the agent environment and perform initial configurations. ```bash uv run quickstart ``` -------------------------------- ### Run Quickstart with Lakebase Provisioned Source: https://github.com/databricks/app-templates/blob/main/agent-openai-advanced/AGENTS.md Use this command to run the quickstart script when a provisioned Lakebase instance is available. Ensure you replace `` with the actual instance name. ```bash uv run quickstart --lakebase-provisioned-name ``` -------------------------------- ### Start Production Server Source: https://github.com/databricks/app-templates/blob/main/appkit-all-in-one/README.md Run the production-ready build of the application. ```bash npm start ``` -------------------------------- ### Quick Start E2E Test Execution Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/tests/e2e/README.md Deploy the Databricks app, get its URL, and run E2E tests using npm. ```bash # 1. Deploy the app npm run build databricks bundle deploy --profile your-profile databricks bundle run agent_langchain_ts --profile your-profile # 2. Get the app URL export APP_URL=$(databricks apps get agent-lc-ts-dev --profile your-profile --output json | jq -r '.url') echo "App URL: $APP_URL" # 3. Run E2E tests npm run test:e2e ``` -------------------------------- ### Databricks App Deployment Status Example Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/tests/e2e/README.md Example output showing the name, status, and URL of a running Databricks application. ```json { "name": "agent-lc-ts-dev", "status": { "state": "RUNNING" }, "url": "https://agent-lc-ts-dev-*.databricksapps.com" } ``` -------------------------------- ### Start Local Dev Server Source: https://github.com/databricks/app-templates/blob/main/mcp-server-hello-world/scripts/dev/README.md Run this script in a terminal to start the local development server. ```bash ./scripts/dev/start_server.sh ``` -------------------------------- ### Install Dependencies and Configure Authentication Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/AGENTS.md Manually set up your project by installing dependencies, logging into Databricks CLI, and configuring environment variables. ```bash npm install databricks auth login --profile your-profile cp .env.example .env nano .env ``` -------------------------------- ### Install Dependencies Source: https://github.com/databricks/app-templates/blob/main/mcp-server-hello-world/README.md Ensure all project dependencies are installed using `uv sync` or `pip install -r requirements.txt`. This is crucial for resolving import errors. ```bash uv sync # or pip install -r requirements.txt ``` -------------------------------- ### Lakebase Autoscaling Quickstart Source: https://github.com/databricks/app-templates/blob/main/agent-langgraph-advanced/AGENTS.md Command to run the quickstart script with autoscaling Lakebase project and branch details. Ensure the project and branch are correctly parsed from user input. ```bash uv run quickstart --lakebase-autoscaling-project --lakebase-autoscaling-branch ``` -------------------------------- ### Copy Environment File Source: https://github.com/databricks/app-templates/blob/main/agent-langgraph/README.md Copy the example environment file to .env. This file will be automatically loaded when starting the server and should contain your MLflow experiment ID. ```bash cp .env.example .env # Edit .env and fill in your experiment ID ``` -------------------------------- ### Install Dependencies with uv Source: https://github.com/databricks/app-templates/blob/main/mcp-server-hello-world/README.md Installs project dependencies using uv, the recommended package installer. ```bash # Install uv if you haven't already # Install dependencies uv sync ``` -------------------------------- ### Run UI Development Server Individually Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/AGENTS.md Start only the UI development server. ```bash npm run dev:ui ``` -------------------------------- ### Install Dependencies Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/README.md Install project dependencies using npm. ```bash npm install ``` -------------------------------- ### Run Pre-flight Check Source: https://github.com/databricks/app-templates/blob/main/agent-langgraph/README.md Start the agent locally and send a test request to catch configuration and code errors early. Ensure the Databricks CLI is installed and configured. ```bash uv run preflight ``` -------------------------------- ### Run Development Mode Source: https://github.com/databricks/app-templates/blob/main/e2e-chatbot-app-next/CLAUDE.md Starts both the client (on port 3000) and the server (on port 3001) for local development. ```bash npm run dev # Start both client (3000) and server (3001) ``` -------------------------------- ### Install Dependencies with pip Source: https://github.com/databricks/app-templates/blob/main/mcp-server-hello-world/README.md Installs project dependencies using pip. Creates a virtual environment and activates it before installing. ```bash # Create a virtual environment python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate # Install dependencies pip install -r requirements.txt ``` -------------------------------- ### Start Local Development Server Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/README.md Start the Express.js server for local development. The server will be accessible at http://localhost:8000. ```bash # Start the server npm run dev ``` -------------------------------- ### Run Client Development Mode Source: https://github.com/databricks/app-templates/blob/main/e2e-chatbot-app-next/CLAUDE.md Starts only the client component for local development. ```bash npm run dev:client # Client only ``` -------------------------------- ### Start MCP Server for Development Source: https://github.com/databricks/app-templates/blob/main/mcp-server-hello-world/Claude.md Launches the MCP server for local development purposes. ```bash scripts/dev/start_server.sh ``` -------------------------------- ### Install Databricks OpenAI Client Source: https://github.com/databricks/app-templates/blob/main/agent-langgraph/README.md Install the necessary Python package to interact with Databricks hosted agents using the Databricks OpenAI client. ```bash uv pip install databricks-openai ``` -------------------------------- ### Start MCP Server Locally Source: https://github.com/databricks/app-templates/blob/main/mcp-server-hello-world/README.md Starts the MCP server in development mode using a provided script or uv. The server defaults to port 8000. ```bash # Quick start with script (syncs dependencies and starts server) ./scripts/dev/start_server.sh # Or manually using uv (default port 8000) uv run custom-mcp-server # Or specify a custom port uv run custom-mcp-server --port 8080 # Or using the installed command (after pip install -e .) custom-mcp-server --port 3000 ``` -------------------------------- ### Start MCP Server for Development Source: https://github.com/databricks/app-templates/blob/main/mcp-server-hello-world/Claude.md Start the MCP server for development using a convenience script or directly with `uv`. The server defaults to port 8000 but can be configured with a custom port. The server runs in the foreground and can be stopped with Ctrl+C. ```bash # Using convenience script (port 8000) ./scripts/dev/start_server.sh ``` ```bash # Or directly with uv (default port 8000) uv run custom-mcp-server ``` ```bash # Or with custom port uv run custom-mcp-server --port 8080 ``` -------------------------------- ### Run Server Development Mode Source: https://github.com/databricks/app-templates/blob/main/e2e-chatbot-app-next/CLAUDE.md Starts only the server component for local development. ```bash npm run dev:server # Server only ``` -------------------------------- ### E2E Test Example with Helper and Prerequisites Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/tests/e2e/README.md This TypeScript example demonstrates how to structure an end-to-end test for a deployed application. It includes using a helper function for authentication and highlights the importance of documenting prerequisites and setting environment variables. ```typescript /** * My E2E test * * Prerequisites: * - App deployed with XYZ feature enabled * - Environment variable FOO set * * Run with: APP_URL= npm test tests/e2e/my-test.test.ts */ import { describe, test, expect, beforeAll } from '@jest/globals'; import { getDeployedAuthToken } from "../helpers.js"; const APP_URL = process.env.APP_URL || "https://default-url.databricksapps.com"; ``` -------------------------------- ### Run Development Server Source: https://github.com/databricks/app-templates/blob/main/appkit-all-in-one/README.md Start the application in development mode with hot reloading enabled. The app will be accessible at the URL shown in the console. ```bash npm run dev ``` -------------------------------- ### Install Databricks AI Tools Source: https://github.com/databricks/app-templates/blob/main/appkit-serving/CLAUDE.md Install Databricks experimental AI tools for enhanced assistance with Databricks CLI operations, authentication, data exploration, and app development. ```bash databricks experimental aitools install ``` -------------------------------- ### Configure Environment Variables Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/README.md Copy the example environment file and edit it with your Databricks credentials and MLflow experiment ID. ```bash cp .env.example .env ``` ```env DATABRICKS_HOST=https://your-workspace.cloud.databricks.com DATABRICKS_TOKEN=dapi... DATABRICKS_MODEL=databricks-claude-sonnet-4-5 MLFLOW_EXPERIMENT_ID=your-experiment-id ``` -------------------------------- ### Start Agent Server Source: https://github.com/databricks/app-templates/blob/main/agent-non-conversational/README.md Starts the agent server locally on port 8000. Use advanced options for hot-reloading, changing the port, or running with multiple workers. ```bash uv run start-server ``` ```bash uv run start-server --reload ``` ```bash uv run start-server --port 8001 ``` ```bash uv run start-server --workers 4 ``` -------------------------------- ### Build and Install Dependencies Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/CLAUDE.md Use this command sequence to resolve build errors by cleaning the project and reinstalling dependencies. This is useful when encountering issues during the build process. ```bash rm -rf dist node_modules npm install npm run build ``` -------------------------------- ### Get Help for MCP Server Source: https://github.com/databricks/app-templates/blob/main/mcp-server-hello-world/README.md Use this command to view the help message and available arguments for the MCP server. ```bash uv run custom-mcp-server --help ``` -------------------------------- ### Run Agent Development Server Individually Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/AGENTS.md Start only the agent server for development without the UI. You can specify a custom port. ```bash npm run dev:agent ``` ```bash PORT=5001 npm run dev:agent ``` -------------------------------- ### Run Agent Application Source: https://github.com/databricks/app-templates/blob/main/agent-langgraph-advanced/README.md After deploying the bundle, use this command to start or restart your agent application. This command is required to apply the new code and configuration. ```bash databricks bundle run agent_langgraph_advanced ``` -------------------------------- ### Unit Test Example Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/tests/README.md Example of a basic unit test using Jest. Place this in the tests/ directory. No special setup is required. ```typescript import { describe, test, expect } from '@jest/globals'; import { myFunction } from '../src/my-module.js'; describe("My Unit Test", () => { test("should work", () => { expect(myFunction()).toBe(expected); }); }); ``` -------------------------------- ### Run Agent Evaluation Script Source: https://github.com/databricks/app-templates/blob/main/agent-langgraph/AGENTS.md After installing MLflow Skills and starting the local server, run the built-in agent evaluation script using this command. ```bash uv run agent-evaluate ``` -------------------------------- ### Complete Example Workflow for Agent Deployment and Testing Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/tests/e2e/README.md This bash script demonstrates a full workflow for building, deploying, and testing the agent-langchain-ts application. It includes steps for setting environment variables and running authentication and E2E tests. ```bash # 1. Build npm run build # 2. Deploy databricks bundle deploy databricks bundle run agent_langchain_ts # 3. Wait for app to start (check status) databricks apps get agent-lc-ts-dev # 4. Set environment variables export APP_URL=$(databricks apps get agent-lc-ts-dev --output json | jq -r '.url') export DATABRICKS_CLI_PROFILE "${DATABRICKS_CONFIG_PROFILE:-DEFAULT}" echo "Testing app at: $APP_URL" # 5. Test authentication TOKEN=$(databricks auth token | jq -r '.access_token') curl -I "$APP_URL/api/session" -H "Authorization: Bearer $TOKEN" # 6. Run E2E tests npm run test:e2e # 7. Run specific test npm test tests/e2e/deployed.test.ts ``` -------------------------------- ### Add Custom API Endpoint Source: https://github.com/databricks/app-templates/blob/main/mcp-server-hello-world/README.md Add custom API endpoints to your FastAPI application by defining new routes. This example shows how to create a simple GET endpoint. ```python @app.get("/custom-endpoint") def custom_endpoint(): return {"message": "Hello from custom endpoint"} ``` -------------------------------- ### MSW API Mocking Setup Source: https://github.com/databricks/app-templates/blob/main/e2e-chatbot-app-next/CLAUDE.md Details how Mock Service Worker (MSW) is used to mock Databricks API calls in the test environment when `PLAYWRIGHT=True`. Mocks are defined in `tests/api-mocking/api-mock-server.ts` and the server starts automatically. ```typescript // Mocks are defined in `tests/api-mocking/api-mock-server.ts` // Server starts automatically in test environment ``` -------------------------------- ### Python Example: Connect to Databricks MCP Client Source: https://github.com/databricks/app-templates/blob/main/mcp-server-hello-world/static/index.html This Python code demonstrates how to initialize a Databricks Workspace client and then use it to create a DatabricksMCPClient. It shows how to list available MCP tools. ```python from databricks.sdk import WorkspaceClient from databricks_mcp import DatabricksMCPClient # Initialize the Databricks Workspace client ws_client = WorkspaceClient( host="databricks-host", token="exactly-scoped-OAuth-token", ) # Initialize the MCP client with your app’s MCP endpoint mcp_client = DatabricksMCPClient( server_url='databricks-app-url', workspace_client=ws_client, ) # List available MCP tools print(mcp_client.list_tools()) ``` -------------------------------- ### Background Mode (Kick off without stream + poll) - curl Source: https://github.com/databricks/app-templates/blob/main/agent-openai-advanced/README.md Start an asynchronous agent task with curl by setting `background: true`. The initial response contains an ID for polling the status via GET requests until completion. ```bash # Kick off curl -X POST /responses \ -H "Content-Type: application/json" \ -d '{ "input": [{ "role": "user", "content": "..." }], "background": true }' # Returns: { "id": "resp_xxx", "status": "in_progress", ... } # Poll (repeat until status is "completed" or "failed") curl /responses/resp_xxx # Returns: { "id": "resp_xxx", "status": "in_progress" } # ... eventually: # Returns: { "id": "resp_xxx", "status": "completed", "output": [...] } ``` -------------------------------- ### Create MLflow Experiment Source: https://github.com/databricks/app-templates/blob/main/agent-non-conversational/README.md Create an MLflow experiment via the CLI for agent tracing. This is automatically handled by the quickstart script. Remember to update your .env file with the created experiment ID. ```bash DATABRICKS_USERNAME=$(databricks current-user me | jq -r .userName) databricks experiments create-experiment /Users/$DATABRICKS_USERNAME/agents-on-apps ``` ```bash cp .env.example .env # Edit .env and fill in your experiment ID ``` -------------------------------- ### Initialize Databricks MCP Client and List Tools Source: https://github.com/databricks/app-templates/blob/main/mcp-server-hello-world/scripts/dev/README.md Instantiate the Databricks MCP client with the local server URL and list available tools. Ensure the local server is running before execution. ```python from databricks_mcp import DatabricksMCPClient mcp_client = DatabricksMCPClient( server_url="http://localhost:8000" ) # List available MCP tools print(mcp_client.list_tools()) ``` -------------------------------- ### Install Databricks CLI Source: https://github.com/databricks/app-templates/blob/main/e2e-chatbot-app-next/README.md Installs the Databricks CLI on macOS using Homebrew. Ensure you have the latest version. ```bash brew install databricks brew upgrade databricks && databricks -v ``` -------------------------------- ### Build Application Source: https://github.com/databricks/app-templates/blob/main/e2e-chatbot-app-next/CLAUDE.md Performs a full build of the application, including database migration, client build, and server build. ```bash npm run build # Full build: DB migrate → client → server ``` -------------------------------- ### Discover Available Tools Source: https://github.com/databricks/app-templates/blob/main/agent-openai-agents-sdk-multiagent/AGENTS.md Run this command to find and list the tools and resources accessible by the agent. ```bash uv run discover-tools ``` -------------------------------- ### Start or Restart Databricks App Source: https://github.com/databricks/app-templates/blob/main/agent-openai-advanced/README.md Required to start or restart the app with the new code after deployment. `bundle deploy` only uploads files and configures resources. ```bash databricks bundle run agent_openai_advanced ``` -------------------------------- ### Start or Restart Databricks App Agent Source: https://github.com/databricks/app-templates/blob/main/agent-openai-agents-sdk/README.md After deployment, use this command to start or restart your agent. This step is crucial for the agent to run with the newly deployed code. ```bash databricks bundle run agent_openai_agents_sdk ``` -------------------------------- ### Quick Commands for Agent Tasks Source: https://github.com/databricks/app-templates/blob/main/agent-langgraph-advanced/AGENTS.md A collection of quick commands for common agent development tasks, including setup, tool discovery, local execution, deployment, and log viewing. ```bash uv run quickstart ``` ```bash uv run discover-tools ``` ```bash uv run start-app ``` ```bash databricks bundle deploy && databricks bundle run agent_langgraph_advanced ``` ```bash databricks apps logs --follow ``` -------------------------------- ### Get Service Principal Client ID Source: https://github.com/databricks/app-templates/blob/main/agent-openai-advanced/AGENTS.md Retrieve the service principal client ID for a given Databricks app using the 'databricks apps get' command. ```bash databricks apps get --profile --output json | jq -r '.service_principal_client_id' ``` -------------------------------- ### Troubleshoot Agent Startup Issues Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/AGENTS.md Commands to resolve issues when the agent fails to start. This includes checking for port conflicts, rebuilding the agent, and viewing logs. ```bash # Check if port is in use lsof -ti:5001 | xargs kill -9 # Rebuild npm run build:agent # Check logs npm run dev:agent ``` -------------------------------- ### Build Agent Project Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/README.md Run this command to build the agent project. The output will be placed in the `dist/` directory. ```bash npm run build ``` -------------------------------- ### Install MLflow Skills Source: https://github.com/databricks/app-templates/blob/main/agent-langgraph/AGENTS.md Install the MLflow Skills package to enable agent evaluation workflows. This command adds the skills to your project, making them available as slash commands. ```bash npx skills add mlflow/skills ``` -------------------------------- ### AppKit Full-Stack App Commands Source: https://context7.com/databricks/app-templates/llms.txt Manage AppKit full-stack applications using npm commands for installation, development, building, and code quality checks. Ensure Node.js and npm are installed. ```bash # Install and run locally npm install npm run dev # Hot-reload dev server # Build for production npm run build npm start # Code quality npm run typecheck npm run lint:fix npm run format:fix ``` -------------------------------- ### Build Server Source: https://github.com/databricks/app-templates/blob/main/e2e-chatbot-app-next/CLAUDE.md Builds only the server-side application, outputting the result to server/dist/. ```bash npm run build:server # Build server only (outputs to server/dist/) ``` -------------------------------- ### Local Integration Test Example Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/tests/README.md Example of a local integration test. This test calls a local endpoint and requires the agent server to be running on port 5001. Document prerequisites clearly. ```typescript /** * Integration test for local development * * Prerequisites: * - Start servers: npm run dev * - Agent on port 5001, UI on port 3001 */ import { describe, test, expect } from '@jest/globals'; const AGENT_URL = "http://localhost:5001"; describe("My Integration Test", () => { test("should call local endpoint", async () => { const response = await fetch(`${AGENT_URL}/invocations`, {...}); expect(response.ok).toBe(true); }); }); ``` -------------------------------- ### Install Databricks AI Tools Skills Source: https://github.com/databricks/app-templates/blob/main/appkit-all-in-one/CLAUDE.md Installs Databricks experimental AI tools skills for enhanced AI assistance with Databricks CLI operations, authentication, data exploration, and app development. ```bash databricks experimental aitools skills install ``` -------------------------------- ### E2E Test Example Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/tests/README.md Example of an end-to-end test for a deployed application. This test requires the APP_URL environment variable to be set and uses a deployed auth token. It calls the /invocations endpoint of the deployed app. ```typescript /** * E2E test for deployed app * * Prerequisites: * - Deploy app: databricks bundle deploy * - Set APP_URL environment variable * * Run with: APP_URL= npm run test:e2e */ import { describe, test, expect, beforeAll } from '@jest/globals'; import { getDeployedAuthToken } from '../helpers.js'; const APP_URL = process.env.APP_URL || "https://default.databricksapps.com"; let authToken: string; beforeAll(async () => { authToken = await getDeployedAuthToken(); }); describe("My E2E Test", () => { test("should work with deployed app", async () => { const response = await fetch(`${APP_URL}/invocations`, { headers: { Authorization: `Bearer ${authToken}` }, // ... }); expect(response.ok).toBe(true); }); }); ``` -------------------------------- ### Quick Command: Deploy Agent Source: https://github.com/databricks/app-templates/blob/main/agent-openai-advanced/AGENTS.md Deploy the agent to Databricks and run it using the provided commands. Replace `` with your Databricks profile name. ```bash databricks bundle deploy --profile && databricks bundle run agent_openai_advanced --profile ``` -------------------------------- ### Build Client Source: https://github.com/databricks/app-templates/blob/main/e2e-chatbot-app-next/CLAUDE.md Builds only the client-side application, outputting the result to client/dist/. ```bash npm run build:client # Build client only (outputs to client/dist/) ``` -------------------------------- ### Initialize Agent with Tools Source: https://context7.com/databricks/app-templates/llms.txt Initializes an agent with a predefined set of tools, optionally extending them with MCP tools. Uses ChatDatabricks model. ```python async def init_agent(workspace_client=None): tools = [get_current_time] # Optionally extend with MCP tools: # mcp_client = init_mcp_client(workspace_client) # tools.extend(await mcp_client.get_tools()) return create_agent(tools=tools, model=ChatDatabricks(endpoint="databricks-gpt-5-2")) ``` -------------------------------- ### Run Databricks Chatbot Application Source: https://github.com/databricks/app-templates/blob/main/e2e-chatbot-app-next/README.md Starts the Databricks chatbot application after deployment. ```bash databricks bundle run databricks_chatbot ``` -------------------------------- ### Quick Reference for Test Commands Source: https://github.com/databricks/app-templates/blob/main/agent-langchain-ts/tests/README.md A quick reference for commands to run different types of tests: unit, integration, E2E, and all non-E2E tests. ```bash # All unit tests (no servers needed) npm run test:unit # Integration tests (requires local servers running) npm run test:integration # E2E tests (requires deployed app) npm run test:e2e # All non-E2E tests npm run test:all ``` -------------------------------- ### Run Deployed Databricks App Source: https://github.com/databricks/app-templates/blob/main/appkit-all-in-one/README.md Start the deployed Databricks application in a development environment. ```bash databricks bundle run -t dev ```