> ## 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.

# Initialize git repository

> Create a git repository for the current project and return the refreshed project info.



## OpenAPI

````yaml /openapi.json post /project/git/init
openapi: 3.1.1
info:
  title: cognitio
  description: cognitio api
  version: 1.0.0
servers: []
security: []
paths:
  /project/git/init:
    post:
      summary: Initialize git repository
      description: >-
        Create a git repository for the current project and return the refreshed
        project info.
      operationId: project.initGit
      parameters:
        - in: query
          name: directory
          schema:
            type: string
        - in: query
          name: workspace
          schema:
            type: string
      responses:
        '200':
          description: Project information after git initialization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
      x-codeSamples:
        - lang: js
          source: |-
            import { createCognitioClient } from "@cognitio/sdk

            const client = createCognitioClient()
            await client.project.initGit({
              ...
            })
components:
  schemas:
    Project:
      type: object
      properties:
        id:
          type: string
        worktree:
          type: string
        vcs:
          type: string
          const: git
        name:
          type: string
        icon:
          type: object
          properties:
            url:
              type: string
            override:
              type: string
            color:
              type: string
        commands:
          type: object
          properties:
            start:
              description: Startup script to run when creating a new workspace (worktree)
              type: string
        time:
          type: object
          properties:
            created:
              type: number
            updated:
              type: number
            initialized:
              type: number
          required:
            - created
            - updated
        sandboxes:
          type: array
          items:
            type: string
      required:
        - id
        - worktree
        - time
        - sandboxes

````

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