fix(cli): honor PASEO_PASSWORD env var (fix #776) (#782)

* fix(cli): honor PASEO_PASSWORD env var (fix #776)

The CLI only extracted passwords from `tcp://host?password=` URIs, so
`PASEO_PASSWORD=xxxx paseo ls` connected without auth and was rejected
by the daemon with "Password required". Fall back to the env var when
the host (TCP or otherwise) carries no password.

* docs: document PASEO_PASSWORD env var as a CLI auth source

Pairs with the CLI fix in this branch — the "Connecting with a password"
section now lists both the tcp URI query and the env-var fallback, with
their precedence. Also clarify the dual role (daemon vs CLI) of
PASEO_PASSWORD in the env var reference.
This commit is contained in:
Mohamed Boudra
2026-05-06 23:22:22 +08:00
committed by GitHub
parent c36f4cfee4
commit 55ec13f153
3 changed files with 65 additions and 14 deletions
+6 -1
View File
@@ -218,7 +218,12 @@ export function resolveDaemonTarget(host: string): DaemonTarget {
export function resolveDaemonPassword(host: string): string | undefined {
const trimmed = host.trim();
return trimmed.startsWith("tcp://") ? parseConnectionUri(trimmed).password : undefined;
if (trimmed.startsWith("tcp://")) {
const fromUri = parseConnectionUri(trimmed).password;
if (fromUri) return fromUri;
}
const fromEnv = process.env.PASEO_PASSWORD;
return fromEnv && fromEnv.length > 0 ? fromEnv : undefined;
}
/**