### Run yarn install on container start Source: https://github.com/microsoft/vscode-docs/blob/main/remote/advancedcontainers/start-processes.md Use `postStartCommand` to execute commands like `yarn install` every time the container starts to keep dependencies up to date. ```json "postStartCommand": "yarn install" ``` -------------------------------- ### Install and Serve Documentation Locally Source: https://github.com/microsoft/vscode-docs/blob/main/CONTRIBUTING.md Install project dependencies and start a local development server to preview the documentation site. This is useful for reviewing changes before submitting a pull request. ```bash npm install npm run serve ``` -------------------------------- ### Example: Debugger Start Keybinding Source: https://github.com/microsoft/vscode-docs/blob/main/api/references/when-clause-contexts.md This example shows how a keybinding can be conditionally enabled based on debugger availability and debug mode status. ```json { "key": "f5", "command": "workbench.action.debug.start", "when": "debuggersAvailable && !inDebugMode" } ``` -------------------------------- ### Example Local Server Configuration Source: https://github.com/microsoft/vscode-docs/blob/main/docs/agents/reference/mcp-configuration.md Minimal configuration for a basic, local MCP server using npx. This example demonstrates how to specify the command and arguments to start the server. ```json { "servers": { "memory": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-memory" ] } } } ``` -------------------------------- ### Open PowerShell Examples Folder Source: https://github.com/microsoft/vscode-docs/blob/main/docs/languages/powershell.md Opens the PowerShell examples folder in VS Code. Ensure the PowerShell extension is installed. ```powershell code (Get-ChildItem ~\.vscode\extensions\ms-vscode.PowerShell-*\examples)[-1] ``` -------------------------------- ### Walkthrough Contribution Example Source: https://github.com/microsoft/vscode-docs/blob/main/api/references/contribution-points.md Defines a sample walkthrough with two steps: one triggered by a command and another by a setting change. Use this to introduce users to extension features upon installation. ```json { "contributes": { "walkthroughs": [ { "id": "sample", "title": "Sample", "description": "A sample walkthrough", "steps": [ { "id": "runcommand", "title": "Run Command", "description": "This step will run a command and check off once it has been run.\n[Run Command](command:getting-started-sample.runCommand)", "media": { "image": "media/image.png", "altText": "Empty image" }, "completionEvents": ["onCommand:getting-started-sample.runCommand"] }, { "id": "changesetting", "title": "Change Setting", "description": "This step will change a setting and check off when the setting has changed\n[Change Setting](command:getting-started-sample.changeSetting)", "media": { "markdown": "media/markdown.md" }, "completionEvents": ["onSettingChanged:getting-started-sample.sampleSetting"] } ] } ] } } ``` -------------------------------- ### Updated Create a Dev Container Tutorial Source: https://github.com/microsoft/vscode-docs/blob/main/release-notes/v1_50.md Overview of the updated tutorial for creating Dev Containers, guiding users through setup and configuration. ```APIDOC ## Documentation - Updated Create a Dev Container Tutorial ### Description The tutorial for creating a Dev Container has been updated to provide clearer instructions on setting up a reusable Docker container for development environments. It covers authoring `devcontainer.json`, extending with `Dockerfile`, managing multi-container setups with Docker Compose, and building/testing custom development containers. ``` -------------------------------- ### Prevent VS Code from Launching After Installation Source: https://github.com/microsoft/vscode-docs/blob/main/docs/setup/windows.md Use the `/mergetasks=!runcode` command-line switch with the Inno Setup installer to prevent VS Code from automatically starting after installation. ```bash VSCodeSetup.exe /mergetasks=!runcode ``` -------------------------------- ### Get Help with Shell Commands Source: https://github.com/microsoft/vscode-docs/blob/main/docs/agents/guides/prompt-examples.md Use inline chat in the terminal to get assistance with shell commands and operations. This prompt is an example of asking for help with package installation. ```prompt How do I install npm packages? ``` -------------------------------- ### Clone and Install LSP Sample Source: https://github.com/microsoft/vscode-docs/blob/main/api/language-extensions/language-server-extension-guide.md Clone the VS Code extension samples repository, navigate to the lsp-sample directory, install dependencies, compile the code, and open the workspace in VS Code. ```bash > git clone https://github.com/microsoft/vscode-extension-samples.git > cd vscode-extension-samples/lsp-sample > npm install > npm run compile > code . ``` -------------------------------- ### Custom Setup with @vscode/test-electron Source: https://github.com/microsoft/vscode-docs/blob/main/api/working-with-extensions/testing-extension.md This example demonstrates how to use `@vscode/test-electron` for custom test setups, such as installing an extension before running tests. It utilizes `child_process.spawnSync` for executing VS Code CLI commands. ```typescript import * as cp from 'child_process'; import * as path from 'path'; import { downloadAndUnzipVSCode, resolveCliArgsFromVSCodeExecutablePath, runTests } from '@vscode/test-electron'; async function main() { try { const extensionDevelopmentPath = path.resolve(__dirname, '../../../'); const extensionTestsPath = path.resolve(__dirname, './suite/index'); const vscodeExecutablePath = await downloadAndUnzipVSCode('1.40.1'); const [cliPath, ...args] = resolveCliArgsFromVSCodeExecutablePath(vscodeExecutablePath); // Use cp.spawn / cp.exec for custom setup cp.spawnSync(cliPath, [...args, '--install-extension', ''], { encoding: 'utf-8', stdio: 'inherit' }); // Run the extension test await runTests({ // Use the specified `code` executable vscodeExecutablePath, extensionDevelopmentPath, extensionTestsPath }); } catch (err) { console.error('Failed to run tests'); process.exit(1); } } main(); ``` -------------------------------- ### Install and Start OpenSSH Server on RHEL/CentOS Source: https://github.com/microsoft/vscode-docs/blob/main/docs/remote/troubleshooting.md Installs OpenSSH server, starts the service, and enables it to run on boot for RHEL/CentOS systems. ```bash sudo yum install openssh-server && sudo systemctl start sshd.service && sudo systemctl enable sshd.service ``` -------------------------------- ### Example launchSettings.json Profile Source: https://github.com/microsoft/vscode-docs/blob/main/docs/csharp/debugger-settings.md This is an example of a `launchSettings.json` file structure that can be referenced by the `launchSettingsProfile` setting. ```json { "profiles": { "ProfileNameGoesHere": { "commandName": "Project", "environmentVariables": { "myVariableName":"theValueGoesHere" } } } } ``` -------------------------------- ### Create and Navigate to Project Directory Source: https://github.com/microsoft/vscode-docs/blob/main/docs/cpp/config-linux.md Set up a new directory for your VS Code projects, create a subdirectory for the 'helloworld' project, and open it in VS Code. ```bash mkdir projects cd projects mkdir helloworld cd helloworld code . ``` -------------------------------- ### View Dev Container CLI Help Source: https://github.com/microsoft/vscode-docs/blob/main/docs/devcontainers/devcontainer-cli.md Verify the CLI installation and view available commands and options by running the help command. ```bash devcontainer Commands: devcontainer up Create and run dev container devcontainer build [path] Build a dev container image devcontainer run-user-commands Run user commands devcontainer read-configuration Read configuration devcontainer features Features commands devcontainer templates Templates commands devcontainer exec [args..] Execute a command on a running dev container Options: --help Show help [boolean] --version Show version number [boolean] ``` -------------------------------- ### Setup Logfire for OpenAI Agents SDK Source: https://github.com/microsoft/vscode-docs/blob/main/docs/intelligentapps/tracing.md Install Logfire and configure it to send traces to the specified endpoint. This setup is for OpenAI Agents SDK. ```bash pip install logfire ``` ```python import logfire import os os.environ["OTEL_EXPORTER_OTLP_TRACES_ENDPOINT"] = "http://localhost:4318/v1/traces" logfire.configure( service_name="opentelemetry-instrumentation-openai-agents-logfire", send_to_logfire=False, ) logfire.instrument_openai_agents() ``` -------------------------------- ### Setup Traceloop for OpenAI instrumentation in Node.js Source: https://github.com/microsoft/vscode-docs/blob/main/docs/intelligentapps/tracing.md Install Traceloop and initialize the SDK with your application name and base URL. This setup is for OpenAI instrumentation. ```bash npm install @traceloop/instrumentation-openai @traceloop/node-server-sdk ``` ```javascript const { initialize } = require("@traceloop/node-server-sdk"); initialize({ appName: "opentelemetry-instrumentation-openai-traceloop", baseUrl: "http://localhost:4318", disableBatch: true, }); ``` -------------------------------- ### Run Hello World with Node.js Source: https://github.com/microsoft/vscode-docs/blob/main/docs/nodejs/nodejs-tutorial.md Execute the 'app.js' file using the Node.js runtime from the terminal. ```bash node app.js ``` -------------------------------- ### Example MSVC Compiler Path Source: https://github.com/microsoft/vscode-docs/blob/main/docs/cpp/config-msvc.md This is an example of how the 'compilerPath' should be formatted for the Microsoft C++ compiler. Adjust the version and build details to match your specific installation. ```json "C:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.16.27023/bin/Hostx64/x64/cl.exe" ``` -------------------------------- ### Start Terminal Inline Chat Source: https://github.com/microsoft/vscode-docs/blob/main/docs/agents/reference/ai-features-cheat-sheet.md Use this command to start inline chat for asking about shell commands and the terminal. Example: 'how many cores on this machine?'. ```markdown kb(inlinechat.start) ``` -------------------------------- ### Start a Dev Container with `devcontainer up` Source: https://github.com/microsoft/vscode-docs/blob/main/docs/devcontainers/devcontainer-cli.md Clone a sample project and use the `devcontainer up` command to download the container image and start the container. Replace `` with the actual path to your cloned project. ```bash git clone https://github.com/microsoft/vscode-remote-try-rust devcontainer up --workspace-folder ``` -------------------------------- ### Example Prompt for Local Agent Source: https://github.com/microsoft/vscode-docs/blob/main/docs/agents/agent-types/local-agents.md Use this prompt to ask the local agent to set up a CI/CD pipeline. ```prompt Set up a CI/CD pipeline for this project. ``` -------------------------------- ### Setup Anthropic Instrumentation with Traceloop (TypeScript/JavaScript) Source: https://github.com/microsoft/vscode-docs/blob/main/docs/intelligentapps/tracing.md Installs and configures Traceloop Node.js SDK for Anthropic instrumentation. This setup sends traces to a specified base URL. ```bash npm install @traceloop/node-server-sdk ``` ```javascript const { initialize } = require("@traceloop/node-server-sdk"); const { trace } = require("@opentelemetry/api"); initialize({ appName: "opentelemetry-instrumentation-anthropic-traceloop", baseUrl: "http://localhost:4318", disableBatch: true, }); ``` -------------------------------- ### Setup Anthropic Instrumentation with OpenTelemetry (Python) Source: https://github.com/microsoft/vscode-docs/blob/main/docs/intelligentapps/tracing.md Installs and configures OpenTelemetry instrumentation for Anthropic in Python. This setup includes trace and log export to an OTLP endpoint. ```bash pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http opentelemetry-instrumentation-anthropic ``` ```python from opentelemetry import trace, _events from opentelemetry.sdk.resources import Resource from opentelemetry.sdk.trace import TracerProvider from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.sdk._logs import LoggerProvider from opentelemetry.sdk._logs.export import BatchLogRecordProcessor from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter from opentelemetry.sdk._events import EventLoggerProvider from opentelemetry.exporter.otlp.proto.http._log_exporter import OTLPLogExporter resource = Resource(attributes={ "service.name": "opentelemetry-instrumentation-anthropic-traceloop" }) provider = TracerProvider(resource=resource) otlp_exporter = OTLPSpanExporter( endpoint="http://localhost:4318/v1/traces", ) processor = BatchSpanProcessor(otlp_exporter) provider.add_span_processor(processor) trace.set_tracer_provider(provider) logger_provider = LoggerProvider(resource=resource) logger_provider.add_log_record_processor( BatchLogRecordProcessor(OTLPLogExporter(endpoint="http://localhost:4318/v1/logs")) ) _events.set_event_logger_provider(EventLoggerProvider(logger_provider)) from opentelemetry.instrumentation.anthropic import AnthropicInstrumentor AnthropicInstrumentor().instrument() ``` -------------------------------- ### Install Project Dependencies Source: https://github.com/microsoft/vscode-docs/blob/main/docs/nodejs/vuejs-tutorial.md Navigate into your new project directory and install the necessary dependencies using npm. ```bash cd npm install ``` -------------------------------- ### Setup Azure SDK Instrumentation (Node.js) Source: https://github.com/microsoft/vscode-docs/blob/main/docs/intelligentapps/tracing.md Installs and configures OpenTelemetry instrumentation for the Azure SDK in a Node.js environment. Ensure the necessary packages are installed via npm. ```bash npm install @azure/opentelemetry-instrumentation-azure-sdk @opentelemetry/api @opentelemetry/exporter-trace-otlp-proto @opentelemetry/instrumentation @opentelemetry/resources @opentelemetry/sdk-trace-node ``` ```javascript const { context } = require("@opentelemetry/api"); const { resourceFromAttributes } = require("@opentelemetry/resources"); const { NodeTracerProvider, SimpleSpanProcessor, } = require("@opentelemetry/sdk-trace-node"); const { OTLPTraceExporter } = require('@opentelemetry/exporter-trace-otlp-proto'); const exporter = new OTLPTraceExporter({ url: "http://localhost:4318/v1/traces", }); const provider = new NodeTracerProvider({ resource: resourceFromAttributes({ "service.name": "opentelemetry-instrumentation-azure-ai-inference", }), spanProcessors: [ new SimpleSpanProcessor(exporter) ], }); provider.register(); const { registerInstrumentations } = require("@opentelemetry/instrumentation"); const { createAzureSdkInstrumentation } = require("@azure/opentelemetry-instrumentation-azure-sdk"); registerInstrumentations({ instrumentations: [createAzureSdkInstrumentation()], }); ``` -------------------------------- ### Run the React Application Source: https://github.com/microsoft/vscode-docs/blob/main/docs/nodejs/reactjs-tutorial.md Navigate to your project directory and start the development server to view your React app in the browser. The server will remain running. ```bash cd my-app npm start ``` -------------------------------- ### Install Docfind using PowerShell Source: https://github.com/microsoft/vscode-docs/blob/main/blogs/2026/01/15/docfind.md Use this command to download and install the docfind utility via a PowerShell script. This is the recommended method for Windows users. ```psh irm https://microsoft.github.io/docfind/install.ps1 | iex ``` -------------------------------- ### Setup Anthropic Instrumentation with Monocle (Python) Source: https://github.com/microsoft/vscode-docs/blob/main/docs/intelligentapps/tracing.md Installs and configures Monocle telemetry for Anthropic in Python, using an OTLP span exporter for traces. This is an alternative to direct OpenTelemetry setup. ```bash pip install opentelemetry-sdk opentelemetry-exporter-otlp-proto-http monocle_apptrace ``` ```python from opentelemetry.sdk.trace.export import BatchSpanProcessor from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter # Import monocle_apptrace from monocle_apptrace import setup_monocle_telemetry # Setup Monocle telemetry with OTLP span exporter for traces setup_monocle_telemetry( workflow_name="opentelemetry-instrumentation-anthropic", span_processors=[ BatchSpanProcessor( OTLPSpanExporter(endpoint="http://localhost:4318/v1/traces") ) ] ) ``` -------------------------------- ### Install Docfind using Shell Script Source: https://github.com/microsoft/vscode-docs/blob/main/blogs/2026/01/15/docfind.md Use this command to download and install the docfind utility via a shell script. This is the recommended method for Linux and macOS users. ```sh curl -fsSL https://microsoft.github.io/docfind/install.sh | sh ``` -------------------------------- ### Configure Non-Interactive Debian Repository Installation Source: https://github.com/microsoft/vscode-docs/blob/main/docs/setup/linux.md Automatically install the apt repository and signing key for VS Code on Debian-based systems without user interaction. This is useful for automated setups. ```bash echo "code code/add-microsoft-repo boolean true" | sudo debconf-set-selections ``` -------------------------------- ### Example c_cpp_properties.json Configuration Source: https://github.com/microsoft/vscode-docs/blob/main/docs/cpp/customize-cpp-settings.md This snippet shows a sample configuration for the c_cpp_properties.json file, demonstrating how to define environment variables, compiler settings, include paths, and defines for a specific platform (Mac). ```json { "env": { "myIncludePath": [ "${workspaceFolder}/include", "${workspaceFolder}/src" ], "myDefines": [ "DEBUG", "MY_FEATURE=1" ] }, "configurations": [ { "name": "Mac", "compilerPath": "/usr/bin/clang++", "intelliSenseMode": "macos-clang-x64", "includePath": [ "${myIncludePath}", "${workspaceFolder}/**" ], "defines": [ "${myDefines}" ], "cStandard": "c17", "cppStandard": "c++20", "macFrameworkPath": [ "/System/Library/Frameworks", "/Library/Frameworks" ], "browse": { "path": [ "${myIncludePath}", "${workspaceFolder}" ] } } ], "version": 4, "enableConfigurationSquiggles": true } ``` -------------------------------- ### Install and Scaffold a New Extension (Global) Source: https://github.com/microsoft/vscode-docs/blob/main/api/get-started/your-first-extension.md Install Yeoman and the VS Code Extension Generator globally to easily create multiple extensions. Run 'yo code' to start the scaffolding process. ```bash npm install --global yo generator-code yo code ``` -------------------------------- ### Install Python Packages Source: https://github.com/microsoft/vscode-docs/blob/main/docs/intelligentapps/tracing.md Create a `requirements.txt` file listing the necessary Python packages and install them using pip. ```text opentelemetry-sdk opentelemetry-exporter-otlp-proto-http monocle_apptrace openai-agents python-dotenv ``` ```bash pip install -r requirements.txt ``` -------------------------------- ### Clone Mock Debug Repository and Install Dependencies Source: https://github.com/microsoft/vscode-docs/blob/main/api/extension-guides/debugger-extension.md Clone the Mock Debug repository from GitHub and install its Node.js dependencies using Yarn. This is the initial setup step for developing a debugger extension. ```bash git clone https://github.com/microsoft/vscode-mock-debug.git cd vscode-mock-debug yarn ``` -------------------------------- ### Inline Completion API Example Source: https://github.com/microsoft/vscode-docs/blob/main/docs/agent-customization/language-models.md An example demonstrating how to use the InlineCompletionItemProvider API to contribute custom completion providers for inline suggestions. This is a starting point for extensions that need to integrate custom completion logic. ```typescript import * as vscode from "vscode"; export class InlineCompletionProvider implements vscode.InlineCompletionItemProvider { async provideInlineCompletionItems( model: vscode.InlineCompletionModel, context: vscode.InlineCompletionContext, token: vscode.CancellationToken ): Promise { // ... implementation to provide completion items return []; } } ``` -------------------------------- ### Install Traceloop for Node.js Source: https://github.com/microsoft/vscode-docs/blob/main/docs/intelligentapps/tracing.md Install the Traceloop server SDK for Node.js. ```bash npm install @traceloop/node-server-sdk ``` -------------------------------- ### Example Prompt for Ask Feature Source: https://github.com/microsoft/vscode-docs/blob/main/docs/agents/agent-types/local-agents.md Use this prompt to ask the 'Ask' feature about configuration details in the codebase. ```prompt Where is the db connection configured in this project? #codebase ``` -------------------------------- ### Start Debugger (Bash) Source: https://github.com/microsoft/vscode-docs/blob/main/docs/python/debugging.md Starts the debugpy debugger from the command line, listening on a specified port and running a Python script. This example omits the `--wait-for-client` flag, so the script will not wait for the debugger to attach. ```bash python -m debugpy --listen 5678 ./myscript.py ``` ```bash python -m debugpy --listen 0.0.0.0:5678 ./myscript.py ``` -------------------------------- ### Run AI application with tracing Source: https://github.com/microsoft/vscode-docs/blob/main/docs/intelligentapps/tracing.md Execute your AI application with tracing enabled. Ensure you have the necessary setup and dependencies installed. ```python from promptflow.connections import AzureOpenAIConnection from promptflow import PFClient client = PFClient() # Assuming you have a connection named 'azure_openai_connection' connection = AzureOpenAIConnection( name="azure_openai_connection", deployment_name="gpt-35-turbo", model_name="gpt-35-turbo", api_type="azure", api_base="https://your-azure-openai-endpoint.openai.azure.com/", api_key="YOUR_API_KEY", subscription_id="YOUR_SUBSCRIPTION_ID", resource_group="YOUR_RESOURCE_GROUP", ) # You can also use a connection defined in your environment # connection = AzureOpenAIConnection( # name="azure_openai_connection" # ) result = client.run( connection=connection, # You can also pass the connection directly # connection=AzureOpenAIConnection( # name="azure_openai_connection" # ), prompt="Book me a flight today from SEA to SFO, then book the best hotel there and tell me the weather.", # You can also pass the connection directly # connection=AzureOpenAIConnection( # name="azure_openai_connection" # ), ) print(result.final_output) ```