Commands¶
Knosh provides four subcommands. Run any command with --help for a quick reference.
Action Commands¶
These commands cause Knosh to do some work on your behalf.
| Command | Description |
|---|---|
prompt |
Run a prompt through an agent |
kdocs |
Add or update KDoc comments in Kotlin source files |
General Commands¶
These commands either configure Knosh or provide information to you about your Knosh environment.
| Command | Description |
|---|---|
init |
Write a default configuration file |
list-agents |
List all defined agents |
Action Command Common Options¶
All of the action commands share a set of options for controlling agent execution and logging.
Execution¶
--agentId <id>- Required. The agent to use, identified by its filename (without the
.mdextension) in the agents directory. Uselist-agentsto see available agents. --max-iterations <n>- Maximum number of LLM API calls the agent may make in a single run. Default:
50. Increase for complex multi-step tasks. --temperature <value>- Sampling temperature, usually in the range
0.0to1.0. Overrides the value in the agent's configuration file. When omitted, the agent's configured value is used — except forkdocs, which defaults to0.2.
Retries¶
--max-retries <n>- Number of times to retry after a transient failure. Default:
0(no retries). --retry-delay-ms <ms>- Milliseconds to wait between retries. With
--exponential-backoff, this is the initial delay. Default:0. --exponential-backoff- Double the retry delay on each attempt instead of using a fixed delay.
Logging¶
--log-dir <path>- Directory to write log files. Each run appends to a
YYYY-MM-DD.logfile in that directory. Logging to a file is disabled when this option is omitted. --log-level <level>- Minimum severity level to emit:
TRACE,DEBUG,INFO,WARN,ERROR. Default:WARN. --log-format <format>- Log line format:
compact(default),default,json,pretty. --log-full-prompts- Log prompt input and the agent response in full. By default, text longer than 200 characters is replaced with a character count.
--log-full-tool-calls- Log tool call arguments and results in full. By default, large text fields are replaced with a character count.