# login

## Usage

```
ionosctl config login [flags]
```

## Aliases

For `config` command:

```
[cfg]
```

## Description

Generate a YAML file aggregating all product endpoint information at 'ionosctl cfg location' using the public OpenAPI index.

If using '--example', this command prints the config to stdout without any authentication step.

You can filter by version (--filter-version), whitelist (--whitelist) or blacklist (--blacklist) specific APIs, and customize the names of the APIs in the config file using --custom-names.

There are three ways you can authenticate with the IONOS CLOUD APIs:

1. Interactive mode: Prompts for username and password, and generates a token that will be saved in the config file.
2. Use the '--user' and '--password' flags: Used to generate a token that will be saved in the config file.
3. Use the '--token' flag: Provide an authentication token. Notes:

* If using '--example', the authentication step is skipped

## Options

```
  -u, --api-url string                Override default host URL. Preferred over the config file override 'auth' and env var 'IONOS_API_URL' (default "https://api.ionos.com/auth/v1")
      --blacklist strings             Comma-separated list of API names or name:version pairs to exclude (e.g. postgresql:v1) (default [object-storage-user-owned-buckets,object-storage-contract-owned-buckets,identity-federation,identity-provider,identity-policy,inference-modelhub,inference-openai,quota,reseller,tagging])
  -c, --config string                 Configuration file used for authentication (default "$XDG_CONFIG_HOME/ionosctl/config.yaml")
      --custom-names stringToString   Define custom names for each spec (default <Overriden with sdk-go-bundle product names: [authentication=auth, certificatemanager=cert, cloud=compute, object‑storage=objectstorage, object‑storage‑management=objectstoragemanagement, mongodb=mongo, postgresql=psql]>)
  -D, --depth int                     Level of detail for response objects (default 1)
      --environment string            Environment to use (default "prod")
      --example                       Print an example YAML config file to stdout and skip authentication step
      --filter-version string         Filter by major spec version (e.g. v1)
  -F, --filters strings               Limit results to results containing the specified filter:KEY1=VALUE1,KEY2=VALUE2
  -f, --force                         Force command to execute without user input
  -h, --help                          Print usage
      --limit int                     Maximum number of items to return per request (default 50)
      --no-headers                    Don't print table headers when table output is used
      --offset int                    Number of items to skip before starting to collect the results
      --order-by string               Property to order the results by
  -o, --output string                 Desired output format [text|json|api-json] (default "text")
  -p, --password string               Password to authenticate with. Will be used to generate a token
      --profile-name string           Name of the profile to use (default "user")
      --query string                  JMESPath query string to filter the output
  -q, --quiet                         Quiet output
      --skip-verify                   Forcefully write the provided token to the config file without verifying if it is valid. Note: --token is required
  -t, --timeout int                   Timeout in seconds for --wait and other wait operations (default 600)
      --token string                  Token to authenticate with. If used, will be saved directly to the config file. Note: mutually exclusive with --user and --password
      --user string                   Username to authenticate with. Will be used to generate a token
  -v, --verbose count                 Increase verbosity level [-v, -vv, -vvv]
      --version float                 Version of the config file to use (default 1)
  -w, --wait                          Wait for the resource to reach AVAILABLE state after the command completes. No-op for list commands
      --whitelist strings             Comma-separated list of API names or name:version pairs to include (e.g. vpn,postgresql:v2)
```

## Examples

```

# Print an example YAML configuration file to stdout
ionosctl config login --example

# Login interactively, and generate a YAML config file with filters, to 'ionosctl config location'
ionosctl endpoints generate --filter-version=v1 \
  --whitelist=vpn,psql --blacklist=billing

# Specify a token, a config version, a custom profile name, and a custom environment
ionosctl config login --token $IONOS_TOKEN \
  --version=1.1 --profile-name=my-custom-profile --environment=dev

```


---

# 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.ionos.com/cli-ionosctl/subcommands/cli-setup/login.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.
