> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runloop.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# (Deprecated, please use /execute_async) Synchronously execute a shell command on a Devbox

> Execute a bash command in the Devbox shell, await the command completion and return the output. Note: attach_stdin parameter is not supported for synchronous execution.



## OpenAPI

````yaml /openapi-specs/stainless-processed-openapi.json post /v1/devboxes/{id}/execute_sync
openapi: 3.1.0
info:
  title: RunLoop API
  version: '0.1'
  description: >-
    The RunLoop API spec that allows you to host lambda functions and Devboxes
    to enable scaled long running ai workflows.
  contact:
    name: Runloop AI Support
    url: https://runloop.ai
    email: support@runloop.ai
servers:
  - url: https://api.runloop.ai
    description: Runloop API
    variables: {}
security:
  - bearerAuth: []
tags:
  - name: Benchmark
  - name: Blueprint
  - name: Blueprint-Lifecycle
  - name: Blueprint-ObservabilityTools
  - name: Devbox
  - name: Devbox-FileTools
  - name: Devbox-Lifecycle
  - name: Devbox-NetworkTools
  - name: Devbox-ObservabilityTools
  - name: Devbox-PersistenceTools
  - name: Devbox-ShellTools
  - name: Scenario
  - name: ScenarioScorer
  - name: accounts
  - name: agents
  - name: apikeys
  - name: axons
  - name: executions
  - name: gateway-configs
  - name: mcp-configs
  - name: network-policies
  - name: objects
  - name: restricted_keys
  - name: secrets
  - name: streaming
paths:
  /v1/devboxes/{id}/execute_sync:
    post:
      tags:
        - Devbox
        - Devbox-ShellTools
      summary: >-
        (Deprecated, please use /execute_async) Synchronously execute a shell
        command on a Devbox
      description: >-
        Execute a bash command in the Devbox shell, await the command completion
        and return the output. Note: attach_stdin parameter is not supported for
        synchronous execution.
      operationId: execSyncCommand
      parameters:
        - name: id
          in: path
          description: The Devbox ID.
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DevboxCreateExecutionParameters'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DevboxExecutionDetailView'
      deprecated: true
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Runloop from '@runloop/api-client';


            const client = new Runloop({
              bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
            });


            const devboxExecutionDetailView = await
            client.devboxes.executeSync('id', { command: 'command' });


            console.log(devboxExecutionDetailView.devbox_id);
        - lang: Python
          source: |-
            import os
            from runloop_api_client import Runloop

            client = Runloop(
                bearer_token=os.environ.get("RUNLOOP_API_KEY"),  # This is the default and can be omitted
            )
            devbox_execution_detail_view = client.devboxes.execute_sync(
                id="id",
                command="command",
            )
            print(devbox_execution_detail_view.devbox_id)
components:
  schemas:
    DevboxCreateExecutionParameters:
      type: object
      properties:
        command:
          type: string
          description: >-
            The command to execute via the Devbox shell. By default, commands
            are run from the user home directory unless shell_name is specified.
            If shell_name is specified the command is run from the directory
            based on the recent state of the persistent shell.
        shell_name:
          description: >-
            The name of the persistent shell to create or use if already
            created. When using a persistent shell, the command will run from
            the directory at the end of the previous command and environment
            variables will be preserved.
          type:
            - string
            - 'null'
        attach_stdin:
          description: >-
            Whether to attach stdin streaming for async commands. Not valid for
            execute_sync endpoint. Defaults to false if not specified.
          type:
            - boolean
            - 'null'
      required:
        - command
    DevboxExecutionDetailView:
      type: object
      properties:
        devbox_id:
          type: string
          description: Devbox id where command was executed.
        stdout:
          type: string
          description: Standard out generated by command.
        stderr:
          type: string
          description: Standard error generated by command.
        exit_status:
          type: integer
          format: int32
          description: Exit status of command execution.
        shell_name:
          description: Shell name.
          type:
            - string
            - 'null'
      required:
        - devbox_id
        - stdout
        - stderr
        - exit_status
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````