🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@weave_protocol/cli

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@weave_protocol/cli

The weave CLI - one command to set up, audit, and run Weave Protocol security for AI agent projects

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
32
113.33%
Maintainers
1
Weekly downloads
 
Created
Source

🕸️ @weave_protocol/cli

npm version npm license

The weave command-line tool — one command to set up, audit, and run Weave Protocol security for AI agent projects.

npx @weave_protocol/cli init

That's it. The CLI detects your stack (LangChain, LlamaIndex, MCP server, OpenAI SDK, Anthropic SDK, or generic), asks which Weave Protocol packages you want, and scaffolds the right security middleware for your project.

Part of the Weave Protocol Security Suite.

Commands

weave init                        # Set up Weave Protocol in the current project
weave audit [path]                # Scan dependencies for supply chain risk
weave dashboard [--port=3000]     # Launch the API server + open the monitoring dashboard
weave doctor                      # Check environment for common config issues
weave version                     # Show CLI + installed package versions
weave help                        # Show help

What weave init does

  • Detects your framework by inspecting package.json and source imports
  • Asks you to confirm the framework choice (or pick a different one)
  • Lets you select which Weave Protocol packages to enable (with sensible defaults per framework)
  • Generates a weave-security.ts (or .js) middleware file appropriate for your stack
  • Writes a .weaverc config file that other Weave tools can read
  • Prints the install command for your package manager (npm/pnpm/yarn/bun)

Framework-specific scaffolding

FrameworkGenerated middleware
LangChain.jsWeaveSecurityCallback ready to drop into any chain or agent
MCP ServersecureToolHandler() wrapper that scans inputs and outputs of every tool call
OpenAI SDKsecureChatCompletion() wrapper for openai.chat.completions.create
Anthropic SDKsecureMessages() wrapper for anthropic.messages.create
Vercel AI / AI SDKOpenAI-style wrapper
Generic / RawNo code generation — just installs packages and writes .weaverc

Example: setting up a new LangChain project

$ cd my-langchain-app
$ npx @weave_protocol/cli init

🕸️  Weave Protocol CLI

Detected
────────────────────────────────────────────────────────────
  • Project root:  /Users/me/my-langchain-app
  • Language:      typescript
  • Framework:     LangChain.js
  • Also detected: OpenAI SDK

? Which framework should we configure for?
  ● 1. LangChain.js (detected)
  ○ 2. Anthropic SDK
  ○ 3. OpenAI SDK
  ○ 4. MCP Server
  ○ 5. None / generic
  (1) > 

? Which Weave Protocol packages do you want? (comma-separated)
  ☑ 1. 🛂 Tollere    — Supply chain security
  ☑ 2. 🛡️ Mund       — Input/output threat scanning
  ☐ 3. 🏛️ Hord       — Encrypted vault for secrets
  ☐ 4. ⚖️ Domere     — Compliance + blockchain anchoring
  ☐ 5. 👥 Witan      — Multi-agent consensus
  ☐ 6. 🔍 Hundredmen — Real-time MCP proxy + drift detection
  ☑ 7. 🔗 Langchain  — LangChain.js callbacks
  ☐ 8. 🔌 API        — REST API + monitoring dashboard
  (1,2,7) > 

Plan
────────────────────────────────────────────────────────────
  • Install 3 package(s):
     • @weave_protocol/langchain
     • @weave_protocol/tollere
     • @weave_protocol/mund
  • Create 1 file(s):
     • weave-security.ts — Security middleware module
  • Write .weaverc configuration file

? Proceed? (Y/n) y

  ✓ Wrote weave-security.ts
  ✓ Wrote .weaverc

Install
────────────────────────────────────────────────────────────
  Run:
    npm install @weave_protocol/langchain @weave_protocol/tollere @weave_protocol/mund

Next steps
────────────────────────────────────────────────────────────
  → Import the security callback in your chains
  → Add it to any chain's `callbacks` array
  → Run `npx weave audit` before each deploy

✨  Weave Protocol initialized!

weave audit

Delegates to Tollere to scan your package.json for typosquats, CVEs, low-reputation maintainers, and suspicious version diffs.

weave audit
weave audit ./apps/api/package.json

Exit codes: 0 = clean, 1 = warnings (review), 2 = critical (install blocked). Wire this into your CI pipeline.

weave dashboard

Launches the API package and opens the monitoring dashboard in your browser:

weave dashboard
weave dashboard --port=4000

Live activity feed, threat intel status, compliance frameworks, MCP server reputation.

weave doctor

Quick environment check:

  • Node.js version >= 18
  • package.json present
  • .weaverc present
  • At least one Weave Protocol package installed
  • Claude Desktop MCP servers configured (if applicable)
weave doctor

Exit code: 0 if all checks pass, 1 if any fail.

Programmatic API

The CLI's internals are also exported as a library, in case you want to build tooling on top:

import { detectFramework, getScaffold } from "@weave_protocol/cli";

const detection = detectFramework(process.cwd());
const scaffold = getScaffold(detection.primary, {
  language: "typescript",
  selectedPackages: ["tollere", "mund"],
  framework: detection.primary,
});

console.log(scaffold.files[0].content);
PackageDescription
@weave_protocol/fullBundle that installs all Weave Protocol packages
@weave_protocol/tollereSupply chain security
@weave_protocol/mundThreat scanning
@weave_protocol/apiREST API + dashboard

License

Apache 2.0

Keywords

weave-protocol

FAQs

Package last updated on 01 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts