Skip to content

Repository Management

The code-search repo commands let you manage which repositories are indexed.

CommandDescription
repo listList all indexed repositories
repo addAdd a repository to index
repo removeRemove a repository
repo syncTrigger re-sync of a repository
repo statusCheck repository status
repo excludeExclude repository from indexing
repo includeInclude previously excluded repo

View all repositories currently indexed.

Terminal window
# List all repos
code-search repo list
# Filter by connection ID
code-search repo list --connection 1
# Show detailed info
code-search repo list --verbose
OptionShortDescription
--connection-cFilter by connection ID
--verbose-vShow detailed info
$ code-search repo list
ID NAME STATUS BRANCHES
1 myorg/api ✓ indexed main
2 myorg/frontend ✓ indexed main, develop
3 myorg/services 🔄 indexing main
4 internal/docs ✓ indexed master
4 repositories

With --verbose:

$ code-search repo list --verbose
ID NAME STATUS LAST INDEXED EXCLUDED URL
1 myorg/api ✓ indexed 2024-01-15T10:30:00Z https://github.com/myorg/api.git
2 myorg/frontend ✓ indexed 2024-01-15T10:28:00Z https://github.com/myorg/frontend.git
2 repositories

Add a new repository to be indexed.

Terminal window
# Add a repository with connection ID (required)
code-search repo add https://github.com/myorg/new-service.git --connection 1
# Add with custom name
code-search repo add https://github.com/myorg/repo.git --connection 1 --name custom-name
# Add with specific branch
code-search repo add https://github.com/myorg/repo.git --connection 1 --branch develop
Terminal window
code-search repo add <clone-url> [flags]
OptionDescription
--connectionConnection ID (required)
--nameCustom name for the repository
--branchDefault branch (default: main)
Terminal window
# Add a GitHub repository
code-search repo add https://github.com/company/platform.git --connection 1
# Add with custom name and branch
code-search repo add https://gitlab.example.com/internal/tools.git \
--connection 2 --name internal-tools --branch master

Remove a repository from the index.

Terminal window
# Remove a repo by ID (will prompt for confirmation)
code-search repo remove 3
# Remove without confirmation
code-search repo remove 3 --force
OptionDescription
--forceSkip confirmation prompt

Trigger a re-sync and re-index of a repository.

Terminal window
# Sync a specific repo by ID
code-search repo sync 1
# Sync all repos
code-search repo sync --all
Terminal window
code-search repo sync [id] [flags]
OptionDescription
--allSync all repositories
Terminal window
# Sync a specific repo
code-search repo sync 1
# Re-sync everything
code-search repo sync --all

Get detailed status of a specific repository.

Terminal window
# Check status of a specific repo by ID
code-search repo status 1
StatusIndicatorDescription
indexedReady for search
pendingWaiting to be indexed
cloning📥Cloning repository
indexing🔄Building search index
failedIndexing failed
$ code-search repo status 1
ID: 1
Name: myorg/api
Status: ✓ indexed
URL: https://github.com/myorg/api.git
Branches: main, develop, feature/new-api
Indexed: 2024-01-15T10:30:00Z

Exclude a repository from sync and indexing (soft delete).

Terminal window
code-search repo exclude 3

This keeps the repository in the database but excludes it from future syncs.

Include a previously excluded repository.

Terminal window
code-search repo include 3

The repository will be included in the next sync cycle.

  • Search - Search your repositories
  • Find - Find files and symbols
  • Replace - Make bulk changes