Add CLI flags to svc.sh (addr/host/port/data/dsn/auth/mock/passthrough) #47

Merged
weichen merged 4 commits from feature/svc-cli-args into main 2026-09-30 11:50:33 +00:00
Owner

feature/svc-cli-args:svc.sh 命令行参数

scripts/svc.sh [action] [--addr host:port] [--host] [--port] [--data] [--dsn PG-DSN] [--auth] [--mock] [--plugins] [-- 透传];优先级 CLI > SVC_* 环境变量 > 默认;make svc ENV=... ARGS="..."。

实测:端口/主机/整体地址/优先级/mock/dsn(PG 连接尝试证明透传)/-- 透传/make ARGS 全过;修复 set -e 静默退出陷阱;端口守卫对主检出并行实例正确拒接。

# feature/svc-cli-args:svc.sh 命令行参数 scripts/svc.sh <env> [action] [--addr host:port] [--host] [--port] [--data] [--dsn PG-DSN] [--auth] [--mock] [--plugins] [-- 透传];优先级 CLI > SVC_* 环境变量 > 默认;make svc ENV=... ARGS="..."。 实测:端口/主机/整体地址/优先级/mock/dsn(PG 连接尝试证明透传)/-- 透传/make ARGS 全过;修复 set -e 静默退出陷阱;端口守卫对主检出并行实例正确拒接。
weichen added 4 commits 2026-09-30 11:50:33 +00:00
Why: the manager only took configuration from SVC_* environment
variables; binding a public interface or pointing at a database meant
exporting vars first, which is awkward for one-off deploys and
invisible in shell history review.

Evidence: live matrix on the worktree - --port (8801), --host 0.0.0.0
(bind verified via ss, health probe auto-maps to 127.0.0.1), --addr
whole-form, CLI-over-env precedence (--port beats SVC_DEV_ADDR),
--mock reaching the server cmdline, --dsn passthrough proven by the
postgres connect attempt in the log, -- passthrough (--artifacts), and
make svc ARGS passthrough. A set -e silent-exit trap in env_config was
caught by the first run and fixed (condition-as-last-statement).

Impact: scripts/svc.sh <env> [action] [--addr|--host|--port|--data|
--dsn|--auth|--mock|--plugins| -- <extra>]; precedence CLI > env vars >
defaults; help rewritten with examples; make svc gains ARGS; logs keeps
the positional line-count form. The real-world port guard held: a dev
instance started from the main checkout was refused with owner info,
untouched.

Refs: feature/svc-cli-args task card.
Record the sync checkpoint
ci / test (pull_request) Failing after 17m6s
604b12ab06
weichen merged commit 7bd62ecf06 into main 2026-09-30 11:50:33 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: weichen/Agent-System-Dev#47