Asking one question
When there is no conversation to have, there is no reason to manage one. ask opens a command, sends, collects the assistant’s text until the turn ends, and closes.
import { Claude } from 'activecli';
const answer = await Claude.ask('What does this repository do?', { workingDir: '/proj' });
answer.text; // everything the assistant said, tool calls left outanswer.isOk(); // whether the turn finished normallyanswer.result; // the CLI's own result entry — cost, duration, anything else it reportedNo permission mode of its own
Section titled “No permission mode of its own”isOk() is separate from the promise resolving
Section titled “isOk() is separate from the promise resolving”An interrupted turn also produces a result, so “there is a result” is not the same as “it went well” — which is why isOk() exists separately from the promise resolving.
Where to go next
Section titled “Where to go next”- Your first conversation — when one question is not enough.
- Permission modes — what
askis declining to set.