Function: getAgentProfile()
Get the AI coding agent profile of the current process.
The detection itself is delegated to std-env. This function only converts the upstream agentInfo into Gunshi's minimal AgentProfile shape.
Signature
ts
export function getAgentProfile(): AgentProfileReturns
AgentProfile — An AgentProfile describing whether the process is running on an AI coding agent and, if so, which agent was detected.
Examples
js
import { getAgentProfile } from 'gunshi/agent'
const profile = getAgentProfile()
if (profile.isAgent) {
// choose the defaults for an AI agent, such as no prompts.
// The format of the output is asked for explicitly, such as with `--json`
}