Summary
The CLI operation timeout is configurable only via the CQ_TIMEOUT environment variable — there is no --timeout persistent flag. This is inconsistent with the other core connection settings (--addr, --api-key, --db-path), each of which is exposed as both a persistent flag and an environment variable.
Current behavior
cliTimeout() (cli/cmd/cli.go) reads CQ_TIMEOUT (integer seconds), falling back to defaultCLITimeout (30s).
InitFlags() registers --addr, --api-key, --db-path, but no timeout flag.
Proposed
- Register a
--timeout persistent flag in InitFlags(), resolving with the usual precedence: flag > env (CQ_TIMEOUT) > default.
- Have
cliTimeout() consider the flag value.
- Document it in the flag help text (
env: CQ_TIMEOUT), matching the existing flags.
Open question
- Flag type:
time.Duration (e.g. --timeout 30s) reads naturally and is Go-idiomatic, but CQ_TIMEOUT is currently integer seconds. Decide whether to keep both as seconds for consistency, or accept a duration on the flag while the env var stays seconds.
Context
Surfaced during review of #516, which fixed the remote HTTP client ignoring CQ_TIMEOUT. The flag gap is orthogonal to that fix and better handled on its own.
Summary
The CLI operation timeout is configurable only via the
CQ_TIMEOUTenvironment variable — there is no--timeoutpersistent flag. This is inconsistent with the other core connection settings (--addr,--api-key,--db-path), each of which is exposed as both a persistent flag and an environment variable.Current behavior
cliTimeout()(cli/cmd/cli.go) readsCQ_TIMEOUT(integer seconds), falling back todefaultCLITimeout(30s).InitFlags()registers--addr,--api-key,--db-path, but no timeout flag.Proposed
--timeoutpersistent flag inInitFlags(), resolving with the usual precedence: flag > env (CQ_TIMEOUT) > default.cliTimeout()consider the flag value.env: CQ_TIMEOUT), matching the existing flags.Open question
time.Duration(e.g.--timeout 30s) reads naturally and is Go-idiomatic, butCQ_TIMEOUTis currently integer seconds. Decide whether to keep both as seconds for consistency, or accept a duration on the flag while the env var stays seconds.Context
Surfaced during review of #516, which fixed the remote HTTP client ignoring
CQ_TIMEOUT. The flag gap is orthogonal to that fix and better handled on its own.