signaloid-cli repos lookup
Check whether a repository is already connected for the current account by specifying the remote URL and branch.
Synopsis
signaloid-cli repos lookup --url <gitUrl> --branch <name> [--format <table|json>]
Options
| Option | Required | Default | Description |
|---|---|---|---|
--url <gitUrl> | Yes | Remote repository URL | |
--branch <name> | Yes | Branch name | |
--format <type> | No | json | Output format: table | json |
Description
Checks whether a GitHub repository at the given URL and branch is already connected to your Signaloid account. Outputs the RepositoryID for a connected repository, or null (JSON) / Not found (table) if the repository is not connected.
Examples
Check if a repository is connected:
signaloid-cli repos lookup \
--url https://github.com/signaloid/Signaloid-Demo-C-Template \
--branch main
Output as table:
signaloid-cli repos lookup \
--url https://github.com/user/project \
--branch develop \
--format table
Use in a script to connect only if not already connected:
REPO_ID=$(signaloid-cli repos lookup \
--url https://github.com/user/project \
--branch main | jq -r '.')
if [ "$REPO_ID" = "null" ]; then
echo "Repository not connected, connecting now..."
REPO_ID=$(signaloid-cli repos connect \
--url https://github.com/user/project \
--branch main | jq -r '.RepositoryID')
fi
echo "Using repository: $REPO_ID"
See Also
- signaloid-cli repos - Repositories overview
- signaloid-cli repos connect - Connect a repository
- signaloid-cli repos list - List connected repositories