# Login to Sandbox

### Usage

```sh-session
$ sfp sandbox:login -n <string> [flags]
$ sfp org:login:sandbox -n <string> [flags]
```

### Flags

| Flag                                 | Required | Description                                          |
| ------------------------------------ | -------- | ---------------------------------------------------- |
| `-v, --targetdevhubusername=<value>` | No       | Username or alias of the production org              |
| `-n, --name=<value>`                 | Yes      | Name of the sandbox to log in to (max 10 characters) |
| `-a, --alias=<value>`                | No       | Alias to set for the authenticated sandbox org       |
| `-w, --write-file`                   | No       | Write login details to a file (org-info.json)        |
| `--json`                             | No       | Format output as JSON                                |
| `--loglevel=<option>`                | No       | Logging level for this command invocation            |

### Examples

```sh-session
$ sfp sandbox:login --name mySandbox1 -v myDevHub
$ sfp sandbox:login --name mySandbox1 -v myDevHub --alias mySandboxAlias --write-file
```


---

# 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/environment-management/sandbox/login-to-sandbox.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.
