> ## Documentation Index
> Fetch the complete documentation index at: https://cognitio-agent.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get VCS diff

> Retrieve the current git diff for the working tree or against the default branch.



## OpenAPI

````yaml /openapi.json get /vcs/diff
openapi: 3.1.1
info:
  title: cognitio
  description: cognitio api
  version: 1.0.0
servers: []
security: []
paths:
  /vcs/diff:
    get:
      summary: Get VCS diff
      description: >-
        Retrieve the current git diff for the working tree or against the
        default branch.
      operationId: vcs.diff
      parameters:
        - in: query
          name: directory
          schema:
            type: string
        - in: query
          name: workspace
          schema:
            type: string
        - in: query
          name: mode
          schema:
            type: string
            enum:
              - git
              - branch
          required: true
      responses:
        '200':
          description: VCS diff
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/VcsFileDiff'
      x-codeSamples:
        - lang: js
          source: |-
            import { createCognitioClient } from "@cognitio/sdk

            const client = createCognitioClient()
            await client.vcs.diff({
              ...
            })
components:
  schemas:
    VcsFileDiff:
      type: object
      properties:
        file:
          type: string
        patch:
          type: string
        additions:
          type: number
        deletions:
          type: number
        status:
          type: string
          enum:
            - added
            - deleted
            - modified
      required:
        - file
        - patch
        - additions
        - deletions

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.