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

# sync-org

> Use the sync-org command to sync all projects in a GitHub organization to Endor Labs.

Use the `endorctl sync-org` command to create projects for all the unscanned repositories in your GitHub organization. This does not automatically scan the projects. It creates projects in Endor Labs, measures scan coverage across a GitHub organization, and gives you visibility into your source control repository.

## Usage

To sync your GitHub organization to Endor Labs:

* Export a GitHub token that can read all projects in your GitHub organization. To run the sync-org command you need at least `repo` and `read:org permissions`.

  ```bash theme={null}
  export GITHUB_TOKEN=<insert-github-token>
  ```

* Run the sync-org command. By default, the command skips archived repositories.

  ```bash theme={null}
  endorctl sync-org --name=endorlabs
  ```

> [!NOTE]
>
> The `sync-org` command deletes projects in Endor Labs when you archive their linked repositories on GitHub. Use the `--archived` flag to include archived repositories and prevent Endor Labs from deleting them.

## Options

The `endorctl sync-org` command uses the following flags and environment variables:




&#x20; \- Flag: \`archived\`
&#x20; Environment\_Variable: \`ENDOR\_SYNC\_ORG\_ARCHIVED\`
&#x20; Type: boolean
&#x20; Description: Include archived repositories and prevent Endor Labs from deleting them.

&#x20; \- Flag: \`github-api-url\`
&#x20; Environment\_Variable: \`ENDOR\_SYNC\_ORG\_GITHUB\_API\_URL\`
&#x20; Type: string
&#x20; Description: Set the URL for API requests to GitHub Enterprise Cloud or GitHub Enterprise Server (default: \`https\://api.github.com/\`).

&#x20; \- Flag: \`name\`
&#x20; Environment\_Variable: \`ENDOR\_SYNC\_ORG\_NAME\`
&#x20; Type: string
&#x20; Description: Set the full name of the organization. For example: \`endorlabs\`.

&#x20; \- Flag: \`platform-source\`
&#x20; Environment\_Variable: \`ENDOR\_SYNC\_ORG\_PLATFORM\_SOURCE\`
&#x20; Type: string
&#x20; Description: Set the platform source (default: \`github\`).

&#x20; \- Flag: \`uuid\`
&#x20; Environment\_Variable: \`ENDOR\_SYNC\_ORG\_UUID\`
&#x20; Type: string
&#x20; Description: Set the UUID of the GitHub installation.


&#x20;&#x20;


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