@cannbot-plugin/cannbot
v1.11.2
Published
CANNBot workflow installer for OpenCode, Codex, Claude Code, TRAE, DSH, and CodeArts
Readme
CANNBot npm installer
This directory is the complete npm project for @cannbot-plugin/cannbot.
npx @cannbot-plugin/cannbot install ops-direct-invoke --tool opencode
npx @cannbot-plugin/cannbot install model-infer-optimize --tool codex
npx @cannbot-plugin/cannbot@latest install ops-direct-invoke --tool codearts--tool codearts installs Skills and Markdown agents under .codeartsdoer/skills/ and .codeartsdoer/agents/, records the installation in .codeartsdoer/cannbot-plugin.json, and uses project-root AGENTS.md when the plugin provides instructions. CodeArts permission hooks are not installed.
For OpenCode, the installer reads opencode --version and uses plugin <package> for 1.x or plugin add <package> for 2.x. The package provides both the legacy server entry and the 2.x setup entry.
The npm package contains only the launcher and the OpenCode compatibility entry.
Every npx ... install creates a fresh shallow clone of
https://gitcode.com/cann/cannbot.git on master, including its submodules, then runs the selected plugin's
init.sh if present. The script owns installation, including any extra setup, and
is called once with project, the selected tool, target, and additional options.
If no init.sh exists, the init step is skipped and the checkout's
script/bin/cannbot.js performs the generic installation. An init failure stops
the command; it does not fall back to generic installation. Scripts run in the
target directory; supported path options are resolved from the caller directory.
Plugin initializers, installation logic, and Skills come
from the source repositories, not the npm package. Git, Bash (for plugins with init.sh), and network access are
required; a clone failure stops installation without falling back to old content.
Checkouts are retained under ~/.cannbot/sources/install-* because installed
Skills and hooks may link to them. They are installation data, never reused by
subsequent npx invocations. Existing installations recorded in copy mode keep that
mode and refresh their Skills from the new checkout. Do not delete a checkout while an installation still
references it. npm may cache the small launcher package; this does not cache the
plugin or its installation scripts.
npm test
npm pack --dry-run
npm run pack:smoke
npm publish --access publicnpm publish runs the test suite and verifies the generated tarball, including
fresh-clone installation and failure handling. The launcher is MIT licensed;
downloaded plugins and Skills retain their source repository licenses.
Source init.sh scripts using the shared entry point forward the selected plugin,
source repository, tool, and target to the repository CLI. Independent plugin
installers retain their own behavior. Plugin-specific dependency repositories are
declared in plugin-install.json.
plugin-install.json may declare initializeBefore, an ordered list of plugin IDs to fully install before the current plugin. The same client, target and selected shared Skill checkout are reused; plugin-specific overrides apply only to the requested plugin. Cycles are rejected. ops-direct-invoke initializes ops-perf-optimize this way, so the performance plugin owns its Skills, agents, hooks and knowledge setup in both source and npm installations.
See the workflow installation and usage guide for all supported commands and prompt examples.
Official and community plugins are resolved from the fresh source checkout. For local development, invoke the source CLI directly:
node script/bin/cannbot.js install ops-direct-invoke --source "$PWD" --tool codex --target /absolute/project--override-skills /absolute/overrides replaces selected existing repo-* Skills from same-named directories. Document templates are maintained under ops-direct-invoke/templates; workflow reference graphs live in workflows/ascendc and carry use_when metadata. Run scripts/generate_workflow_guide.py with --output in the work directory before selecting a template from the generated guide. The workflow entry and scheduler cannot be replaced through this option. See the ops-direct-invoke README for its task assembly rules and current public-interface limitations.
For source installations that declare shared Skills under vendor/cannbot-skills, each install initializes the submodule if needed and fetches the branch on its origin matching the current CANNBot branch. If that remote branch does not exist, or CANNBot has a detached HEAD, it uses master. Remote lookup or fetch errors fail the installation instead of triggering fallback. --skills <SHA> selects a commit (use a full SHA to fetch missing commits); --skills <path> links shared Skills from a local Git worktree root, resolving relative paths from the calling directory. Explicit overrides bypass branch selection. This preserves repository-local harness and plugin Skills. Default/SHA updates reject uncommitted submodule changes. Local overrides keep uncommitted content and never update the submodule. Plugins without shared dependencies reject --skills.
The client-specific cannbot-plugin.json records source.revisions.cannbot and source.revisions["cannbot-skills"] (selection, requested value, full commit, dirty flag, and local path when applicable). Automatic selection uses selection: "latest-branch" and records the actual selected branch in requested, including master after fallback. Reinstalling replaces the plugin record. These options and records apply to the shared installer; independent entry points such as ascendc-port-orchestrator/init.sh are not integrated. See the shared-source guide.
Updating the submodule may mark its Gitlink as changed in the CANNBot worktree. All source installations use live symlinks, including fixed-SHA installations: subsequent updates to a shared checkout affect earlier installations. Revision records describe installation-time commits, not frozen copies; dirty content is not reproduced by its commit alone. Use independent checkouts with --skills <path> for separate project versions.
The source CLI accepts --source and --plugin-dir; the npx launcher rejects these overrides so its installation always uses the freshly cloned repository. --plugin-dir selects a specific plugin directory when its folder name differs from its manifest name. Relative paths resolve from --source for source installs, or the installer root when no source is specified. The requested install ID must match the manifest; installed assets and registry records always use that ID.
Reinstalling a native permission guard fills in all tool names declared by the
installer, while retaining existing matcher alternatives, hooks, and settings.
An empty matcher or * retains its existing match-all scope. Run the isolated
installer regression with node --test test/hook-matchers.test.js from script/.
It exercises real CLI installations against temporary plugin/configuration
fixtures and calls registerSettingsHook directly to check matcher merging and
idempotence; it does not execute client hooks or NPU workloads.
