|
1 | | -# act-cli |
| 1 | +# ACT CLI |
2 | 2 |
|
3 | | -CLI and reference host for [ACT](../act-spec/) — loads `.wasm` ACT components and serves them over HTTP or MCP (stdio). |
| 3 | +CLI host for [ACT](https://actcore.dev) (Agent Component Tools) — run WebAssembly component tools from local files, HTTP URLs, or OCI registries. |
4 | 4 |
|
5 | | -## Usage |
| 5 | +## Install |
6 | 6 |
|
| 7 | +```bash |
| 8 | +npm i -g @actcore/act # npm |
| 9 | +pip install act-cli # PyPI |
| 10 | +cargo install act-cli # crates.io |
7 | 11 | ``` |
8 | | -act serve <component.wasm> [-l [::1]:3000] |
9 | | -act call <component.wasm> <tool-name> [--args '{}'] [-c '{}'] |
10 | | -act mcp <component.wasm> [-c '{}'] [--config-file config.json] |
11 | | -act info <component.wasm> |
12 | | -act tools <component.wasm> [-c '{}'] |
| 12 | + |
| 13 | +Pre-built binaries available on [GitHub Releases](https://github.com/actcore/act-cli/releases) and Docker (`ghcr.io/actcore/act`). |
| 14 | + |
| 15 | +## Quick Start |
| 16 | + |
| 17 | +```bash |
| 18 | +# Discover tools in a component |
| 19 | +act info --tools ghcr.io/actpkg/sqlite:0.1.0 |
| 20 | + |
| 21 | +# Call a tool |
| 22 | +act call ghcr.io/actpkg/sqlite:0.1.0 query \ |
| 23 | + --args '{"sql":"SELECT sqlite_version()"}' \ |
| 24 | + --metadata '{"database_path":"/data/app.db"}' \ |
| 25 | + --allow-dir /data:./data |
| 26 | + |
| 27 | +# Serve over HTTP |
| 28 | +act run -l ghcr.io/actpkg/sqlite:0.1.0 |
| 29 | + |
| 30 | +# Serve over MCP stdio |
| 31 | +act run --mcp ghcr.io/actpkg/sqlite:0.1.0 |
13 | 32 | ``` |
14 | 33 |
|
15 | | -Set `RUST_LOG=act_cli=debug` for verbose output. |
| 34 | +Components can be referenced as: |
| 35 | +- **OCI refs:** `ghcr.io/actpkg/sqlite:0.1.0` |
| 36 | +- **HTTP URLs:** `https://example.com/component.wasm` |
| 37 | +- **Local paths:** `./component.wasm` |
| 38 | + |
| 39 | +Remote components are cached in `~/.cache/act/components/`. |
16 | 40 |
|
17 | 41 | ## Commands |
18 | 42 |
|
19 | 43 | | Command | Description | |
20 | 44 | |---------|-------------| |
21 | | -| `serve` | Start ACT-HTTP server for a component | |
| 45 | +| `run` | Serve a component over ACT-HTTP (`-l`) or MCP stdio (`--mcp`) | |
22 | 46 | | `call` | Call a tool directly, print result to stdout | |
23 | | -| `mcp` | Serve component as MCP server over stdio | |
24 | | -| `info` | Show component name, version, description, capabilities | |
25 | | -| `tools` | List tools exposed by a component | |
| 47 | +| `info` | Show component metadata, tools, and schemas (`--tools`, `--format text\|json`) | |
| 48 | +| `pull` | Download a component from OCI or HTTP to local file | |
26 | 49 |
|
27 | | -## HTTP Endpoints (`serve`) |
| 50 | +## HTTP Endpoints (`run -l`) |
28 | 51 |
|
29 | 52 | | Method | Path | Description | |
30 | 53 | |--------|------|-------------| |
31 | 54 | | `GET` | `/info` | Component metadata | |
32 | | -| `GET` | `/config-schema` | JSON Schema for config (204 if none) | |
33 | | -| `GET` | `/tools` | List tools | |
34 | | -| `POST` | `/tools/{name}` | Call a tool | |
| 55 | +| `POST` | `/metadata-schema` | JSON Schema for metadata | |
| 56 | +| `POST/QUERY` | `/tools` | List tools | |
| 57 | +| `POST/QUERY` | `/tools/{name}` | Call a tool (SSE with `Accept: text/event-stream`) | |
| 58 | + |
| 59 | +## Platform Support |
| 60 | + |
| 61 | +| Architecture | Linux (GNU) | Linux (musl) | macOS | Windows | Docker | |
| 62 | +|-------------|:-----------:|:------------:|:-----:|:-------:|:------:| |
| 63 | +| x86_64 | ✓ | ✓ | ✓ | ✓ | ✓ | |
| 64 | +| aarch64 | ✓ | ✓ | ✓ | ✓ | ✓ | |
| 65 | +| riscv64 | ✓ | ✓ | — | — | ✓ | |
| 66 | + |
| 67 | +RISC-V (`riscv64`) is a first-class target. Regressions on RISC-V are release-blocking. |
35 | 68 |
|
36 | 69 | ## Building |
37 | 70 |
|
38 | | -``` |
| 71 | +```bash |
39 | 72 | cargo build --release |
40 | 73 | ``` |
41 | 74 |
|
42 | | -## Architecture |
| 75 | +Set `RUST_LOG=act=debug` for verbose output. |
43 | 76 |
|
44 | | -``` |
45 | | -main.rs CLI (clap) → subcommands (serve, call, mcp, info, tools) |
46 | | -runtime.rs wasmtime engine, component instantiation, actor pattern |
47 | | -http.rs axum routes, ACT-HTTP request/response handling |
48 | | -mcp.rs MCP JSON-RPC over stdio |
49 | | -``` |
| 77 | +## License |
50 | 78 |
|
51 | | -The host uses an actor pattern: a single tokio task owns the wasmtime `Store` and component instance, receiving requests over an mpsc channel. This ensures single-threaded access to the Wasm component while allowing concurrent HTTP handling. |
| 79 | +MIT OR Apache-2.0 |
0 commit comments