@laloomery/weave
v1.1.3
Published
Headless CLI for weave-core — turns a session transcript into curated project documents. Host-agnostic: loads a weave-adapter-<host> package dynamically via --host.
Downloads
50
Readme
@laloomery/weave
Run Weave from the shell.
@laloomery/weave provides the standalone weave command. It loads the adapter selected by
--host and invokes @laloomery/weave-core. It has no importable API.
For targets.yaml, write modes, abstention, and idempotency, see the
product README.
Requirements
- Node.js 22.19.0+
- The CLI package, the adapter for the selected host, and its required SDK:
- pi:
@laloomery/weave,@laloomery/weave-adapter-pi, and@earendil-works/pi-coding-agent - Claude Code:
@laloomery/weaveand@laloomery/weave-adapter-cc; the adapter installs the Claude Agent SDK as a dependency
- pi:
See the pi adapter or Claude Code adapter README for SDK version requirements and adapter-specific options.
Install
Install the CLI with one adapter:
# pi
npm install -g @laloomery/weave @laloomery/weave-adapter-pi @earendil-works/pi-coding-agent
# Claude Code
npm install -g @laloomery/weave @laloomery/weave-adapter-ccWorkspace development
To run the local CLI against a local adapter, link the adapter where the CLI resolves dynamic host packages. The link target is resolved relative to the directory containing the link—not the repository root—so, from the repository root:
pnpm install
ln -s ../../../weave-adapter-{host} \
packages/weave/node_modules/@laloomery/weave-adapter-{host}For an adapter outside this workspace, use an absolute target path or calculate a relative path
from packages/weave/node_modules/@laloomery/. Verify the target with:
readlink -f packages/weave/node_modules/@laloomery/weave-adapter-{host}The link is ignored by the repository's node_modules/ rule. Then invoke the CLI from the workspace:
pnpm --filter @laloomery/weave start \
{session-path} \
--targets $PWD/{targets-path} \
--host {host} \
--model {provider/id}Usage
weave <transcript> --targets targets.yaml --host <pi|cc> [--model provider/id] [--sdk-path <path>] [--dry-run]| Option | Meaning |
|--------|---------|
| <transcript> | Host transcript to process. |
| --targets <path> | Path to targets.yaml. Required. |
| --host <pi\|cc> | Adapter to load. Required unless set in $WEAVE_CONFIG. |
| --model <provider/id> | Scribe model. Required unless set in $WEAVE_CONFIG. The ID may contain additional / characters. |
| --sdk-path <path> | Override the host SDK entry point for a fork or local link. |
| --dry-run | Print fragments to stdout without writing target files. |
| --help, -h | Print usage. |
Command-line options override $WEAVE_CONFIG.
The CLI writes targets below the working directory reported by the transcript; it never guesses a working directory. It logs one JSON outcome per target to stderr. A target failure does not stop other targets, but the process exits non-zero if any target fails.
Settings ($WEAVE_CONFIG)
Set $WEAVE_CONFIG to one JSON file containing CLI defaults:
export WEAVE_CONFIG=/path/to/weave.config.jsonThe CLI does not search the current directory or XDG paths. If $WEAVE_CONFIG is unset, it loads no
settings. If the referenced file cannot be read or parsed, the command fails. Flags always override
file values.
{
"host": "pi",
"model": "provider/id",
"sdkPath": "/path/to/sdk/entry.js",
"fragmentCleanupPatterns": ["\\n*MODEL_ARTIFACT[^\\n]*$"],
"extractOptions": {
"subagentToolNames": ["Agent"],
"askUserQuestionToolNames": ["ask_user_question"]
},
"completeOptions": {
"extensionsPaths": ["/path/to/pi-9router-ext"]
}
}| Key | Meaning |
|-----|---------|
| host | Adapter to load: pi or cc. Required when --host is absent. |
| model | Scribe model in provider/id format. Required when --model is absent. |
| sdkPath | Host SDK entry-point override. --sdk-path takes precedence. |
| fragmentCleanupPatterns | Regex sources applied to each model response before writing. Host-independent; does not affect transcript extraction. An invalid regex fails the command. |
| extractOptions | Passed unchanged to the selected adapter's extract. |
| completeOptions | Passed unchanged to the selected adapter's createComplete. |
extractOptions and completeOptions are host-specific. The pi scribe is isolated by default, so
native pi models need no extension configuration. An extension provider requires an explicit
completeOptions.extensionsPaths allowlist containing every extension needed by the scribe session;
it replaces automatic discovery and should exclude unrelated overlays or tools. Use only keys
documented by the selected adapter: pi or Claude Code.
License
See the monorepo.
