opencode-cli-runner

Execute opencode CLI prompts with JSON event parsing and file-based inputs.

14|6|Updated Feb 24, 2026
One-click install
npx skills add https://github.com/fkguo/nullius --skill opencode-cli-runner
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: opencode-cli-runner
Source: https://github.com/fkguo/nullius/tree/main/skills/opencode-cli-runner
Command: npx skills add https://github.com/fkguo/nullius --skill opencode-cli-runner

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires opencode, python, and includes scripts (resource) components.

What problem does it solve?

This Skill allows users to run the local opencode CLI for arbitrary prompts in headless mode, providing JSON event parsing, file-based prompts, and safe fallback to the CLI default model when a model alias is unavailable.

Core Features & Use Cases

  • Headless opencode Execution: Invoke opencode from shell scripts or other automation tools without TUI mode.
  • JSON Event Parsing: Parse JSON output from opencode and provide only assistant text (type=text) to the output.
  • File-based System/User Prompts: Support file-based system/user prompts and JSON event parsing into plain text output.
  • Safe Fallback Model: Safely fall back to the CLI default model when a model alias is unavailable.
  • Use Case: This runner is particularly useful for cross-model work when you need to invoke opencode from a different host (e.g., Claude, Codex) without entering TUI mode.

Quick Start

Use the opencode-cli-runner skill to run the opencode CLI for a given model with the provided prompts and output the results to a file.

Frequently Asked Questions about opencode-cli-runner

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run opencode CLI in headless mode for arbitrary prompts?

To run the opencode CLI in headless mode for arbitrary prompts, you can use this runner to execute commands from shell scripts without entering TUI mode, utilizing file-based system and user prompts for automation.

Can I parse JSON output from opencode into plain text automatically?

Yes, you can parse JSON output from opencode into plain text automatically by executing the CLI with this runner, which uses Python to extract and provide only the assistant text events to the output.

Do I need Python to execute opencode for shell script automation?

Yes, you need Python installed to execute opencode for shell script automation using this runner, because Python is required to handle the JSON event parsing and convert the output into plain text.

What happens if a model alias is unavailable when invoking opencode from a different host?

If a model alias is unavailable when invoking opencode from a different host, the runner implements a safe fallback mechanism that automatically switches to the CLI default model to ensure execution continues.

Does opencode CLI support file-based system and user prompts for cross-model work?

Yes, opencode CLI supports file-based system and user prompts for cross-model work through this runner, allowing you to invoke the CLI from different hosts like Claude or Codex without entering TUI mode.

What is the best way to automate opencode execution and output results to a file?

The best way to automate opencode execution and output results to a file is using this runner skill, which handles headless invocation, JSON event parsing, and writes the extracted assistant text directly to your specified output file.