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

# store.listRepos()

> List all repositories in your organization with pagination support.

> [!WARNING]
>
> This page documents the earlier Code Storage SDKs: `@pierre/storage`, `pierre-storage`, and
> `code-storage-go`. New code uses the [Pierre SDK](https://code.storage/docs/sdks.md). To move code to the new SDK, use the
> [`pierre-migrate`
> skill](https://github.com/pierrecomputer/skills/tree/main/skills/pierre-migrate).

```typescript TypeScript theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
// List all repositories
const repos = await store.listRepos();
console.log(`Found ${repos.repos.length} repositories`);

for (const repo of repos.repos) {
  console.log(`${repo.repoId}: ${repo.defaultBranch}`);
  if (repo.baseRepo) {
    console.log(`  Synced with: ${repo.baseRepo.owner}/${repo.baseRepo.name}`);
  }
}

// With pagination
const page = await store.listRepos({
  limit: 20,
  cursor: repos.nextCursor,
});

// Filter by a substring of the repository name
const matches = await store.listRepos({ q: 'sdk' });

// Iterate through all pages
let cursor: string | undefined;
do {
  const result = await store.listRepos({ limit: 50, cursor });
  for (const repo of result.repos) {
    console.log(repo.repoId);
  }
  cursor = result.nextCursor;
} while (cursor);
```

```python Python theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
# List all repositories
repos = await storage.list_repos()
print(f"Found {len(repos['repos'])} repositories")

for repo in repos["repos"]:
    print(f"{repo['repo_id']}: {repo['default_branch']}")
    if repo.get("base_repo"):
        base = repo["base_repo"]
        print(f"  Synced with: {base['owner']}/{base['name']}")

# With pagination
page = await storage.list_repos(
    limit=20,
    cursor=repos.get("next_cursor"),
)

# Filter by a substring of the repository name
matches = await storage.list_repos(q="sdk")

# Iterate through all pages
cursor = None
while True:
    result = await storage.list_repos(limit=50, cursor=cursor)
    for repo in result["repos"]:
        print(repo["repo_id"])
    cursor = result.get("next_cursor")
    if not cursor:
        break
```

```go Go theme={null} theme={"theme":{"light":"github-light","dark":"min-dark"}}
ctx := context.Background()

// List all repositories
repos, err := client.ListRepos(ctx, storage.ListReposOptions{})
fmt.Printf("Found %d repositories", len(repos.Repos))

for _, repo := range repos.Repos {
	fmt.Printf("%s: %s", repo.RepoID, repo.DefaultBranch)
	if repo.BaseRepo != nil {
		fmt.Printf("  Synced with: %s/%s", repo.BaseRepo.Owner, repo.BaseRepo.Name)
	}
}

// With pagination
page, err := client.ListRepos(ctx, storage.ListReposOptions{
	Limit:  20,
	Cursor: repos.NextCursor,
})

// Filter by a substring of the repository name
matches, err := client.ListRepos(ctx, storage.ListReposOptions{Q: "sdk"})

// Iterate through all pages
cursor := ""
for {
	result, err := client.ListRepos(ctx, storage.ListReposOptions{Limit: 50, Cursor: cursor})
	for _, repo := range result.Repos {
		fmt.Println(repo.RepoID)
	}
	if result.NextCursor == "" {
		break
	}
	cursor = result.NextCursor
}
```

## Options

**cursor** `string`

Pagination cursor from a previous response

**limit** `string`

Maximum repositories per page (default: 20, max: 100)

**q** `string`

Case-insensitive substring matched against the repository name, which each result returns as
`url`. Trimmed before matching. An empty value after trim is treated as omitted.

**ttl** `string`

Token TTL for this invocation in seconds.

## Response

**repos** `array`

List of repository info objects

**nextCursor** `string`

Cursor for the next page (absent when no more results)

**hasMore** `boolean`

Whether more repositories exist

## Repository Info

**repoId** `string`

Repository identifier

**url** `string`

Repository name, for example `team/project`.

**defaultBranch** `string`

Default branch name

**createdAt** `string`

ISO 8601 creation timestamp

**baseRepo** `string`

Git Sync configuration (provider, owner, name)


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