PHPackages                             aaemnnosttv/wp-cli-login-command - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. aaemnnosttv/wp-cli-login-command

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

aaemnnosttv/wp-cli-login-command
================================

Log in to WordPress with secure passwordless magic links.

v1.5.0(2y ago)321276.2k—2.3%51[4 issues](https://github.com/aaemnnosttv/wp-cli-login-command/issues)[3 PRs](https://github.com/aaemnnosttv/wp-cli-login-command/pulls)MITPHPPHP ^5.6 || ^7.0 || ^8.0

Since Aug 31Pushed 1y ago11 watchersCompare

[ Source](https://github.com/aaemnnosttv/wp-cli-login-command)[ Packagist](https://packagist.org/packages/aaemnnosttv/wp-cli-login-command)[ Docs](https://github.com/aaemnnosttv/wp-cli-login-command)[ RSS](/packages/aaemnnosttv-wp-cli-login-command/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (6)Versions (8)Used By (0)

WP-CLI Login Command
====================

[](#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://camo.githubusercontent.com/a7f8368676cf841bf18990fef2a66ac168cb2d888004b23ac326e5f36d7fa2c6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6161656d6e6e6f737474762f77702d636c692d6c6f67696e2d636f6d6d616e642e737667)](https://packagist.org/packages/aaemnnosttv/wp-cli-login-command)

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

Using
-----

[](#using)

```
NAME

  wp login

DESCRIPTION

  Manage magic passwordless sign-in.

SYNOPSIS

  wp login

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`

[](#create--as)

```
wp login create  [options]

```

or alternatively use the alias

```
wp login as  [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.

> `` 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=`

[](#--expiresseconds)

Set the lifetime of the magic link in seconds.

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

```

Default: `900` (15 minutes)

#### `--redirect-url=`

[](#--redirect-urlurl)

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`

[](#--url-only)

Outputs the created sign-in URL only. Great for scripting, piping to your clipboard, or anything else you can think of.

#### `--launch`

[](#--launch)

Launches the sign-in link your default browser immediately after creation. This is the fastest possible way to login.

### `email`

[](#email)

```
wp login email  [options]

```

Email a magic sign-in link to the given user. Sends a nice HTML email to the user's email address containing their freshly created magic sign-in link. Planning to add support for both HTML and plain text emails in the future.

#### `--expires=`

[](#--expiresseconds-1)

[See above.](#--expiresseconds)

#### `--redirect-url=`

[](#--redirect-urlurl-1)

[See above.](#--redirect-urlurl)

#### `--subject=`

[](#--subjectemail-subject)

Optionally override the default email subject with your own custom string. You may use the `{{ domain }}` placeholder.

Default: Magic log-in link for {{domain}}

#### `--template=`

[](#--templatepath-to-custom-template)

Optionally override the default email template with your own by providing the path to a different template file to use. The email template is compiled using the Mustache template engine, so you may use the `{{ magic_url }}` and `{{ domain }}` placeholders in your custom template. The default template can be found in this repository under `template/email-default.mustache`.

### `install`

[](#install)

```
wp login install [options]

```

Install/update the companion server plugin. Installing the companion plugin is required before magic links will work on the host. The `login` command is aware of the installed version of the plugin, and will inform you if it needs to be installed, activated or upgraded. If the plugin is already installed, you will be prompted to overwrite it.

#### `--activate`

[](#--activate)

Optionally activate the plugin immediately after installation.

#### `--mu`

[](#--mu)

Install as a Must Use plugin.

#### `--yes`

[](#--yes)

Suppress prompting for confirmation to overwrite the existing plugin.

> Using a Composer-based WordPress install? You can require the companion plugin using the package `aaemnnosttv/wp-cli-login-server`.

### `invalidate`

[](#invalidate)

```
wp login invalidate

```

Invalidate any existing magic sign-in links. Any previously created links will most likely go to a 404 page.

### `toggle`

[](#toggle)

```
wp login toggle []

```

Toggles the active status of the companion plugin. Optionally pass `on` or `off` to set the activation accordingly. Without it, the status is simply inverted.

Installation
------------

[](#installation)

Installing this package requires WP-CLI v0.23.0 or greater. Update to the latest stable release with `wp cli update`.

Once you've done so, you can install this package with `wp package install aaemnnosttv/wp-cli-login-command`.

Contributing
------------

[](#contributing)

We appreciate you taking the initiative to contribute to this project.

Contributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.

### Reporting a bug

[](#reporting-a-bug)

Think you’ve found a bug? We’d love for you to help us get it fixed.

Before you create a new issue, you should [search existing issues](https://github.com/aaemnnosttv/wp-cli-login-command/issues?q=label%3Abug%20) to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.

Once you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please [create a new issue](https://github.com/aaemnnosttv/wp-cli-login-command/issues/new) with the following:

1. What you were doing (e.g. "When I run `wp post list`").
2. What you saw (e.g. "I see a fatal about a class being undefined.").
3. What you expected to see (e.g. "I expected to see the list of posts.")

Include as much detail as you can, and clear steps to reproduce if possible.

### Creating a pull request

[](#creating-a-pull-request)

Want to contribute a new feature? Please first [open a new issue](https://github.com/aaemnnosttv/wp-cli-login-command/issues/new) to discuss whether the feature is a good fit for the project.

Once you've decided to commit the time to seeing your pull request through, please follow our guidelines for creating a pull request to make sure it's a pleasant experience:

1. Create a feature branch for each contribution.
2. Submit your pull request early for feedback.
3. Include functional tests with your changes. [Read the WP-CLI documentation](https://make.wordpress.org/cli/handbook/contributions/pull-requests/#running-and-writing-tests) for an introduction.
4. Follow [PSR-2 Coding Standards](http://www.php-fig.org/psr/psr-2/).

###  Health Score

48

—

FairBetter than 95% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity54

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 97.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~414 days

Recently: every ~565 days

Total

7

Last Release

1059d ago

PHP version history (3 changes)v1.0.0PHP ^5.5 || ^7.0

v1.4.0PHP ^5.6 || ^7.0

v1.4.1PHP ^5.6 || ^7.0 || ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b443f89936449a1c048fcc223ea03b285a4e9c9667ffd21c0c4b3f33e46f72c9?d=identicon)[aaemnnosttv](/maintainers/aaemnnosttv)

---

Top Contributors

[![aaemnnosttv](https://avatars.githubusercontent.com/u/1621608?v=4)](https://github.com/aaemnnosttv "aaemnnosttv (248 commits)")[![mehrshaddarzi](https://avatars.githubusercontent.com/u/949491?v=4)](https://github.com/mehrshaddarzi "mehrshaddarzi (2 commits)")[![chrillep](https://avatars.githubusercontent.com/u/1267931?v=4)](https://github.com/chrillep "chrillep (1 commits)")[![stribert](https://avatars.githubusercontent.com/u/58483?v=4)](https://github.com/stribert "stribert (1 commits)")[![thunderdw](https://avatars.githubusercontent.com/u/85177135?v=4)](https://github.com/thunderdw "thunderdw (1 commits)")[![danielbachhuber](https://avatars.githubusercontent.com/u/36432?v=4)](https://github.com/danielbachhuber "danielbachhuber (1 commits)")[![b-t-927](https://avatars.githubusercontent.com/u/1644078?v=4)](https://github.com/b-t-927 "b-t-927 (1 commits)")

---

Tags

wp-cliwp-cli-package

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/aaemnnosttv-wp-cli-login-command/health.svg)

```
[![Health](https://phpackages.com/badges/aaemnnosttv-wp-cli-login-command/health.svg)](https://phpackages.com/packages/aaemnnosttv-wp-cli-login-command)
```

###  Alternatives

[phan/phan

A static analyzer for PHP

5.6k11.2M1.1k](/packages/phan-phan)[bezhansalleh/filament-shield

Filament support for `spatie/laravel-permission`.

2.8k2.9M88](/packages/bezhansalleh-filament-shield)[gesdinet/jwt-refresh-token-bundle

Implements a refresh token system over Json Web Tokens in Symfony

70516.4M35](/packages/gesdinet-jwt-refresh-token-bundle)[illuminate/auth

The Illuminate Auth package.

9327.3M1.0k](/packages/illuminate-auth)[beatswitch/lock

A flexible, driver based Acl package for PHP 5.4+

870304.7k2](/packages/beatswitch-lock)[amocrm/amocrm-api-library

amoCRM API Client

182728.5k6](/packages/amocrm-amocrm-api-library)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
