# Artifacts

Build, publish, and query deployment artifacts

* [`sfp artifacts fetch`](#sfp-artifacts-fetch)
* [`sfp artifacts list`](#sfp-artifacts-list)
* [`sfp artifacts promote`](#sfp-artifacts-promote)

## `sfp artifacts fetch`

Fetch artifacts from a registry based on a release definition. When sfp server is configured, artifacts are fetched from sfp server. Use --npm to enable fallback to external npm registries.

```
USAGE
  $ sfp artifacts fetch -d <value> [--json] [--repository <value>] [-e <value>] [-t <value>] [--sfp-server-url
    <value>] [-a <value> | -p <value>] [--scope <value>] [--npmrcpath <value> [--npm | -f <value>]]
    [--continue-on-error] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

FLAGS
  -a, --artifacts=<value>          Comma-separated list of artifacts to fetch (format: name:version). Use LATEST_TAG for
                                   latest version
  -d, --artifactdir=<value>        (required) [default: artifacts] Directory to download artifacts into
  -e, --email=<value>              Email address for authenticated user. Ignored if --application-token is provided. Can
                                   be set via SFP_SERVER_USER env var.
  -f, --scriptpath=<value>         (Optional: no-NPM) Path to script that authenticates and downloads artifacts from the
                                   registry
  -p, --releasedefinition=<value>  Path to release definition file
  -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).
      --continue-on-error          Continue processing other artifacts even if some fail to fetch
      --loglevel=<option>          [default: info] logging level for this command invocation
                                   <options: trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL>
      --npm                        Enable fallback to external npm registry if artifact is not found in sfp server
      --npmrcpath=<value>          Path to .npmrc file used for authentication to registry. If --sfp-server-url is
                                   provided, npmrc will be fetched from the server instead. If left blank, defaults to
                                   home directory
      --repository=<value>         The repository identifier. E.g `owner/repo` for GitHub/GitLab or `org/project/repo`
                                   for Azure DevOps
      --scope=<value>              (required for NPM) User or Organisation scope of the NPM package
      --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
  Fetch artifacts from a registry based on a release definition. When sfp server is configured, artifacts are fetched
  from sfp server. Use --npm to enable fallback to external npm registries.

EXAMPLES
  $ sfp artifacts:fetch -p myreleasedefinition.yaml -f myscript.sh

  $ sfp artifacts:fetch -p myreleasedefinition.yaml --npm --scope myscope --npmrcpath path/to/.npmrc

  $ sfp artifacts:fetch -p myreleasedefinition.yaml --npm --scope myscope --sfp-server-url http://localhost:3029

  $ sfp artifacts:fetch --artifacts package1:1.0.0,package2:LATEST_TAG --npm --scope myscope
```

*See code:* [*src/commands/artifacts/fetch.ts*](https://source.flxbl.io/flxbl/sfp-pro)

## `sfp artifacts list`

List available versions of artifacts in the registry. When sfp server is configured, lists versions from sfp server.

```
USAGE
  $ sfp artifacts list -p <value> [--json] [--repository <value>] [-e <value>] [-t <value>] [--sfp-server-url
    <value>] [-s <value>] [--npmrcpath <value>] [--loglevel
    trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

FLAGS
  -e, --email=<value>              Email address for authenticated user. Ignored if --application-token is provided. Can
                                   be set via SFP_SERVER_USER env var.
  -p, --package=<value>            (required) Name of the package to list versions for (without _sfpowerscripts_artifact
                                   suffix)
  -s, --scope=<value>              NPM scope for scoped packages (e.g., 'flxbl-io' for @flxbl-io/...)
  -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).
      --loglevel=<option>          [default: info] logging level for this command invocation
                                   <options: trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL>
      --npmrcpath=<value>          Path to .npmrc file for npm registry authentication. If --sfp-server-url is provided
                                   and this flag is not set, npmrc will be fetched from the server instead.
      --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
  List available versions of artifacts in the registry. When sfp server is configured, lists versions from sfp server.

EXAMPLES
  $ sfp artifacts:list --package sf-core --scope flxbl-io --npmrcpath ~/.npmrc

  $ sfp artifacts:list --package sf-core --scope flxbl-io --sfp-server-url http://localhost:3029

  $ sfp artifacts:list -p sf-core -s flxbl-io --sfp-server-url http://localhost:3029 --repository flxbl-io/sf-core --json
```

*See code:* [*src/commands/artifacts/list.ts*](https://source.flxbl.io/flxbl/sfp-pro)

## `sfp artifacts promote`

Promotes artifacts predominantly for unlocked packages with code coverage greater than 75%

```
USAGE
  $ sfp artifacts promote -v <value> -d <value> [--json] [--repository <value>] [-e <value>] [-t <value>]
    [--sfp-server-url <value>] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

FLAGS
  -d, --artifactdir=<value>           (required) [default: artifacts] The directory where artifacts are located
  -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).
  -v, --targetdevhubusername=<value>  (required) Username or alias of the Dev Hub org.
      --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
  Promotes artifacts predominantly for unlocked packages with code coverage greater than 75%

EXAMPLES
  $ sfp artifacts promote -d path/to/artifacts -v <org>

  $ sfp artifacts promote -d path/to/artifacts -v <org> --sfp-server-url https://sfp.example.com --email user@example.com
```

*See code:* [*src/commands/artifacts/promote.ts*](https://source.flxbl.io/flxbl/sfp-pro)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flxbl.io/flxbl/sfp/cli-reference-v51-release-v3/advanced/artifacts.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
