# Org

Manage salesforce orgs in sfp server

* [`sfp server org delete`](#sfp-server-org-delete)
* [`sfp server org get-default-devhub`](#sfp-server-org-get-default-devhub)
* [`sfp server org list`](#sfp-server-org-list)
* [`sfp server org login`](#sfp-server-org-login)
* [`sfp server org register`](#sfp-server-org-register)
* [`sfp server org register-sandbox`](#sfp-server-org-register-sandbox)
* [`sfp server org update`](#sfp-server-org-update)

## `sfp server org delete`

This command allows a sfp server administrator to delete a registered salesforce org in the sfp server

```
USAGE
  $ sfp server org delete -u <value> [--json] [--repository <value>] [-e <value>] [-t <value>] [--sfp-server-url
    <value>] [-g <value>...] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

FLAGS
  -e, --email=<value>               [env: SFP_SERVER_USER] Email address for authenticated user. Ignored if
                                    --application-token is provided.
  -g, --logsgroupsymbol=<value>...  Symbol used by CICD platform to group/collapse logs in the console. Provide an
                                    opening group, and an optional closing group symbol.
  -t, --application-token=<value>   [env: SFP_SERVER_TOKEN] Application token for CI/CD authentication. Takes precedence
                                    over --email.
  -u, --username=<value>            (required) The username of the org that is locally authenticated
      --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`
      --sfp-server-url=<value>      [env: SFP_SERVER_URL] URL of the SFP server. Can be set via environment variable
                                    `SFP_SERVER_URL` or config: sfp config:set server-url

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  This command allows a sfp server administrator to delete a registered salesforce org  in the sfp server

EXAMPLES
  $ sfp server org delete --username test@example.com --email admin@example.com
```

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

## `sfp server org get-default-devhub`

Get the default DevHub from the server with authentication details

```
USAGE
  $ sfp server org get-default-devhub [--json] [--repository <value>] [-e <value>] [-t <value>] [--sfp-server-url <value>] [-g
    <value>...] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

FLAGS
  -e, --email=<value>               [env: SFP_SERVER_USER] Email address for authenticated user. Ignored if
                                    --application-token is provided.
  -g, --logsgroupsymbol=<value>...  Symbol used by CICD platform to group/collapse logs in the console. Provide an
                                    opening group, and an optional closing group symbol.
  -t, --application-token=<value>   [env: SFP_SERVER_TOKEN] Application token for CI/CD authentication. Takes precedence
                                    over --email.
      --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`
      --sfp-server-url=<value>      [env: SFP_SERVER_URL] URL of the SFP server. Can be set via environment variable
                                    `SFP_SERVER_URL` or config: sfp config:set server-url

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Get the default DevHub from the server with authentication details

EXAMPLES
  $ sfp server org get-default-devhub --email admin@example.com

  $ sfp server org get-default-devhub --email admin@example.com --json
```

*See code:* [*src/commands/server/org/get-default-devhub.ts*](https://source.flxbl.io/flxbl/sfp-pro)

## `sfp server org list`

This command allows a sfp server administrator to list all the salesforce orgs registerd in sfp server

```
USAGE
  $ sfp server org list [--json] [--repository <value>] [-e <value>] [-t <value>] [--sfp-server-url <value>] [-g
    <value>...] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] [--type <value>]
    [--devhub] [--metadata <value>]

FLAGS
  -e, --email=<value>               [env: SFP_SERVER_USER] Email address for authenticated user. Ignored if
                                    --application-token is provided.
  -g, --logsgroupsymbol=<value>...  Symbol used by CICD platform to group/collapse logs in the console. Provide an
                                    opening group, and an optional closing group symbol.
  -t, --application-token=<value>   [env: SFP_SERVER_TOKEN] Application token for CI/CD authentication. Takes precedence
                                    over --email.
      --devhub                      Filter to show only DevHub organizations
      --loglevel=<option>           [default: info] logging level for this command invocation
                                    <options: trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL>
      --metadata=<value>            Filter by metadata key-value pairs. Format: key1=value1,key2=value2 or JSON object
      --repository=<value>          The repository identifier. E.g `owner/repo`
      --sfp-server-url=<value>      [env: SFP_SERVER_URL] URL of the SFP server. Can be set via environment variable
                                    `SFP_SERVER_URL` or config: sfp config:set server-url
      --type=<value>                Filter organizations by type (e.g., "Developer Edition", "Production", "Sandbox")

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  This command allows a sfp server administrator to list all the salesforce orgs registerd in sfp server

EXAMPLES
  $ sfp server org list --email admin@example.com

  $ sfp server org list --email admin@example.com --type Sandbox

  $ sfp server org list --email admin@example.com --type Production

  $ sfp server org list --email admin@example.com --devhub

  $ sfp server org list --email admin@example.com --metadata environment=prod
```

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

## `sfp server org login`

Authenticate to a Salesforce org registered in sfp server. This command fetches the org's authentication details from the server and creates a local authentication for use with Salesforce CLI commands.

```
USAGE
  $ sfp server org login [--json] [--repository <value>] [-e <value>] [-t <value>] [--sfp-server-url <value>] [-g
    <value>...] [--loglevel trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL] [-u <value> |
    --default-devhub] [-a <value>] [-d]

FLAGS
  -a, --alias=<value>               Alias for the authenticated org (defaults to the org's username if not specified)
  -d, --set-default-dev-hub         Set the authenticated org as the default Dev Hub for all DevHub-related commands
                                    (only works if the org is a DevHub)
  -e, --email=<value>               [env: SFP_SERVER_USER] Email address for authenticated user. Ignored if
                                    --application-token is provided.
  -g, --logsgroupsymbol=<value>...  Symbol used by CICD platform to group/collapse logs in the console. Provide an
                                    opening group, and an optional closing group symbol.
  -t, --application-token=<value>   [env: SFP_SERVER_TOKEN] Application token for CI/CD authentication. Takes precedence
                                    over --email.
  -u, --username=<value>            Username of the registered org to authenticate to
      --default-devhub              Authenticate to the default DevHub org configured in sfp server
      --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`
      --sfp-server-url=<value>      [env: SFP_SERVER_URL] URL of the SFP server. Can be set via environment variable
                                    `SFP_SERVER_URL` or config: sfp config:set server-url

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Authenticate to a Salesforce org registered in sfp server. This command fetches the org's authentication details from
  the server and creates a local authentication for use with Salesforce CLI commands.

  You must specify either --username to authenticate to a specific org, or --default-devhub to authenticate to the
  default DevHub.

  The command will:
  1. Fetch the org's authentication details from the sfp server
  2. Authenticate locally using the org's credentials
  3. Set an alias for the authenticated org
  4. Optionally set it as the default DevHub (if the org is a DevHub)
  5. Verify the connection by querying org details

EXAMPLES
  $ sfp server org login --default-devhub --email admin@example.com

  $ sfp server org login --username user@example.com --email admin@example.com

  $ sfp server org login --default-devhub --alias mydevhub --email admin@example.com

  $ sfp server org login --username user@example.com --alias myorg --set-default-dev-hub --email admin@example.com
```

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

## `sfp server org register`

This command allows a sfp server administrator to register a locally authenticated (web login) salesforce to the sfp server

```
USAGE
  $ sfp server org register -u <value> [--json] [--repository <value>] [-e <value>] [-t <value>] [--sfp-server-url
    <value>] [--devhub] [--default] [--metadata <value>...] [-g <value>...] [--loglevel
    trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

FLAGS
  -e, --email=<value>               [env: SFP_SERVER_USER] Email address for authenticated user. Ignored if
                                    --application-token is provided.
  -g, --logsgroupsymbol=<value>...  Symbol used by CICD platform to group/collapse logs in the console. Provide an
                                    opening group, and an optional closing group symbol.
  -t, --application-token=<value>   [env: SFP_SERVER_TOKEN] Application token for CI/CD authentication. Takes precedence
                                    over --email.
  -u, --targetusername=<value>      (required) The username of the org that is locally authenticated
      --default                     Mark this as the default DevHub (only one org can have this set)
      --devhub                      Mark this org as a DevHub
      --loglevel=<option>           [default: info] logging level for this command invocation
                                    <options: trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL>
      --metadata=<value>...         Additional metadata as key=value pairs (comma separated) or JSON
      --repository=<value>          The repository identifier. E.g `owner/repo`
      --sfp-server-url=<value>      [env: SFP_SERVER_URL] URL of the SFP server. Can be set via environment variable
                                    `SFP_SERVER_URL` or config: sfp config:set server-url

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  This command allows a sfp server administrator to register a locally authenticated (web login) salesforce to the sfp
  server

EXAMPLES
  $ sfp server org register --targetusername myorg@example.com --email admin@example.com
```

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

## `sfp server org register-sandbox`

Register a Salesforce sandbox with the sfp server using credentials from an already registered production org

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

FLAGS
  -e, --email=<value>               [env: SFP_SERVER_USER] Email address for authenticated user. Ignored if
                                    --application-token is provided.
  -g, --logsgroupsymbol=<value>...  Symbol used by CICD platform to group/collapse logs in the console. Provide an
                                    opening group, and an optional closing group symbol.
  -p, --productionusername=<value>  (required) The username of the production org (must be already registered with the
                                    server)
  -s, --sandboxname=<value>         (required) The name of the sandbox to register
  -t, --application-token=<value>   [env: SFP_SERVER_TOKEN] Application token for CI/CD authentication. Takes precedence
                                    over --email.
      --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`
      --sfp-server-url=<value>      [env: SFP_SERVER_URL] URL of the SFP server. Can be set via environment variable
                                    `SFP_SERVER_URL` or config: sfp config:set server-url

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Register a Salesforce sandbox with the sfp server using credentials from an already registered production org

EXAMPLES
  $ sfp server org register-sandbox --sandboxname dev1 --productionusername prod@example.com --email admin@example.com
```

*See code:* [*src/commands/server/org/register-sandbox.ts*](https://source.flxbl.io/flxbl/sfp-pro)

## `sfp server org update`

Update a Salesforce org registration with DevHub status, default flag, or metadata

```
USAGE
  $ sfp server org update -u <value> [--json] [--repository <value>] [-e <value>] [-t <value>] [--sfp-server-url
    <value>] [--devhub] [--default] [--metadata <value>...] [--replace-metadata] [-g <value>...] [--loglevel
    trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL]

FLAGS
  -e, --email=<value>               [env: SFP_SERVER_USER] Email address for authenticated user. Ignored if
                                    --application-token is provided.
  -g, --logsgroupsymbol=<value>...  Symbol used by CICD platform to group/collapse logs in the console. Provide an
                                    opening group, and an optional closing group symbol.
  -t, --application-token=<value>   [env: SFP_SERVER_TOKEN] Application token for CI/CD authentication. Takes precedence
                                    over --email.
  -u, --targetusername=<value>      (required) Username of the Salesforce org to update
      --[no-]default                Mark this as the default DevHub
      --[no-]devhub                 Mark this org as a DevHub
      --loglevel=<option>           [default: info] logging level for this command invocation
                                    <options: trace|debug|info|warn|error|fatal|TRACE|DEBUG|INFO|WARN|ERROR|FATAL>
      --metadata=<value>...         Metadata to update as key=value pairs or JSON (merged by default)
      --replace-metadata            Replace metadata instead of merging
      --repository=<value>          The repository identifier. E.g `owner/repo`
      --sfp-server-url=<value>      [env: SFP_SERVER_URL] URL of the SFP server. Can be set via environment variable
                                    `SFP_SERVER_URL` or config: sfp config:set server-url

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Update a Salesforce org registration with DevHub status, default flag, or metadata

EXAMPLES
  $ sfp server org update --targetusername myorg@example.com --devhub --default

  $ sfp server org update --targetusername myorg@example.com --metadata environment=staging --metadata region=eu

  $ sfp server org update --targetusername myorg@example.com --metadata '{"team":"platform","tier":"premium"}' --replace-metadata
```

*See code:* [*src/commands/server/org/update.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-v50-and-below/server/org.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.
