<commit_before># WP-CLI Login Command

Login to WordPress with secure passwordless links.

[![Build Status](https://travis-ci.org/aaemnnosttv/wp-cli-login-command.svg?branch=master)](https://travis-ci.org/aaemnnosttv/wp-cli-login-command)
[![Packagist](https://img.shields.io/packagist/v/aaemnnosttv/wp-cli-login-command.svg)](https://packagist.org/packages/aaemnnosttv/wp-cli-login-command)

Quick links: [Using](#using) | [Installation](#installation) | [Contributing](#contributing)

## Using

```
NAME

  wp login

DESCRIPTION

  Manage magic passwordless sign-in.

SYNOPSIS

  wp login <command>

SUBCOMMANDS

  create          Create a magic sign-in link for the given user.
  email           Email a magic sign-in link to the given user.
  install         Install/update the companion server plugin.
  invalidate      Invalidate any existing magic links.
  toggle          Toggle the active state of the companion server plugin.

```

### `create` / `as`

```
wp login create <user> [options]
```
or alternatively use the alias
```
wp login as <user> [options]
```

Create a magic sign-in link for the given user.  Outputs the created URL with some extra information for the user regarding usage and expiration.  URLs expire 15 minutes after creation ([configurable](#--expiresseconds)), or at the time of use, whichever comes first.

> `<user>` can be passed as an User ID, username/login or email address. This is the same for all `login` commands which accept this as a parameter.

#### `--expires=<seconds>`

Set the lifetime of the magic link in seconds.

    10 minutes = 600  
    1 hour     = 3600  
    1 day      = 86400

Default: `900` (15 minutes)

#### `--redirect-url=<url>`

Set the URL to redirect to upon successfully logging in. Defaults to `admin_url()`.

> Note: The redirect is executed using [`wp_safe_redirect`](https://developer.wordpress.org/reference/functions/wp_safe_redirect/) which restricts the destination URL using a list of allowed hosts. By default, this is limited to the domain of the site, but can be extended using the [`allowed_redirect_hosts`](https://developer.wordpress.org/reference/hooks/allowed_redirect_hosts/) filter.

#### `--url-only`<commit_msg>update badge on readme<commit_after># WP-CLI Login Command

Login to WordPress with secure passwordless links.

[![Test](https://github.com/aaemnnosttv/wp-cli-login-command/actions/workflows/test.yml/badge.svg)](https://github.com/aaemnnosttv/wp-cli-login-command/actions/workflows/test.yml)
[![Packagist](https://img.shields.io/packagist/v/aaemnnosttv/wp-cli-login-command.svg)](https://packagist.org/packages/aaemnnosttv/wp-cli-login-command)

Quick links: [Using](#using) | [Installation](#installation) | [Contributing](#contributing)

## Using

```
NAME

  wp login

DESCRIPTION

  Manage magic passwordless sign-in.

SYNOPSIS

  wp login <command>

SUBCOMMANDS

  create          Create a magic sign-in link for the given user.
  email           Email a magic sign-in link to the given user.
  install         Install/update the companion server plugin.
  invalidate      Invalidate any existing magic links.
  toggle          Toggle the active state of the companion server plugin.

```

### `create` / `as`

```
wp login create <user> [options]
```
or alternatively use the alias
```
wp login as <user> [options]
```

Create a magic sign-in link for the given user.  Outputs the created URL with some extra information for the user regarding usage and expiration.  URLs expire 15 minutes after creation ([configurable](#--expiresseconds)), or at the time of use, whichever comes first.

> `<user>` can be passed as an User ID, username/login or email address. This is the same for all `login` commands which accept this as a parameter.

#### `--expires=<seconds>`

Set the lifetime of the magic link in seconds.

    10 minutes = 600
    1 hour     = 3600
    1 day      = 86400

Default: `900` (15 minutes)

#### `--redirect-url=<url>`

Set the URL to redirect to upon successfully logging in. Defaults to `admin_url()`.

> Note: The redirect is executed using [`wp_safe_redirect`](https://developer.wordpress.org/reference/functions/wp_safe_redirect/) which restricts the destination URL using a list of allowed hosts. By default, this is limited to the domain of the site, but can be extended using the [`allowed_redirect_hosts`](https://developer.wordpress.org/reference/hooks/allowed_redirect_hosts/) filter.

#### `--url-only`
{'fraction_non_alphanumeric': 0.11141120864280891, 'fraction_numerical': 0.010353364843574162, 'mean_word_length': 3.894273127753304, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6375844', 'n_tokens_mistral': 1388, 'n_tokens_neox': 1294, 'n_words': 467}