OpenCode icon

OpenCode

Interact with OpenCode Server API for AI coding assistant sessions

Message → Execute Skill

AI-generated

Summary

Executes an OpenCode skill by formatting it as a slash command and posting it as a message to an OpenCode session.

Inputs

  • sessionMode — Choose whether to use an existing session or automatically create and delete a temporary session for this operation.
  • sessionId (required) — The session ID where the skill command will be sent. Required when Session Mode is set to existing.
  • tempSessionTitle — Title assigned to the session if Session Mode is set to temporary.
  • model — Optional model specification in providerID::modelID format.
  • skill (required) — The skill to execute.
  • skillArguments — Arguments to pass alongside the skill execution command.
  • referencedFiles — File paths to prepended as @filename references before the skill command.
  • options — Additional settings including request timeout, agent selection, reference message ID, response whitespace trimming, and custom response key name.

Output shape

a single object containing response text and execution metadata

Returns execution details including messageId, sessionId, provider, model, token counts, cost, skill details, and raw message parts. The main text response is output under the key defined in Response Key (defaults to 'response').

Examples

Example 1: Execute a code analysis skill in an active session

Select an existing Session, set Skill to 'analyze-code', and specify Skill Arguments like '--depth=full'.

Example 2: Run a skill referencing context files using a temporary session

Set Session Mode to 'Temporary Session', select a Skill, and add file paths to Reference Files.

Links

Discussion