How fisherk2/codice-opencode works
Códice is a CLI installer and updater for an OpenCode spec-driven development workspace. The principal workflow is to select an installation mode and content packs, classify template files, stage and atomically apply them, then perform shared post-install setup; update mode also checks workspace version state and can consult GitHub. The README documents the delivered skills, commands, agents, and technical references. Some template capabilities are represented at the template-directory level because their source files are not in the supplied tree excerpt; links are limited to source-index or README evidence.
Main entry points: InstallUseCaseBase.ts Clean and project install · UpdateWorkspaceUseCase.ts Workspace update · FileMergeEngine.ts Merge engine · main.ts Installer CLI
Components 17
CLI and interaction
- Installer CLI
src/cli/main.ts - Interactive prompts
src/application/ports/IUserPrompt.ts
Install workflows
- Clean and project install
src/application/use-cases/InstallUseCaseBase.ts - Workspace update
src/application/use-cases/UpdateWorkspaceUseCase.ts - Post-install setup
src/application/postInstall.ts
Rules and merging
- Template rule manifest
src/domain/entities/FileRuleManifest.ts - File classification rules
src/domain/entities/FileRule.ts - Merge engine
src/domain/services/FileMergeEngine.ts - Stage planning
src/domain/services/stagePlanner.ts - Workspace version state
src/domain/entities/WorkspaceVersion.ts
Adapters and workspace
- Bun filesystem
src/infrastructure/adapters/BunFileSystem.ts - Atomic staging
src/infrastructure/adapters/AtomicStager.ts - Symlink creation
src/infrastructure/adapters/BunSymlinkCreator.ts - GitHub release API
src/infrastructure/adapters/GitHubRestClient.ts - Workspace assets
template
Other components
- Developer
- OpenCode runtime
Connections 19
- Developer → Installer CLI: runs
- Installer CLI → Interactive prompts: requests choices
src/cli/main.ts - Installer CLI → Clean and project install: dispatches install
src/cli/main.ts - Installer CLI → Workspace update: dispatches update
src/cli/main.ts - Clean and project install → Template rule manifest: selects rules
src/application/use-cases/InstallUseCaseBase.ts - Clean and project install → Merge engine: executes merge
src/application/use-cases/InstallUseCaseBase.ts - Clean and project install → Post-install setup: runs after merge
src/application/use-cases/InstallUseCaseBase.ts - Workspace update → Template rule manifest: selects rules
src/application/use-cases/UpdateWorkspaceUseCase.ts - Workspace update → Merge engine: executes merge
src/application/use-cases/UpdateWorkspaceUseCase.ts - Workspace update → Workspace version state: checks version
src/application/use-cases/UpdateWorkspaceUseCase.ts - Workspace update → GitHub release API: checks release
src/application/use-cases/UpdateWorkspaceUseCase.ts - Template rule manifest → File classification rules: defines classifications
src/domain/entities/FileRuleManifest.ts - Merge engine → Stage planning: computes plan
src/domain/services/FileMergeEngine.ts - Merge engine → Atomic staging: stages and commits
src/domain/services/FileMergeEngine.ts - Merge engine → Bun filesystem: queries files
- Post-install setup → Symlink creation: creates links
src/application/postInstall.ts - Post-install setup → Bun filesystem: writes version
src/application/postInstall.ts - Clean and project install → Workspace assets: installs workspace
- Workspace assets → OpenCode runtime: provides native content