-
Notifications
You must be signed in to change notification settings - Fork 127
aitools: Add non-interactive installation #4248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Detect when running inside Claude Code (CLAUDECODE env var) or Cursor (CURSOR_AGENT env var) in non-interactive mode and automatically install for the detected agent without prompting. This enables AI agents to install the MCP server without user interaction. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Avoids introducing go-isatty as a new dependency by using the existing cmdio.IsTTY helper, which also provides better Windows Git Bash support through IsCygwinTerminal checks. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
|
Commit: 51f2be3
30 interesting tests: 17 KNOWN, 8 RECOVERED, 4 flaky, 1 SKIP
Top 50 slowest tests (at least 2 minutes):
|
| // Check for non-interactive mode with agent detection | ||
| // If running in an AI agent, install automatically without prompts | ||
| if !cmdio.IsTTY(os.Stdin) { | ||
| if os.Getenv("CLAUDECODE") != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do claude and cursor set these env vars?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. Codex also sets something, and I think others do as well. I've also been using these vars for other purposes.
Changes
Makes it possible for AIs to install AI Tools for themselves without needing to use an interactive terminal session.
Why
I want to see if we can create a prompt for having AIs install the tools themselves.
Tests