# Generate SDK in a Subdirectory
Source: https://speakeasy.com/docs/sdks/guides/generate-in-a-subdirectory

import { Screenshot } from "@/mdx/components";



Similar to setting up a monorepo, you can also configure Speakeasy to generate your SDK into a subdirectory. This setup maybe useful in maintaining seperation between handwritten and generated code or for consuming the SDK in a monolithic codebase.

## Step 1: 

In the root of your existing directory run `speakeasy quickstart`: 

<Screenshot 
  variant="cli"
  image={{
    src: "/assets/docs/create-sdks/guides/generate-in-a-subdirectory/1.png",
    alt: "A screenshot of the speakeasy quickstart command in the CLI."
  }}
/>

## Step 2: 

Select your generation language.

<Screenshot 
  variant="cli"
  image={{
    src: "/assets/docs/create-sdks/guides/generate-in-a-subdirectory/2.png",
    alt: "A screenshot of the CLI prompting the user to select their generation language."
  }}
/>

## Step 3: 

Name your package.

<Screenshot 
  variant="cli"
  image={{
    src: "/assets/docs/create-sdks/guides/generate-in-a-subdirectory/3.png",
    alt: "A screenshot of the package name in the Speakeasy CLI."
  }}
/>

## Step 4: 

If you're setting your SDK up in a folder with existing subfolders, you will be prompted to select an output directory. 

<Screenshot 
  variant="cli"
  image={{
    src: "/assets/docs/create-sdks/guides/generate-in-a-subdirectory/4.png",
    alt: "A screenshot of the user being prompted to provide an output directory in the CLI."
  }}
/>

## Step 5: 

Complete generating your SDK.

<Screenshot 
  variant="cli"
  image={{
    src: "/assets/docs/create-sdks/guides/generate-in-a-subdirectory/5.png",
    alt: "A screenshot of a succesful CLI generation."
  }}
/>

Going forward to generate your SDK navigate to your SDK folder and run `speakeasy run`.