Skip to content

gunshi / agent / getAgentProfile

Function: getAgentProfile()

ts
function getAgentProfile(): AgentProfile;

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.

Returns

AgentProfile

An AgentProfile describing whether the process is running on an AI coding agent and, if so, which agent was detected.

Example

js
import { getAgentProfile } from 'gunshi/agent'

const profile = getAgentProfile()

if (profile.isAgent) {
  // adjust output for AI agent execution
}

Released under the MIT License.