feat: add bl config agent command for one-click coding agent configuration#107
Merged
Conversation
…uration Add `bl config agent` to configure a coding agent (Claude Code, Qwen Code, OpenCode, OpenClaw, Hermes, Codex) to use a DashScope/ModelStudio endpoint with a single command. Writers non-destructively merge into each agent's local config with a timestamped backup and atomic writes. - Field structures aligned to farion1231/cc-switch; qwen-code aligned to QwenLM/qwen-code source (modelProviders/security.auth keyed by protocol). - provider id unified as `bailian-cli` (qwen-code brands via model entry name + BAILIAN_CLI_API_KEY, since it keys by protocol). - Codex config.toml merged via smol-toml to preserve unrelated settings. - Add writer unit tests + config e2e cases; regenerate skill reference.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
bl config agentto configure a coding agent (Claude Code, Qwen Code, OpenCode, OpenClaw, Hermes, Codex) to use a DashScope/ModelStudio endpoint with a single command. Each writer non-destructively merges into the agent's local config file(s) with a timestamped backup and atomic (tmp + rename, mode 0o600) writes.Re-implemented from the earlier PR #69 into the current layered monorepo architecture (
packages/commandscommand +packages/cliproduct map), with config field structures verified against actively-maintained upstreams.Design decisions
farion1231/cc-switchcurrent Bailian presets (Codex usesrequires_openai_auth+model_reasoning_effort/disable_response_storage; Hermes usescustom_providersrather than stuffing creds intomodel).QwenLM/qwen-codesource:modelProviderskey andsecurity.auth.selectedTypeuse the protocol name (openai/anthropic, chosen by endpoint) because the runtime resolver indexes by protocol. Thebailian-clibrand lives in the model-entrynameandBAILIAN_CLI_API_KEY.bailian-cliacross codex/opencode/openclaw/hermes.config.tomlis merged viasmol-toml(parse + upsert only bailian-cli fields) so unrelated settings (mcp_servers,approval_policy, other providers) are preserved.choices+required→ exit code 2);--dry-runemits masked JSON without writing.bl config agentcommand for one-click coding agent configuration #69 are intentionally out of scope.Test plan
bl config agent --help/ missing--api-key/ invalid--agent/--dry-run(masked, no write) — e2e.npx vp check: 377 files, no format/lint/type errors.Note: committed with
--no-verifybecause the pre-commitvp check --fixis OOM-killed in the constrained dev sandbox;vp checkwas verified passing out-of-band.