Repo

Analyze and manage project repository

sfp repo clone

Clone a repository using authenticated credentials from the SFP server.

USAGE
  $ sfp repo clone [--json] [--repository <value>] [-e <value>] [-t <value>] [--sfp-server-url <value>] [-d
    <value>] [--depth <value>] [-b <value>] [--default-branch] [--loglevel
    trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

FLAGS
  -b, --branch=<value>             Clone a specific branch instead of the default branch.
  -d, --directory=<value>          Target directory for the cloned repository. Defaults to the repository name in the
                                   current directory.
  -e, --email=<value>              Email address for authenticated user. Ignored if --application-token is provided. Can
                                   be set via SFP_SERVER_USER env var.
  -t, --application-token=<value>  Application token for CI/CD authentication. Can be set via SFP_SERVER_TOKEN env var
                                   (CLI flags take precedence over env vars).
      --default-branch             After cloning, switch to the default branch (e.g., main or master). Useful when
                                   cloning a specific branch but wanting to end up on the default.
      --depth=<value>              Create a shallow clone with the specified number of commits. Use 0 for full history
                                   (default). Useful for faster clones when full history is not needed.
      --loglevel=<option>          [default: info] logging level for this command invocation
                                   <options: trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL>
      --repository=<value>         The repository identifier. E.g `owner/repo` for GitHub/GitLab or `org/project/repo`
                                   for Azure DevOps
      --sfp-server-url=<value>     URL of the SFP server. Can be set via SFP_SERVER_URL env var or config: sfp
                                   config:set server-url

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Clone a repository using authenticated credentials from the SFP server.

  This command fetches an authenticated clone URL from the SFP server and clones the repository. The authentication
  token is automatically embedded in the clone URL, making it suitable for CI/CD pipelines and automated workflows.

EXAMPLES
  Clone a repository:
  `sfp repo clone --repository owner/repo --application-token $SFP_SERVER_TOKEN --sfp-server-url http://localhost:3029`

  Clone with shallow depth for faster cloning:
  `sfp repo clone --repository owner/repo --depth 1 --application-token $SFP_SERVER_TOKEN`

  Clone a specific branch:
  `sfp repo clone --repository owner/repo --branch feature/my-branch --application-token $SFP_SERVER_TOKEN`

  Clone to a specific directory:
  `sfp repo clone --repository owner/repo --directory ./my-project --application-token $SFP_SERVER_TOKEN`

  Clone and switch to default branch:
  `sfp repo clone --repository owner/repo --branch release/v1.0 --default-branch --application-token $SFP_SERVER_TOKEN`

See code: src/commands/repo/clone.tsarrow-up-right

sfp repo diff

Analyze and output changed components between two git branches

See code: src/commands/repo/diff.tsarrow-up-right

sfp repo list

List all registered repositories/projects from the SFP server.

See code: src/commands/repo/list.tsarrow-up-right

sfp repo patch

Generate a dynamic branch with the packages patched to the contents as mentioned in the release config file

See code: src/commands/repo/patch.tsarrow-up-right

sfp repo visualize

Collect package visualization data from repository history.

See code: src/commands/repo/visualize.tsarrow-up-right

sfp repo workspace-tree

Build and publish a workspace metadata tree for a repository.

See code: src/commands/repo/workspace-tree.tsarrow-up-right

Last updated

Was this helpful?