360 Secure SkillHub
360 安全技能中心

PansClaw Code

这是一款本地运行的AI编码助手CLI工具,核心功能包含AI辅助代码编写、重构、调试,以及交互式REPL模式。典型使用场景:用户明确要求用它完成编码任务、进入交互模式、委托AI处理编码相关工作。输入为用户的编码需求,输出为CLI执行后的结果。首次使用会自动构建二进制,可选择本地Ollama(免API密钥,推荐)或配置Minimax/Anthropic等云API密钥。

dashiming
dashiming
热度 42.90
最近更新 2026-05-18 11:38:26
分类:开发依赖:代码执行 / 第三方 API应用场景:代码生成 / 调试排错 / API 集成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add pansclaw-code
Metadata
name
pansclaw-code
version
0.1.0
description
Use the PansClaw Code CLI (Rust reimplementation of Claude Code) for AI-assisted coding. Triggers when: user wants to run coding tasks via pansclaw code, delegate code writing/refactoring to pansclaw code, or use it interactively. Handles auto-build if binary is missing/outdated. Prerequisites: MINIMAX_API_KEY, ANTHROPIC_API_KEY, or local Ollama models.

PansClaw Code Skill

Rust reimplementation of Claude Code CLI — an AI-powered coding assistant that runs locally.

When to Use

✅ USE this skill when:

  • User asks to use pansclaw code for a coding task
  • User wants to delegate code writing/refactoring/debugging to pansclaw code
  • User wants interactive pansclaw code REPL mode
  • User explicitly mentions "pansclaw code"

❌ DON'T use this skill when:

  • User wants me to directly implement code (use my native tools instead)
  • Simple file operations that don't need AI assistance
  • Tasks requiring OpenClaw tool/memory integration

Prerequisites

1. Build the binary (first time only)

cd "/Users/dashi/Documents/claude code source /claw-code-main/rust"
cargo build -p claw-cli --release

Binary location: ~/.local/bin/claw (symlinked to release build)

2. API Keys (choose one)

Option A: Local Ollama (recommended - no API key needed)

# Ensure Ollama is running
ollama list
# Available models: mistral-small:24b, qwen3, llama3, codellama

Option B: Cloud APIs

export MINIMAX_API_KEY="your-key"
export ANTHROPIC_API_KEY="sk-ant-..."
export OPENAI_API_KEY="your-key"

Commands

Run a single task (local Ollama)

~/.local/bin/claw --provider ollama --model mistral-small:24b --dangerously-skip-permissions "Your coding task"

Run with cloud model

~/.local/bin/claw --provider minimax --model MiniMax-Text-01 --dangerously-skip-permissions "Your task"

Interactive REPL

~/.local/bin/claw --provider ollama --model qwen3

Useful flags

Flag Description
--provider <name> Provider: ollama (local), minimax, openai, anthropic
--model <name> Model name (provider-specific)
--dangerously-skip-permissions Skip permission prompts
--print Non-interactive, print result only

Available Models

Provider Model API Key Needed Notes
ollama mistral-small:24b ❌ None Default local model
ollama qwen3 ❌ None Chinese-optimized
ollama llama3 ❌ None General purpose
ollama codellama ❌ None Code-specialized
minimax MiniMax-Text-01 ✅ MINIMAX_API_KEY Cloud
anthropic claude-opus-4-6 ✅ ANTHROPIC_API_KEY Cloud

Auto-Build Check

Before calling claw, verify the binary exists and is up-to-date:

if [ ! -f "/Users/dashi/Documents/claude code source /claw-code-main/rust/target/release/claw" ]; then
    cd "/Users/dashi/Documents/claude code source /claw-code-main/rust"
    cargo build -p claw-cli --release
fi

Execution Pattern

  1. Check binary — verify release build exists
  2. Build if needed — run cargo build -p claw-cli --release if missing
  3. Select provider — prefer local Ollama, fall back to cloud
  4. Execute — run claw with appropriate flags
  5. Return output — report results to user

Usage Examples

User: "用 claw 写一个冒泡排序"

Assistant:

~/.local/bin/claw --provider ollama --model mistral-small:24b --dangerously-skip-permissions "写一个冒泡排序算法"

User: "用 claw 重构 api 模块"

Assistant:

~/.local/bin/claw --provider minimax --model MiniMax-Text-01 --dangerously-skip-permissions "重构 api 模块使用 async/await"

User: "用 claw 解释 Rust 生命周期"

Assistant:

~/.local/bin/claw --provider ollama --model qwen3 --dangerously-skip-permissions "解释 Rust 的生命周期"

Notes

  • claw is a CLI tool — runs once per command, exits after completion
  • Local Ollama models work offline and are fast
  • Cloud models may have better quality but require API keys
  • Does NOT have access to OpenClaw's tools/memory by default