OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Echo a prompt for the OpenCode CLI example.
Goal
Demonstrate OpenCode agent mode in the CLI build/validate flow.
Context
Used by the opencode-cli example package.
Source Definition
export const OpenCodeEchoCommand = defineCommand({
meta: {
key: 'opencode.example.echo',
version: '1.0.0',
stability: 'experimental',
owners: ['@lssm-tech/examples'],
tags: ['opencode', 'example', 'echo'],
description: 'Echo a prompt for the OpenCode CLI example.',
goal: 'Demonstrate OpenCode agent mode in the CLI build/validate flow.',
context: 'Used by the opencode-cli example package.',
},
io: {
input: OpenCodeEchoInput,
output: OpenCodeEchoOutput,
},
acceptance: {
scenarios: [
{
key: 'echo-prompt',
given: ['A user provides a prompt'],
when: ['The echo command is invoked'],
then: ['The message is returned as-is'],
},
],
examples: [
{
key: 'echo-example',
input: { prompt: 'Hello, OpenCode' },
output: { message: 'Hello, OpenCode' },
},
],
},
policy: { auth: 'user' },
});