mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-03 20:34:48 +08:00
Clarify the Rust 0.1.0 public release surface
The workspace already reports version 0.1.0 and exposes a broad CLI, but the top-level README was outdated on installation, capabilities, and current release status. This pass rewrites the README around verified source-build flows and adds a draft 0.1.0 release-notes file so the branch is ready for a public-release prep review. Constraint: Release-prep pass must stay docs-only and avoid runtime behavior changes Constraint: Public docs should describe only verified commands, paths, and current distribution status Rejected: Add packaging automation in this pass | outside the requested release-facing docs scope Confidence: high Scope-risk: narrow Reversibility: clean Directive: Keep README and release notes aligned with cargo metadata, CLI help output, and CI coverage before tagging future releases Tested: Verified version/package metadata with cargo metadata; verified CLI help and command paths with cargo run --quiet --bin claw -- --help; verified CI coverage from .github/workflows/ci.yml Not-tested: cargo check and cargo test (docs-only pass; no code changes)
This commit is contained in:
227
rust/README.md
227
rust/README.md
@@ -1,149 +1,120 @@
|
||||
# 🦞 Claw Code — Rust Implementation
|
||||
# Claw Code for Rust
|
||||
|
||||
A high-performance Rust rewrite of the Claw Code CLI agent harness. Built for speed, safety, and native tool execution.
|
||||
Claw Code is a local coding-agent CLI implemented in safe Rust. The `claw` binary supports interactive sessions, one-shot prompts, workspace-aware tools, and local agent workflows from a single workspace.
|
||||
|
||||
## Quick Start
|
||||
## Current status
|
||||
|
||||
- **Version:** `0.1.0`
|
||||
- **Release stage:** initial public release, source-build distribution
|
||||
- **Platform focus:** macOS and Linux developer workstations
|
||||
- **Rust port status:** core CLI, runtime, tools, plugins, LSP, and support services are all in the Rust workspace
|
||||
|
||||
## Install, build, and run
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- Rust stable toolchain
|
||||
- Cargo
|
||||
- Provider credentials for the model you want to use
|
||||
|
||||
### Authentication
|
||||
|
||||
Anthropic-compatible models:
|
||||
|
||||
```bash
|
||||
# Build
|
||||
cd rust/
|
||||
cargo build --release
|
||||
export ANTHROPIC_API_KEY="..."
|
||||
# Optional when using a compatible endpoint
|
||||
export ANTHROPIC_BASE_URL="https://api.anthropic.com"
|
||||
```
|
||||
|
||||
# Run interactive REPL
|
||||
Grok models:
|
||||
|
||||
```bash
|
||||
export XAI_API_KEY="..."
|
||||
# Optional when using a compatible endpoint
|
||||
export XAI_BASE_URL="https://api.x.ai"
|
||||
```
|
||||
|
||||
OAuth login is also available:
|
||||
|
||||
```bash
|
||||
cargo run --bin claw -- login
|
||||
```
|
||||
|
||||
### Install locally
|
||||
|
||||
```bash
|
||||
cargo install --path crates/claw-cli --locked
|
||||
```
|
||||
|
||||
### Build from source
|
||||
|
||||
```bash
|
||||
cargo build --release -p claw-cli
|
||||
```
|
||||
|
||||
### Run
|
||||
|
||||
From the workspace:
|
||||
|
||||
```bash
|
||||
cargo run --bin claw -- --help
|
||||
cargo run --bin claw --
|
||||
cargo run --bin claw -- prompt "summarize this workspace"
|
||||
cargo run --bin claw -- --model sonnet "review the latest changes"
|
||||
```
|
||||
|
||||
From the release build:
|
||||
|
||||
```bash
|
||||
./target/release/claw
|
||||
|
||||
# One-shot prompt
|
||||
./target/release/claw prompt "explain this codebase"
|
||||
|
||||
# With specific model
|
||||
./target/release/claw --model sonnet prompt "fix the bug in main.rs"
|
||||
./target/release/claw prompt "explain crates/runtime"
|
||||
```
|
||||
|
||||
## Configuration
|
||||
## Supported capabilities
|
||||
|
||||
Set your API credentials:
|
||||
- Interactive REPL and one-shot prompt execution
|
||||
- Saved-session inspection and resume flows
|
||||
- Built-in workspace tools for shell, file read/write/edit, search, web fetch/search, todos, and notebook updates
|
||||
- Slash commands for status, compaction, config inspection, diff, export, session management, and version reporting
|
||||
- Local agent and skill discovery with `claw agents` and `claw skills`
|
||||
- Plugin discovery and management through the CLI and slash-command surfaces
|
||||
- OAuth login/logout plus model/provider selection from the command line
|
||||
- Workspace-aware instruction/config loading (`CLAW.md`, config files, permissions, plugin settings)
|
||||
|
||||
```bash
|
||||
export ANTHROPIC_API_KEY="sk-ant-..."
|
||||
# Or use a proxy
|
||||
export ANTHROPIC_BASE_URL="https://your-proxy.com"
|
||||
```
|
||||
## Current limitations
|
||||
|
||||
Or authenticate via OAuth:
|
||||
- Public distribution is **source-build only** today; this workspace is not set up for crates.io publishing
|
||||
- GitHub CI verifies `cargo check`, `cargo test`, and release builds, but automated release packaging is not yet present
|
||||
- Current CI targets Ubuntu and macOS; Windows release readiness is still to be established
|
||||
- Some live-provider integration coverage is opt-in because it requires external credentials and network access
|
||||
- The command surface may continue to evolve during the `0.x` series
|
||||
|
||||
```bash
|
||||
claw login
|
||||
```
|
||||
## Rust port status
|
||||
|
||||
## Features
|
||||
The Rust workspace is already the primary implementation surface for this CLI. It currently includes these workspace crates:
|
||||
|
||||
| Feature | Status |
|
||||
|---------|--------|
|
||||
| API + streaming | ✅ |
|
||||
| OAuth login/logout | ✅ |
|
||||
| Interactive REPL (rustyline) | ✅ |
|
||||
| Tool system (bash, read, write, edit, grep, glob) | ✅ |
|
||||
| Web tools (search, fetch) | ✅ |
|
||||
| Sub-agent orchestration | ✅ |
|
||||
| Todo tracking | ✅ |
|
||||
| Notebook editing | ✅ |
|
||||
| CLAW.md / project memory | ✅ |
|
||||
| Config file hierarchy (.claw.json) | ✅ |
|
||||
| Permission system | ✅ |
|
||||
| MCP server lifecycle | ✅ |
|
||||
| Session persistence + resume | ✅ |
|
||||
| Extended thinking (thinking blocks) | ✅ |
|
||||
| Cost tracking + usage display | ✅ |
|
||||
| Git integration | ✅ |
|
||||
| Markdown terminal rendering (ANSI) | ✅ |
|
||||
| Model aliases (opus/sonnet/haiku) | ✅ |
|
||||
| Slash commands (/status, /compact, /clear, etc.) | ✅ |
|
||||
| Hooks (PreToolUse/PostToolUse) | 🔧 Config only |
|
||||
| Plugin system | 📋 Planned |
|
||||
| Skills registry | 📋 Planned |
|
||||
- `claw-cli` — user-facing binary
|
||||
- `api` — provider clients and streaming
|
||||
- `runtime` — sessions, config, permissions, prompts, and runtime loop
|
||||
- `tools` — built-in tool implementations
|
||||
- `commands` — slash-command registry and handlers
|
||||
- `plugins` — plugin discovery, registry, and lifecycle support
|
||||
- `lsp` — language-server protocol support types and process helpers
|
||||
- `server` and `compat-harness` — supporting services and compatibility tooling
|
||||
|
||||
## Model Aliases
|
||||
## Roadmap
|
||||
|
||||
Short names resolve to the latest model versions:
|
||||
- Publish packaged release artifacts for public installs
|
||||
- Add a repeatable release workflow and longer-lived changelog discipline
|
||||
- Expand platform verification beyond the current CI matrix
|
||||
- Add more task-focused examples and operator documentation
|
||||
- Continue tightening feature coverage and UX polish across the Rust port
|
||||
|
||||
| Alias | Resolves To |
|
||||
|-------|------------|
|
||||
| `opus` | `claude-opus-4-6` |
|
||||
| `sonnet` | `claude-sonnet-4-6` |
|
||||
| `haiku` | `claude-haiku-4-5-20251213` |
|
||||
## Release notes
|
||||
|
||||
## CLI Flags
|
||||
|
||||
```
|
||||
claw [OPTIONS] [COMMAND]
|
||||
|
||||
Options:
|
||||
--model MODEL Set the model (alias or full name)
|
||||
--dangerously-skip-permissions Skip all permission checks
|
||||
--permission-mode MODE Set read-only, workspace-write, or danger-full-access
|
||||
--allowedTools TOOLS Restrict enabled tools
|
||||
--output-format FORMAT Output format (text or json)
|
||||
--version, -V Print version info
|
||||
|
||||
Commands:
|
||||
prompt <text> One-shot prompt (non-interactive)
|
||||
login Authenticate via OAuth
|
||||
logout Clear stored credentials
|
||||
init Initialize project config
|
||||
doctor Check environment health
|
||||
self-update Update to latest version
|
||||
```
|
||||
|
||||
## Slash Commands (REPL)
|
||||
|
||||
| Command | Description |
|
||||
|---------|-------------|
|
||||
| `/help` | Show help |
|
||||
| `/status` | Show session status (model, tokens, cost) |
|
||||
| `/cost` | Show cost breakdown |
|
||||
| `/compact` | Compact conversation history |
|
||||
| `/clear` | Clear conversation |
|
||||
| `/model [name]` | Show or switch model |
|
||||
| `/permissions` | Show or switch permission mode |
|
||||
| `/config [section]` | Show config (env, hooks, model) |
|
||||
| `/memory` | Show CLAW.md contents |
|
||||
| `/diff` | Show git diff |
|
||||
| `/export [path]` | Export conversation |
|
||||
| `/session [id]` | Resume a previous session |
|
||||
| `/version` | Show version |
|
||||
|
||||
## Workspace Layout
|
||||
|
||||
```
|
||||
rust/
|
||||
├── Cargo.toml # Workspace root
|
||||
├── Cargo.lock
|
||||
└── crates/
|
||||
├── api/ # API client + SSE streaming
|
||||
├── commands/ # Shared slash-command registry
|
||||
├── compat-harness/ # TS manifest extraction harness
|
||||
├── runtime/ # Session, config, permissions, MCP, prompts
|
||||
├── claw-cli/ # Main CLI binary (`claw`)
|
||||
└── tools/ # Built-in tool implementations
|
||||
```
|
||||
|
||||
### Crate Responsibilities
|
||||
|
||||
- **api** — HTTP client, SSE stream parser, request/response types, auth (API key + OAuth bearer)
|
||||
- **commands** — Slash command definitions and help text generation
|
||||
- **compat-harness** — Extracts tool/prompt manifests from upstream TS source
|
||||
- **runtime** — `ConversationRuntime` agentic loop, `ConfigLoader` hierarchy, `Session` persistence, permission policy, MCP client, system prompt assembly, usage tracking
|
||||
- **claw-cli** — REPL, one-shot prompt, streaming display, tool call rendering, CLI argument parsing
|
||||
- **tools** — Tool specs + execution: Bash, ReadFile, WriteFile, EditFile, GlobSearch, GrepSearch, WebSearch, WebFetch, Agent, TodoWrite, NotebookEdit, Skill, ToolSearch, REPL runtimes
|
||||
|
||||
## Stats
|
||||
|
||||
- **~20K lines** of Rust
|
||||
- **6 crates** in workspace
|
||||
- **Binary name:** `claw`
|
||||
- **Default model:** `claude-opus-4-6`
|
||||
- **Default permissions:** `danger-full-access`
|
||||
- Draft 0.1.0 release notes: [`docs/releases/0.1.0.md`](docs/releases/0.1.0.md)
|
||||
|
||||
## License
|
||||
|
||||
See repository root.
|
||||
See the repository root for licensing details.
|
||||
|
||||
Reference in New Issue
Block a user