@lssm-tech/example.opencode-cliexample.opencode-cli
Reference integration for using ContractSpec with the OpenCode CLI.
@lssm-tech/example.opencode-cliSource, release and verification context
Source snapshot bcc79fcc · Declared package version 4.0.4. This page combines the checked-in package guide and manifest; commands and runtime behavior were not executed in this review.
See where this package fits.
Follow a declared connection, inspect an import, then open the source guide when you need the detail.
Arrows point from a package to its direct dependency. Each count is derived from the captured manifests.
@lssm-tech/example.opencode-cli
OpenCode CLI example showing agent-mode contract building and validation.
What This Demonstrates
- Agent-mode (
--agent-mode opencode) contract compilation. - Implementation checking via
--check-implementation. - Maintained example package included in the ContractSpec example registry.
src/contracts/contains contract specs, operations, entities, and registry exports.src/docs/contains docblocks and documentation-facing exports.src/handlers/contains handlers or demo adapters wired to contract surfaces.
Running Locally
From examples/opencode-cli:
bun run buildbun run testbun run typecheckbun run smokebun run preflight
Usage
Use @lssm-tech/example.opencode-cli as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.
Architecture
src/contracts/contains contract specs, operations, entities, and registry exports.src/docs/contains docblocks and documentation-facing exports.src/example.tsis the runnable example entrypoint.src/handlers/contains handlers or demo adapters wired to contract surfaces.src/index.tsis the root public barrel and package entrypoint.src/opencode-cli.feature.tsdefines a feature entrypoint.
Public Entry Points
- Export
.resolves through./src/index.ts. - Export
./contracts/opencoderesolves through./src/contracts/opencode.contracts.ts. - Export
./docsresolves through./src/docs/index.ts. - Export
./docs/opencode-cli.docblockis an alias of./docsand resolves through./src/docs/index.ts. - Export
./exampleresolves through./src/example.ts. - Export
./opencode-cli.featureresolves through./src/opencode-cli.feature.ts.
Local Commands
bun run build— bun ../../packages/apps/cli-contractspec/src/cli.ts build src/contracts/opencode.contracts.ts --agent-mode opencodebun run validate— bun ../../packages/apps/cli-contractspec/src/cli.ts validate src/contracts/opencode.contracts.ts --check-implementation --agent-mode opencodebun run typecheck— tsgo --noEmitbun run test— bun testbun run smoke— bun test src/example.smoke.test.tsbun run preflight— bun run build && bun run typecheck && bun run test && bun run validate && bun run smoke
Recent Updates
- Replace eslint+prettier by biomejs to optimize speed.
- Stability.
- Missing contract layers.
Notes
- Works alongside
@lssm-tech/lib.contracts-spec,@lssm-tech/lib.schema.
Declared capabilities.
This manifest does not declare a capability catalogue. Use the guide, import map and source to assess the package.
Imports and export paths.
6 entriesThese are package-manifest entry points. Named symbols listed above come from the capability catalogue; this is not an exhaustive TypeScript symbol reference.
6 imports
@lssm-tech/example.opencode-cli/contracts/opencode@lssm-tech/example.opencode-cli/docs@lssm-tech/example.opencode-cli/docs/opencode-cli.docblock@lssm-tech/example.opencode-cli/example@lssm-tech/example.opencode-cli/opencode-cli.featureNo export paths match this search.
Dependencies and related packages.
Runtime dependencies 2
- @lssm-tech/lib.contracts-spec
- workspace:^
- @lssm-tech/lib.schema
- workspace:^
Development dependencies 2
- @lssm-tech/tool.typescript
- workspace:*
- typescript
- catalog:
Package scripts.
Commands declared by this package. Review its setup requirements before running them; no command here was executed by this review.
bun x --bun tsc --project tsconfig.jsonbun ../../packages/apps/cli-contractspec/src/cli.ts build src/contracts/opencode.contracts.ts --agent-mode opencodebun ../../packages/apps/cli-contractspec/src/cli.ts validate src/contracts/opencode.contracts.ts --check-implementation --agent-mode opencodetsgo --noEmitbun testbun test src/example.smoke.test.tsbun run build && bun run typecheck && bun run test && bun run validate && bun run smoke