jackwener/OpenCLI · error · CliError
CONFIG
CONFIG
Error message
Password required
What it means
The `opencli ones login` command performs a non-interactive password login against the ONES Project API. It resolves the password from --password or the ONES_PASSWORD env var; if empty it throws a CONFIG error, because there is no interactive prompt in this code path. This is a pre-flight input validation thrown before any network call.
Source
Thrown at clis/ones/login.js:39
name: 'phone',
type: 'str',
required: false,
help: 'Account phone (or set ONES_PHONE); ignored if email is set',
},
{
name: 'password',
type: 'str',
required: false,
help: 'Password (or set ONES_PASSWORD)',
},
],
columns: ['uuid', 'name', 'email', 'token_preview'],
func: async (page, kwargs) => {
const email = kwargs.email?.trim() || process.env.ONES_EMAIL?.trim();
const phone = kwargs.phone?.trim() || process.env.ONES_PHONE?.trim();
const password = kwargs.password || process.env.ONES_PASSWORD || '';
if (!password) {
throw new CliError('CONFIG', 'Password required', 'Pass --password or set ONES_PASSWORD for non-interactive use.');
}
if (!email && !phone) {
throw new CliError('CONFIG', 'email or phone required', 'Pass --email or --phone (or set ONES_EMAIL / ONES_PHONE).');
}
getOnesBaseUrl();
const bodyObj = { password };
if (email)
bodyObj.email = email;
else
bodyObj.phone = phone;
const parsed = (await onesFetchInPage(page, 'auth/login', {
method: 'POST',
body: JSON.stringify(bodyObj),
auth: false,
}));
const user = parsed.user;
if (!user?.uuid || !user?.token) {
throw new CliError('FETCH_ERROR', 'ONES login response missing user.uuid or user.token', 'Your server build may differ from documented Project API.');View on GitHub (pinned to 49907e53dc)
Solutions
- Pass --password '<your-password>' on the command line.
- Export ONES_PASSWORD in your shell or CI secrets before running the command.
- If you cannot store the password, skip login and instead authenticate via the logged-in Chrome session plus ONES_USER_ID/ONES_AUTH_TOKEN headers.
Example fix
// before opencli ones login --email me@corp.com // after ONES_PASSWORD='...' opencli ones login --email me@corp.com
Defensive patterns
Strategy: validation
Validate before calling
const password = process.env.ONES_PASSWORD;
if (!password) {
throw new Error('ONES_PASSWORD must be set (or pass --password) before running `opencli ones login`.');
} Try / catch
try {
await opencli.ones.login({ email, password });
} catch (e) {
if (e.code === 'CONFIG' && e.message === 'Password required') {
console.error('Provide --password or export ONES_PASSWORD for non-interactive use.');
} else throw e;
} Prevention
- Store ONES_PASSWORD in your CI secret manager, not in plaintext scripts.
- In wrappers, check for the env var before invoking the CLI.
- Remember this path is non-interactive — never rely on a prompt.
When it happens
Trigger: Running `opencli ones login --email you@corp.com` (or --phone) without --password and without ONES_PASSWORD set in the environment.
Common situations: Scripting login in CI where only email was exported; assuming the CLI will prompt interactively; ONES_PASSWORD defined under a different name or not exported in the current shell.
Understand the failure class
Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.
Related errors
AI-assisted analysis of jackwener/OpenCLI@49907e53dc (2026-08-29).
Data as JSON: /api/errors/a2ffd331dc9cca87.
Report an issue: GitHub.