Skip to content

feat(cli): agent init + one-shot installer for per-agent write confirmation - #4

Merged
AllenMuu merged 2 commits into
mainfrom
develop
Jul 31, 2026
Merged

feat(cli): agent init + one-shot installer for per-agent write confirmation#4
AllenMuu merged 2 commits into
mainfrom
develop

Conversation

@AllenMuu

Copy link
Copy Markdown
Owner

Summary

  • mysql-cli agent init: install per-agent configs that force a human confirmation prompt before mysql-cli writes (--write/--ddl/--yes). Supports claude / cursor / opencode / copilot / codebuddy.
  • install.sh / install.ps1: one-shot installer (release binary + skills + agent init).
  • Skill --yes wording tightened: request, not waive.

Why

--yes is a flag the AI passes itself, so writes could execute without a human in the loop. This puts the confirmation back in human hands, per agent, via each agent's native gate (hook / permission / regex / rule).

Changes

  • internal/agentsetup: embedded templates + agent registry + deep-merge install (idempotent, .bak backup, command/key dedup).
  • internal/cli/agent_cmd: interactive multi-select (readline) + flag fallback (--agents/--project/--global/--force/--dry-run/--json).
  • install.sh / install.ps1: one-shot binary + skills + agent init.
  • docs/agent-integration.md, README/README-zh, AGENTS.md: usage + capability matrix.
  • skills/mysql-{query,shared}/SKILL.md: --yes reworded.

Test plan

  • go vet ./... / go test ./... green (new agentsetup + agent_cmd tests)
  • ./scripts/skill-format-check.sh skills/ green
  • install.sh non-interactive run: downloaded v2.0.0 binary; agent init correctly reports "needs v2.1+"
  • agentsetup merge/idempotency: re-install dedups; existing user config preserved
  • Windows install.ps1 manual run (no pwsh on dev mac)
  • After v2.1 release: agent init step runs end-to-end via installer

Codex (hook unverified) and TRAE (rules format unverified) deferred.

AllenMuu and others added 2 commits July 31, 2026 18:39
--yes was described as "confirms destructive ops", letting AI agents
self-confirm writes. Rephrase across mysql-query and mysql-shared: --yes
marks a destructive op and triggers a human confirmation prompt; it is a
request, not a waiver. Never use --yes to bypass review.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
…nfirmation

--write/--ddl/--yes are flags the AI passes itself, so the CLI alone cannot
pull a human into the loop. Add 'mysql-cli agent init' to install per-agent
configs that prompt a human before any write runs.

- internal/agentsetup: embedded templates + registry for 5 agents (claude,
  cursor, opencode, copilot, codebuddy). Deep-merges into existing JSON
  configs with .bak backup and command/key dedup (idempotent re-runs).
- internal/cli/agent_cmd: interactive multi-select (readline) + flag fallback
  (--agents/--project/--global/--force/--dry-run/--json).
- install.sh / install.ps1: one-shot binary (release) + skills + agent init.
- docs/agent-integration.md, README, AGENTS: usage and capability matrix.

Codex (hook unverified) and TRAE (rules format unverified) deferred.

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
@AllenMuu
AllenMuu merged commit 4c7cff8 into main Jul 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant