Detect agentic coding environments and AI assistant tools. This library allows CLI tools and Node apps to detect when they're being executed by AI agents. This enables them to adapt by, for example, providing different output formats or logs. Installation Install as library: npm install am-i-vibing Run as CLI tool: npx am-i-vibing import { detectAgenticEnvironment } from "am-i-vibing" ; const result = detectAgenticEnvironment ( ) ; console . log ( `Detected: ${ result . name } ( ${ result . type } )` ) ; Supported AI Tools Aider Bolt Claude Code Cursor Gemini CLI GitHub Copilot Agent Jules Codex CLI Replit Warp Windsurf Zed Example use case Generating LLM-specific error messages or logs: import { isAgent } from "am-i-vibing" ; const agent = isAgent ( ) ; function handleError ( error : Error ) { if ( agent ) { console . info ( ` # Error <error_message> ${ error . message } </error_message> <error_type> ${ error . name } </error_type> <error_stack> ${ error . stack } </error_stack> <note>Use the search_docs tool to find help for this error. If the tool is not available, prompt the user to enable the MCP server followng the instructions at https://example.com/mcp</note> ` ) ; } else { console . error ( "An error occurred:" , error . message ) ; } } Environment Types The library detects three main types of environments: Agent : Command was directly run by an AI agent (e.g. Claude Code, Codex CLI, Jules) : Command was directly run by an AI agent (e.g. Claude Code, Codex CLI, Jules) Interactive : Interactive commands run inside an AI environment (e.g. Cursor terminal, Replit shell) : Interactive commands run inside an AI environment (e.g. Cursor terminal, Replit shell) Hybrid: Environments that combine both agentic and interactive features in the same session (e.g. Warp) There may be false positives, such as if a user directly runs a command in an terminal opened by an AI tool, such as a Copilot terminal in VS Code. Library Usage import { detectAgenticEnvironment , isAgen...
First seen: 2025-07-19 19:30
Last seen: 2025-07-20 04:31