Skip to content
Back to skills

Ezy Login

ASecurity

Sign in to any EzyPlatform admin or website from the terminal with EzyLogin CLI login (the user approves in the browser, OAuth code + PKCE, no password in the terminal or chat), keep the token in ~/.ezyplatform/credentials.json and call the site's admin or web APIs with it (JSON calls, multipart forms, media upload). Before the first login it asks for the admin URL, checks without logging in whether the EzyLogin plugin is installed and CLI login is enabled, tells the user how to install/enabl...

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 3, 2026
ai-agentspythongobashnodeapidocumentation

Works with

  • claude code
  • terminal
  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 3 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add cppai-vn/agents-plugins --skill ezy-login --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ezy Login?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ezy Login
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/cppai-vn-ezy-login/badge)](https://www.skillsdirectory.com/skills/cppai-vn-ezy-login)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ezy-login
description: Sign in to any EzyPlatform admin or website from the terminal with EzyLogin CLI login (the user approves in the browser, OAuth code + PKCE, no password in the terminal or chat), keep the token in ~/.ezyplatform/credentials.json and call the site's admin or web APIs with it (JSON calls, multipart forms, media upload). Before the first login it asks for the admin URL, checks without logging in whether the EzyLogin plugin is installed and CLI login is enabled, tells the user how to install/enable it, or, if the user asks the AI to do everything, opens the admin settings page in a visible Chrome window, lets the user sign in there and ticks "Allow admins to sign in from the command line (CLI)" itself. Use when the user asks to log in to an EzyPlatform admin/site from the CLI, "login qua ezylogin cli", to do something on a live EzyPlatform site through its API, or when another task gets HTTP 401 / cliLogin notAllowed from an EzyPlatform API.
---

# EzyLogin CLI login for EzyPlatform sites

> Paths: `${CLAUDE_SKILL_DIR}` is this skill's folder (Claude Code substitutes it; other agents: replace it with the folder containing this SKILL.md).

Two scripts ship in `scripts/` next to this file (`$S` below means `${CLAUDE_SKILL_DIR}/scripts`):

| Script | Purpose |
|---|---|
| `ezylogin.py` (Python 3, standard library only) | `status`, `login`, `whoami`, `call`, `upload`, `logout`, `sites` |
| `enable_cli_browser.js` (Node + `playwright-core`, uses the installed Chrome/Edge) | opens `<admin>/ezylogin/settings/regular` in a visible window, waits for the user to sign in, ticks the CLI checkbox and clicks Save |

Run Python with `python3 -I "$S/ezylogin.py" <command> --base-url <url>` (use `python` on Windows if `python3` does not exist). Admin sites are detected by a host starting with `admin.` or containing `-admin.`; for any other admin host add `--admin` (and `--web` to force a web site).

## Rules

- Talk to the user in their language.
- Never ask for, print, echo, log or paste the password, the 2FA code, the token or `~/.ezyplatform/credentials.json`. The token is only sent as `Authorization: Bearer` to the same site.
- The token has the same rights as the account that approved it. Writes on a live site are outward-facing: before a create/update/delete, say exactly what will change (method, path, body) unless the user already asked for that specific change. Read first (GET) and reuse existing data.
- Do not work around a disabled CLI login (`403 {"cliLogin":"notAllowed"}`); enable it through the admin as below, with the user's consent.

## 1. Ask for the site

If the user did not give it, ask for the admin URL (for example `https://admin.example.com`; an EzyPlatform admin often runs on its own subdomain or on port 9090 for a local install). Also ask, in the same question, whether the **EzyLogin** plugin is installed and **CLI login** is enabled, and whether they want you to do the setup for them in the browser. Then check it yourself anyway, no login needed:

```bash
python3 -I "$S/ezylogin.py" status --base-url https://admin.example.com
```

It sends an empty `POST` to the token endpoints (`/ezylogin/api/v1/cli/me/token` for admin, `/ezylogin/api/v1/cli/token` for web) and reads the answer:

| Result | Meaning | Next |
|---|---|---|
| `enabled` (HTTP 400, missing fields) | EzyLogin installed, CLI login on | step 3 |
| `disabled` (HTTP 403 `cliLogin: notAllowed`) | installed, CLI login off | step 2b |
| `not-installed` (HTTP 404 JSON) | EzyPlatform site without EzyLogin, EzyLogin inactive, or an EzyLogin version without CLI login | step 2a |
| `not-ezyplatform` / `unreachable` | wrong URL, not EzyPlatform, or blocked | ask the user to check the URL |

Then `whoami`: if a saved token still works, skip to step 4.

```bash
python3 -I "$S/ezylogin.py" whoami --base-url https://admin.example.com
```

## 2a. EzyLogin not installed

Tell the user to install it (you cannot install plugins through the API):

1. Sign in to the admin, open **Modules** > **Add Modules** (`<admin>/modules/add`), search **EzyLogin**, install it (admin plugin and web plugin), and activate it if it is not active.
2. If it is installed but old, update it to the latest version from **Modules**.
3. Then enable CLI login (step 2b).

If the user asks you to do it, open `<admin>/modules/add` in the browser for them (step 2c, same browser rules), let them sign in, and follow the on-screen install flow; ask them before clicking anything that buys or uninstalls something. Run `status` again afterwards.

## 2b. CLI login disabled

Explain where the switch is and let the user choose:

- **They do it**: Admin > **EzyLogin** > **Regular settings** (`<admin>/ezylogin/settings/regular`), tick **Allow admins to sign in from the command line (CLI)** (`allowAdminCliLogin`; for a web site login tick **Allow users to sign in from the command line (CLI)**, `allowUserCliLogin`), click **Save**.
- **You do it** (only when the user asks you to do everything): step 2c.

Run `status` again until it says `enabled`.

## 2c. Enable it in the browser for the user

Say what will happen first: a Chrome window opens on the EzyLogin settings page; the user signs in there themselves (password and 2FA stay in the browser, you never see them); then you tick only the CLI login checkbox and click Save; the window closes and its temporary profile is deleted.

If you have your own browser tool (Claude in Chrome, a built-in browser, computer use), you may use it instead: open `<admin>/ezylogin/settings/regular`, ask the user to sign in in that window, then tick `#allowAdminCliLogin` (or `#allowUserCliLogin`) and click `#saveLoginRegularSettingsButton`. Change nothing else on the page.

Otherwise use the script (needs Node 18+ and Chrome or Edge; set `CHROME_PATH` if the browser is in an unusual place):

```bash
W=<a temp work folder> && mkdir -p "$W" && cd "$W"
npm init -y >/dev/null && npm i playwright-core --silent
node "$S/enable_cli_browser.js" --base-url https://admin.example.com --target admin   # or user / both
```

Run it in the background and tell the user to sign in in the window that opened; the page shows a banner at the bottom while it waits (10 minutes by default, `--timeout <seconds>`). Output: `ENABLED ...`, `ALREADY_ENABLED ...`, or `ERROR ...` (settings page not found = EzyLogin missing or the admin has no permission for EzyLogin settings). Delete the work folder afterwards, then run `status` again.

## 3. Log in

Before the first login on a site, tell the user in plain words, then run `login` after their go-ahead (in the background; it waits up to 10 minutes):

- The browser opens `<site>/ezylogin/cli/authorize`. They sign in there as usual (including 2FA) if needed.
- Clicking **Approve** gives a token with the **same rights as their account** on that site. Approve only if they ran it just now, the tool name is `ezylogin-cli` and the result address is `http://127.0.0.1:<port>/callback` with the port printed in the terminal; otherwise **Cancel**.
- The token is stored in `~/.ezyplatform/credentials.json` (mode 600, keyed by site URL). There is no refresh token: when it expires, log in again. `logout` deletes the local copy; if it may have leaked, sign out that session in the admin (login sessions list) or change the password.

```bash
python3 -I "$S/ezylogin.py" login --base-url https://admin.example.com
```

On a machine without a browser (SSH), add `--no-browser` and give the printed URL to the user; the callback goes to `127.0.0.1` on the machine running the script, so this only works when the browser runs on that same machine (or with an SSH port forward of the printed port).

## 4. Call APIs

| Command | What it does |
|---|---|
| `call METHOD PATH [--json '{...}' \| --json-file f.json \| --form k=v ...]` | calls the API with the token, prints `HTTP <status>` + pretty JSON, exit 2 on >= 400; on 401 it logs in again once |
| `upload FILE [--path /api/v1/media/add] [--name file] [--field k=v]` | multipart upload (default: media library) |
| `whoami`, `sites`, `logout` | token check, list saved sites, delete the local token |

Paths:

- Core admin APIs: `/api/v1/...` (e.g. `GET /api/v1/admins/me`, `GET /api/v1/users?keyword=`, `GET /api/v1/settings/...`).
- Admin plugin APIs are prefixed with the plugin name: `/<plugin>/api/v1/...` (e.g. `/ezyarticle/api/v1/posts`, `/mail-server/api/v1/domains`). Without the prefix the admin returns its HTML page with HTTP 200; the script then prints a hint instead of the HTML.
- Web APIs (web site token): `/api/v1/...` on the web host.
- Find request bodies in the plugin's source or documentation (`*Request` classes); do not guess field names for writes.

## Troubleshooting

- `403 {"cliLogin":"notAllowed"}`: CLI login was turned off: step 2b.
- `login` timed out: the user did not approve within 10 minutes, or the browser opened on another machine.
- Every call returns 401 even after login: the admin session was signed out or the account lost its role; `login --force`.
- `404 {"error":"404"}` on a plugin path: the plugin is not installed/active on that site, or the path is wrong.

Files in this skill

  • SKILL.md8.9 KB
  • scripts/enable_cli_browser.js6.9 KB
  • scripts/ezylogin.py14.1 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.