### Install ACT CLI and act-build Source: https://context7.com/actcore/act-cli/llms.txt Provides installation instructions for the ACT CLI and act-build tools using npm, pip, Cargo, and Docker. Includes building from source. ```bash # npm (all platforms) npm i -g @actcore/act # act CLI npm i -g @actcore/act-build # act-build ``` ```bash # Python (all platforms) pip install act-cli pip install act-build ``` ```bash # Cargo (from source) cargo install act-cli cargo install act-build ``` ```bash # Docker docker pull ghcr.io/actcore/act docker run --rm ghcr.io/actcore/act info ghcr.io/actpkg/sqlite:0.1.0 ``` ```bash # Build from source cargo build --release # both tools cargo build -p act-cli # act only cargo build -p act-build # act-build only ``` -------------------------------- ### Install ACT CLI and ACT Build Tools Source: https://github.com/actcore/act-cli/blob/main/act-cli/README.md Install the ACT CLI and ACT Build tools using npm, pip, or cargo. Ensure you have the respective package managers installed. ```bash # act (CLI host) npm i -g @actcore/act pip install act-cli cargo install act-cli # act-build (build tool) npm i -g @actcore/act-build pip install act-build cargo install act-build ``` -------------------------------- ### Example: SQLite Operations with ACT Source: https://github.com/actcore/act-cli/blob/main/skills/act/SKILL.md Demonstrates how to use the ACT CLI to interact with a SQLite component. Includes examples for creating a table, inserting data, and querying records, along with necessary arguments, metadata, and directory permissions. ```bash # Create a table act call ghcr.io/actpkg/sqlite:0.1.0 execute-batch \ --args '{"sql":"CREATE TABLE notes (id INTEGER PRIMARY KEY, text TEXT, created_at TEXT DEFAULT CURRENT_TIMESTAMP)"}' \ --metadata '{"database_path":"/data/notes.db"}' \ --allow-dir /data:/tmp/act-data # Insert act call ghcr.io/actpkg/sqlite:0.1.0 execute \ --args '{"sql":"INSERT INTO notes (text) VALUES (?1)","params":["Hello from ACT"]}' \ --metadata '{"database_path":"/data/notes.db"}' \ --allow-dir /data:/tmp/act-data # Query act call ghcr.io/actpkg/sqlite:0.1.0 query \ --args '{"sql":"SELECT * FROM notes"}' \ --metadata '{"database_path":"/data/notes.db"}' \ --allow-dir /data:/tmp/act-data ``` -------------------------------- ### Install ACT CLI Globally Source: https://github.com/actcore/act-cli/blob/main/skills/act/SKILL.md Install the ACT CLI globally using npm for convenient access from any terminal. ```bash npm i -g @actcore/act ``` -------------------------------- ### act CLI Commands Source: https://github.com/actcore/act-cli/blob/main/act-cli/README.md Examples of how to use the 'act' CLI to discover, call, and serve ACT components. ```APIDOC ## act CLI Commands ### Discover tools in a component ```bash act info --tools ghcr.io/actpkg/sqlite:0.1.0 ``` ### Call a tool ```bash act call ghcr.io/actpkg/sqlite:0.1.0 query \ --args '{"sql":"SELECT sqlite_version()"}' \ --metadata '{"database_path":"/data/app.db"}' \ --allow-dir /data:./data ``` ### Serve over HTTP ```bash act run -l ghcr.io/actpkg/sqlite:0.1.0 ``` ### Serve over MCP stdio ```bash act run --mcp ghcr.io/actpkg/sqlite:0.1.0 ``` ### Commands Overview | Command | Description | |---------|-------------| | `run` | Serve a component over ACT-HTTP (`-l`) or MCP stdio (`--mcp`) | | `call` | Call a tool directly, print result to stdout | | `info` | Show component metadata, tools, and schemas (`--tools`, `--format text|json`) | | `pull` | Download a component from OCI or HTTP to local file | ``` -------------------------------- ### Verify ACT CLI Installation Source: https://github.com/actcore/act-cli/blob/main/skills/act/SKILL.md Check if the ACT CLI is installed and functioning correctly. If the output does not contain 'ACT' or 'Agent Component Tools', use npx. ```bash act --help ``` ```bash npx @actcore/act --help ``` -------------------------------- ### act-build CLI Commands Source: https://github.com/actcore/act-cli/blob/main/act-cli/README.md Examples of how to use the 'act-build' tool for packing, validating, and publishing ACT components. ```APIDOC ## act-build — Component Build Tool ### Embed metadata, skills, and custom sections ```bash act-build pack target/wasm32-wasip2/release/my_component.wasm ``` ### Validate without modifying ```bash act-build validate target/wasm32-wasip2/release/my_component.wasm ``` ### Publish as a CNCF Wasm OCI Artifact ```bash act-build push my_component.wasm ghcr.io/actpkg/my-component:0.1.0 \ --also-tag latest \ --source https://github.com/actpkg/my-component \ --skip-if-identical ``` ``` -------------------------------- ### `act run --http` — Serve over ACT-HTTP REST Source: https://context7.com/actcore/act-cli/llms.txt Starts an Axum HTTP server exposing the component as a REST API. Each tool becomes a `POST /tools/{name}` endpoint. Supports SSE streaming by setting `Accept: text/event-stream`. ```APIDOC ## `act run --http` — Serve over ACT-HTTP REST Starts an Axum HTTP server exposing the component as a REST API. Each tool becomes a `POST /tools/{name}` endpoint. Supports SSE streaming by setting `Accept: text/event-stream`. ### Usage ```bash # Start HTTP server on default port 3000 act run --http ghcr.io/actpkg/sqlite:0.1.0 \ --metadata '{"database_path":"/data/app.db"}' \ --allow-dir /data:./data # Custom listen address act run --http --listen 0.0.0.0:8080 ./component.wasm ``` ### Endpoints #### `GET /info` Component metadata. #### `POST /tools` List all tools (with optional metadata). **Request Body** - **metadata** (object) - Optional - Metadata for the tool call. #### `POST /tools/{name}` Call a tool. **Path Parameters** - **name** (string) - Required - The name of the tool to call. **Request Body** - **arguments** (object) - Required - Arguments for the tool call. - **metadata** (object) - Optional - Metadata for the tool call. #### `POST /sessions` Open a session (stateful components only). **Request Body** - **arguments** (object) - Required - Arguments for opening the session. #### `DELETE /sessions/{id}` Close a session. **Path Parameters** - **id** (string) - Required - The ID of the session to close. ### Example Requests ```bash # GET /info curl http://localhost:3000/info # POST /tools curl -X POST http://localhost:3000/tools \ -H "Content-Type: application/json" \ -d '{"metadata":{"database_path":"/data/app.db"}}' # POST /tools/{name} curl -X POST http://localhost:3000/tools/query \ -H "Content-Type: application/json" \ -d '{"arguments":{"sql":"SELECT 1"},"metadata":{"database_path":"/data/app.db"}}' # SSE streaming call curl -X POST http://localhost:3000/tools/query \ -H "Content-Type: application/json" \ -H "Accept: text/event-stream" \ -d '{"arguments":{"sql":"SELECT 1"}}' # POST /sessions curl -X POST http://localhost:3000/sessions \ -H "Content-Type: application/json" \ -d '{"arguments":{"connection_string":"postgres://localhost/mydb"}}' # DELETE /sessions/{id} curl -X DELETE http://localhost:3000/sessions/sess_abc123 ``` ### Example SSE Response ``` event: content data: {"data":"1","mime_type":"text/plain"} event: done data: {} ``` ### Example Responses - **POST /sessions**: `HTTP 201 {"id":"sess_abc123","metadata":{}}` - **DELETE /sessions/{id}**: `HTTP 204` ``` -------------------------------- ### Install ACT Component Skills Source: https://github.com/actcore/act-cli/blob/main/skills/act/SKILL.md Extract and install Agent Skills embedded within an ACT component's .wasm binary. This makes the skill available to compatible agents and stores it in the `.agents/skills/` directory. ```bash act skill ``` -------------------------------- ### Granting Filesystem Access to ACT Components Source: https://github.com/actcore/act-cli/blob/main/skills/act/SKILL.md Components run in a sandbox and require explicit permission to access host filesystems. Use `--allow-dir` to map guest directories to host paths or `--allow-fs` for full access. Ensure the guest path matches paths used in `--args` or `--metadata`. ```bash --allow-dir /data:/path/on/host # map guest /data → host directory --allow-dir /data:./local-dir # relative paths work --allow-fs # full access (use with caution) ``` -------------------------------- ### Serve component over MCP stdio Source: https://context7.com/actcore/act-cli/llms.txt Use `act run --mcp` to wrap a component as an MCP server. This is useful for integrating with MCP clients or AI agent frameworks. Metadata can be passed via the `--metadata` flag, and directory access can be granted using `--allow-dir`. ```bash # Start MCP stdio server (used with MCP clients / AI agent frameworks) act run --mcp ghcr.io/actpkg/sqlite:0.1.0 \ --metadata '{"database_path":"/data/app.db"}' \ --allow-dir /data:./data ``` ```bash # MCP over Streamable HTTP (official HTTP transport) act run --mcp --http --listen 0.0.0.0:4000 ./component.wasm # MCP endpoint is available at POST /mcp ``` ```json # Example MCP JSON-RPC exchange (sent over stdin): # Request: # {"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}} # Response: # {"jsonrpc":"2.0","id":1,"result":{"tools":[{"name":"query","description":"...","inputSchema":{...}}]}} ``` ```json # Session-bound call via _meta argument metadata channel (ACT-MCP §3.2) # {"jsonrpc":"2.0","id":2,"method":"tools/call", # "params":{"name":"query","arguments":{"sql":"SELECT 1","_meta":{"std:session-id":"sess_abc123"}}}} ``` -------------------------------- ### Build and Pack sessions-canary Component Source: https://github.com/actcore/act-cli/blob/main/act-cli/tests/fixtures-src/README.md Builds the sessions-canary component using Cargo, packs its metadata, and copies it to the fixtures directory. Ensure you are in the `tests/fixtures-src/sessions-canary` directory before running. ```bash cd tests/fixtures-src/sessions-canary cargo build --target wasm32-wasip2 --release # Pack metadata into the wasm: cargo run --manifest-path ../../../../act-build/Cargo.toml --release -- \ pack target/wasm32-wasip2/release/sessions_canary.wasm # Copy into the fixtures dir: cp target/wasm32-wasip2/release/sessions_canary.wasm \ ../../fixtures/sessions-canary.wasm ``` -------------------------------- ### Discover ACT Tools Source: https://github.com/actcore/act-cli/blob/main/skills/act/SKILL.md Discover available tools within a WebAssembly component. Use `--format json` for structured output or `--format text` for a human-readable summary. The component can be specified as an OCI registry ref, HTTP URL, or local file path. ```bash act info --tools --format json ``` -------------------------------- ### Download component to local cache Source: https://context7.com/actcore/act-cli/llms.txt Use `act pull` to fetch a component from a registry or URL and store it in the local cache. You can specify an output file using `-o` or derive the filename from the reference using `-O`. ```bash # Pull to cache and print cached path act pull ghcr.io/actpkg/sqlite:0.1.0 ``` ```bash # Pull and save to a specific output file act pull ghcr.io/actpkg/sqlite:0.1.0 -o ./sqlite.wasm ``` ```bash # Derive output filename from reference (produces sqlite.wasm) act pull ghcr.io/actpkg/sqlite:0.1.0 -O ``` ```bash # Pull an HTTP artifact act pull https://example.com/my-component.wasm -o ./my-component.wasm ``` -------------------------------- ### ACT CLI Commands Source: https://github.com/actcore/act-cli/blob/main/README.md The `act` CLI tool allows users to run, call, inspect, and serve ACT components. It supports various component sources like OCI registries, HTTP URLs, and local files. ```APIDOC ## `act info` ### Description Show component metadata, tools, and schemas. ### Usage ```bash act info --tools act info --tools --format text|json ``` ### Parameters - `--tools` (string) - Required - Reference to the component to inspect. - `--format` (string) - Optional - Output format, either 'text' or 'json'. ``` ```APIDOC ## `act call` ### Description Call a tool directly within a component and print the result to stdout. ### Usage ```bash act call --args '' --metadata '' --allow-dir ``` ### Parameters - `` (string) - Required - Reference to the component (OCI, URL, or local path). - `` (string) - Required - The name of the tool to call. - `--args` (string) - Optional - JSON string containing arguments for the tool. - `--metadata` (string) - Optional - JSON string containing metadata for the call. - `--allow-dir` (string) - Optional - Directory mapping for allowed access (e.g., `/data:./data`). ``` ```APIDOC ## `act run` ### Description Serve a component over ACT-HTTP or MCP stdio. ### Usage ```bash act run -l act run --mcp ``` ### Parameters - `` (string) - Required - Reference to the component (OCI, URL, or local path). - `-l` - Serve over ACT-HTTP. - `--mcp` - Serve over MCP stdio. ``` ```APIDOC ## `act pull` ### Description Download a component from OCI or HTTP to a local file. ### Usage ```bash act pull ``` ### Parameters - `` (string) - Required - Reference to the component (OCI or HTTP URL). - `` (string) - Required - Local path to save the component. ``` -------------------------------- ### Inspect Component Metadata with `act info` Source: https://context7.com/actcore/act-cli/llms.txt Use `act info` to view component metadata without execution. Add `--tools` to list available tools and their schemas. Specify `--format json` for structured output or `--format text` for human-readable. ```bash # Show component metadata (no execution) act info ghcr.io/actpkg/sqlite:0.1.0 ``` ```bash # List tools with full parameter schemas in JSON act info --tools --format json ghcr.io/actpkg/sqlite:0.1.0 ``` ```json # Expected JSON output structure # { # "name": "sqlite", # "version": "0.1.0", # "description": "SQLite database tools", # "tools": [ # { # "name": "query", # "description": "Run a SELECT statement", # "parameters_schema": { "type": "object", "properties": { "sql": { "type": "string" } } } # } # ] # } ``` ```bash # Human-readable output act info --tools --format text ./my-component.wasm ``` -------------------------------- ### act-build Commands Source: https://github.com/actcore/act-cli/blob/main/act-build/README.md Commands for processing and publishing ACT WebAssembly components using `act-build`. ```APIDOC ## act-build pack ### Description Embed `act:component` metadata, `act:skill`, and WASM custom sections into a WebAssembly component. ### Usage ```bash act-build pack ``` ### Parameters - `` (string): Path to the input WebAssembly file. ``` ```APIDOC ## act-build validate ### Description Validate a WebAssembly component without modifying it. ### Usage ```bash act-build validate ``` ### Parameters - `` (string): Path to the WebAssembly file to validate. ``` ```APIDOC ## act-build push ### Description Publish a WebAssembly component as a CNCF Wasm OCI Artifact. ### Usage ```bash act-build push --also-tag --source --skip-if-identical ``` ### Parameters - `` (string): Path to the WebAssembly file to push. - `` (string): The OCI reference for the artifact (e.g., `ghcr.io/actpkg/my-component:0.1.0`). - `--also-tag` (string): Additional tag to apply to the OCI artifact. - `--source` (string): URL of the source repository for the component. - `--skip-if-identical` (flag): Skip pushing if an identical artifact already exists. ``` -------------------------------- ### Serve ACT Component over MCP stdio Source: https://github.com/actcore/act-cli/blob/main/act-cli/README.md Serve an ACT component using the MCP stdio protocol with the `act run --mcp` command. This is suitable for environments that communicate via standard input/output. ```bash # Serve over MCP stdio act run --mcp ghcr.io/actpkg/sqlite:0.1.0 ``` -------------------------------- ### Build ACT Tools with Cargo Source: https://github.com/actcore/act-cli/blob/main/act-cli/README.md Compile the ACT CLI and ACT Build tools using Cargo. Specify individual tools or build both simultaneously. Enable verbose logging with RUST_LOG. ```bash cargo build --release # both tools cargo build -p act-cli # act only cargo build -p act-build # act-build only Set RUST_LOG=act=debug for verbose output. ``` -------------------------------- ### Build ACT Tools with Cargo Source: https://github.com/actcore/act-cli/blob/main/act-build/README.md Build the ACT CLI and act-build tools using Cargo. You can build both tools, or specify individual packages. ```bash cargo build --release # both tools cargo build -p act-cli # act only cargo build -p act-build # act-build only ``` -------------------------------- ### Serve ACT Component over HTTP Source: https://github.com/actcore/act-cli/blob/main/act-cli/README.md Host an ACT component locally to serve requests over HTTP using the `act run -l` command. This is useful for integrating components into web services. ```bash # Serve over HTTP act run -l ghcr.io/actpkg/sqlite:0.1.0 ``` -------------------------------- ### Call an ACT Tool Source: https://github.com/actcore/act-cli/blob/main/skills/act/SKILL.md Execute a specific tool within a WebAssembly component. Provide tool parameters as a JSON string to `--args`. Use `--metadata` for per-call configuration and `--allow-dir` or `--allow-fs` to grant sandbox access to host directories or the entire filesystem. ```bash act call --args '' [options] ``` -------------------------------- ### Serve Component as HTTP API with `act run --http` Source: https://context7.com/actcore/act-cli/llms.txt Use `act run --http` to expose a component's tools as RESTful endpoints via an Axum server. Supports custom listen addresses, component metadata, directory access policies, and SSE streaming for tool calls. ```bash # Start HTTP server on default port 3000 act run --http ghcr.io/actpkg/sqlite:0.1.0 \ --metadata '{"database_path":"/data/app.db"}' \ --allow-dir /data:./data ``` ```bash # Custom listen address act run --http --listen 0.0.0.0:8080 ./component.wasm ``` ```http # GET /info — component metadata curl http://localhost:3000/info ``` ```http # POST /tools — list all tools (with optional metadata) curl -X POST http://localhost:3000/tools \ -H "Content-Type: application/json" \ -d '{"metadata":{"database_path":"/data/app.db"}}' ``` ```http # POST /tools/{name} — call a tool curl -X POST http://localhost:3000/tools/query \ -H "Content-Type: application/json" \ -d '{"arguments":{"sql":"SELECT 1"},"metadata":{"database_path":"/data/app.db"}}' ``` ```http # SSE streaming call curl -X POST http://localhost:3000/tools/query \ -H "Content-Type: application/json" \ -H "Accept: text/event-stream" \ -d '{"arguments":{"sql":"SELECT 1"}}' # event: content # data: {"data":"1","mime_type":"text/plain"} # event: done # data: {} ``` ```http # POST /sessions — open a session (stateful components only) curl -X POST http://localhost:3000/sessions \ -H "Content-Type: application/json" \ -d '{"arguments":{"connection_string":"postgres://localhost/mydb"}}' # → HTTP 201 {"id":"sess_abc123","metadata":{}} ``` ```http # DELETE /sessions/{id} — close a session curl -X DELETE http://localhost:3000/sessions/sess_abc123 # → HTTP 204 ``` -------------------------------- ### Discover Tools in an ACT Component Source: https://github.com/actcore/act-cli/blob/main/act-cli/README.md Use the `act info --tools` command to discover available tools within a specified ACT component, referenced by its OCI registry path. ```bash # Discover tools in a component act info --tools ghcr.io/actpkg/sqlite:0.1.0 ``` -------------------------------- ### ACT-Build Commands Source: https://github.com/actcore/act-cli/blob/main/README.md The `act-build` tool is used to post-process compiled WASM components, embedding metadata, skills, and custom sections, and publishing them. ```APIDOC ## `act-build pack` ### Description Embed `act:component` metadata, `act:skill`, and WASM custom sections into a compiled WASM component. ### Usage ```bash act-build pack ``` ### Parameters - `` (string) - Required - Path to the compiled WASM file. ``` ```APIDOC ## `act-build validate` ### Description Validate a WASM component without modifying it. ### Usage ```bash act-build validate ``` ### Parameters - `` (string) - Required - Path to the WASM file to validate. ``` ```APIDOC ## `act-build push` ### Description Publish a WASM component as a CNCF Wasm OCI Artifact. ### Usage ```bash act-build push --also-tag --source --skip-if-identical ``` ### Parameters - `` (string) - Required - Path to the component file. - `` (string) - Required - The OCI reference for the artifact (e.g., `ghcr.io/actpkg/my-component:0.1.0`). - `--also-tag` (string) - Optional - Additional tag to apply to the artifact. - `--source` (string) - Optional - URL of the source repository. - `--skip-if-identical` - Optional - Skip pushing if an identical artifact already exists. ``` -------------------------------- ### Configure ACT Component Policies via CLI Flags Source: https://context7.com/actcore/act-cli/llms.txt Control component access to filesystem, HTTP, and network sockets using CLI flags. Policies can be configured as allowlists or denylists. Ensure correct syntax for hostnames, ports, and protocols. ```bash # CLI flags — filesystem act call ./component.wasm my-tool \ --args '{}' \ --fs-policy allowlist \ --fs-allow "/data/**" \ --fs-deny "**/.ssh/**" ``` ```bash # CLI flags — HTTP allowlist act call ./component.wasm fetch-url \ --args '{"url":"https://api.example.com/data"}' \ --http-policy allowlist \ --http-allow api.example.com ``` ```bash # CLI flags — sockets (TCP allowlist) act call ./component.wasm connect \ --args '{}' \ --sockets-policy allowlist \ --allow-socket "vnc.example.com:5900/tcp" \ --allow-socket "10.0.0.0/8:80,443" ``` -------------------------------- ### Configure ACT Component Policies in TOML Source: https://context7.com/actcore/act-cli/llms.txt Persist component access policies in `~/.config/act/config.toml` for reuse. Supports named profiles for different environments. Use `"open"` for unrestricted access. ```toml # ~/.config/act/config.toml — persistent policy # [policy.filesystem] # mode = "allowlist" # allow = ["/tmp/**", "/data/**"] # deny = ["**/.ssh/**"] # # [policy.http] # mode = "allowlist" # allow = [{ host = "api.openai.com", scheme = "https" }] # # [policy.sockets] # mode = "allowlist" # allow = [{ host = "vnc.example.com", ports = [5900], protocols = ["tcp"] }] # # # Named profile: grant wider access for development # [profile.dev.policy] # filesystem = "open" # http = "open" ``` ```bash # Use a named profile act call ./component.wasm my-tool --args '{}' --profile dev ``` ```bash # Use a custom config file path act run --http ./component.wasm --config ./team-act.toml ``` -------------------------------- ### Push Wasm OCI Artifacts with act-build Source: https://context7.com/actcore/act-cli/llms.txt Builds and pushes WebAssembly components as CNCF Wasm OCI Artifacts. Authentication is handled automatically from environment variables or Docker config. Use `--skip-if-identical` or `--skip-if-exists` for idempotent CI. ```bash act-build push target/wasm32-wasip2/release/my_component.wasm \ ghcr.io/myorg/my-component:0.1.0 ``` ```bash act-build push ./my_component.wasm ghcr.io/myorg/my-component:0.1.0 \ --also-tag latest \ --source https://github.com/myorg/my-component \ --annotation "org.example.build-date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" ``` ```bash act-build push ./my_component.wasm ghcr.io/myorg/my-component:0.1.0 \ --skip-if-identical ``` ```bash act-build push ./my_component.wasm ghcr.io/myorg/my-component:0.1.0 \ --skip-if-exists ``` ```bash act-build push ./my_component.wasm ghcr.io/myorg/my-component:0.1.0 \ --dry-run ``` ```bash # DRY RUN — would push to ghcr.io/myorg/my-component:0.1.0 # manifest: sha256:abc123... (512 bytes) # layer: sha256:def456... (102400 bytes, application/wasm) # config: sha256:789abc... (256 bytes, application/vnd.wasm.config.v0+json) # Digest: sha256:abc123... ``` ```bash # Authentication via environment variables (CI) export OCI_USERNAME=myuser export OCI_PASSWORD=mytoken act-build push ./my_component.wasm ghcr.io/myorg/my-component:0.1.0 ``` -------------------------------- ### Inspect session-provider schema Source: https://context7.com/actcore/act-cli/llms.txt Use `act session open-args-schema` to print the JSON Schema for the `open-session` arguments of a stateful component. This is useful for understanding the required credentials or configuration parameters before calling `act call --session-args`. ```bash # Print the open-session args schema as pretty JSON act session open-args-schema ghcr.io/actpkg/my-bridge:1.0.0 ``` ```json # Example output: # { # "type": "object", # "properties": { # "connection_string": { "type": "string", "description": "PostgreSQL DSN" } # }, # "required": ["connection_string"] # } ``` -------------------------------- ### ACT CLI Commands Source: https://github.com/actcore/act-cli/blob/main/act-build/README.md Common commands for interacting with ACT components using the `act` CLI. ```APIDOC ## act info ### Description Discover tools in a component. ### Usage ```bash act info --tools ``` ### Parameters - `--tools` (flag): Show tools available in the component. - `--format` (string): Output format, either `text` or `json`. ``` ```APIDOC ## act call ### Description Call a tool directly and print the result to stdout. ### Usage ```bash act call \ --args '' \ --metadata '' \ --allow-dir ``` ### Parameters - `` (string): Reference to the ACT component (OCI, URL, or local path). - `` (string): The name of the tool to call within the component. - `--args` (string): JSON string representing the arguments for the tool. - `--metadata` (string): JSON string representing metadata for the call. - `--allow-dir` (string): Path mapping for directories to be accessible by the component (e.g., `/data:./data`). ``` ```APIDOC ## act run ### Description Serve a component over ACT-HTTP or MCP stdio. ### Usage ```bash # Serve over HTTP act run -l # Serve over MCP stdio act run --mcp ``` ### Parameters - `` (string): Reference to the ACT component (OCI, URL, or local path). - `-l` (flag): Serve the component over ACT-HTTP. - `--mcp` (flag): Serve the component over MCP stdio. ``` ```APIDOC ## act pull ### Description Download a component from OCI or HTTP to a local file. ### Usage ```bash act pull ``` ### Parameters - `` (string): Reference to the ACT component (OCI or HTTP URL). - `` (string): Local path to save the downloaded component. ``` -------------------------------- ### `act call` — Call a tool directly Source: https://context7.com/actcore/act-cli/llms.txt Resolves the component reference, instantiates the component in a Wasmtime engine with the declared policy, encodes the arguments as CBOR, and prints the result to stdout. Supports JSON inline args or an args file. ```APIDOC ## `act call` — Call a tool directly Resolves the component reference, instantiates the component in a Wasmtime engine with the declared policy, encodes the arguments as CBOR, and prints the result to stdout. Supports JSON inline args or an args file. ### Usage ```bash # Basic tool call with inline JSON args act call ghcr.io/actpkg/sqlite:0.1.0 query \ --args '{"sql":"SELECT sqlite_version()"}' \ --metadata '{"database_path":"/data/app.db"}' \ --allow-dir /data:./data # Call with metadata from a file act call ./component.wasm my-tool \ --args '{"key":"value"}' \ --metadata-file ./metadata.json \ --http-policy allowlist \ --http-allow api.openai.com # Stateful call: open session, call tool, close session automatically act call ghcr.io/actpkg/my-bridge:1.0.0 query \ --args '{"sql":"SELECT 1"}' \ --session-args '{"connection_string":"postgres://localhost/mydb"}' \ --metadata '{}' ``` ### Example stdout (for a query returning rows) ```json [{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}] ``` ``` -------------------------------- ### `act info` — Inspect a component Source: https://context7.com/actcore/act-cli/llms.txt Reads the `act:component` CBOR custom section from the WASM binary without instantiating it, then optionally instantiates to call `list-tools`. Safe to run against untrusted binaries without `--tools`. ```APIDOC ## `act info` — Inspect a component Reads the `act:component` CBOR custom section from the WASM binary without instantiating it, then optionally instantiates to call `list-tools`. Safe to run against untrusted binaries without `--tools`. ### Usage ```bash # Show component metadata (no execution) act info ghcr.io/actpkg/sqlite:0.1.0 # List tools with full parameter schemas in JSON act info --tools --format json ghcr.io/actpkg/sqlite:0.1.0 # Human-readable output act info --tools --format text ./my-component.wasm ``` ### Example JSON Output Structure ```json { "name": "sqlite", "version": "0.1.0", "description": "SQLite database tools", "tools": [ { "name": "query", "description": "Run a SELECT statement", "parameters_schema": { "type": "object", "properties": { "sql": { "type": "string" } } } } ] } ``` ``` -------------------------------- ### Reference ACT Components from Various Sources Source: https://context7.com/actcore/act-cli/llms.txt ACT accepts component references from OCI registries, HTTP/HTTPS URLs, and local file paths. Local and remote references are cached in `~/.cache/act/components/`. ```bash # OCI registry reference (host must contain a dot or be localhost) act info ghcr.io/actpkg/sqlite:0.1.0 act info ghcr.io/actpkg/sqlite@sha256:abc123def456... act info localhost:5000/dev/my-component:latest ``` ```bash # Explicit oci:// scheme act info oci://ghcr.io/actpkg/sqlite:latest ``` ```bash # HTTP/HTTPS URL to a raw .wasm file act call https://example.com/components/my-tool.wasm my-tool --args '{}' ``` ```bash # Local path (contains '/', '\', or '.wasm' extension, or starts with '.') act call ./target/wasm32-wasip2/release/my_component.wasm my-tool --args '{}' act call /absolute/path/component.wasm my-tool --args '{}' act call component.wasm my-tool --args '{}' # .wasm extension → local ``` -------------------------------- ### Embed Metadata and Publish ACT Component Source: https://github.com/actcore/act-cli/blob/main/act-cli/README.md Use `act-build pack` to embed metadata, skills, and custom sections into a compiled WASM component. Use `act-build push` to publish it as a CNCF Wasm OCI Artifact. ```bash # Embed act:component metadata, act:skill, and WASM custom sections act-build pack target/wasm32-wasip2/release/my_component.wasm # Validate without modifying act-build validate target/wasm32-wasip2/release/my_component.wasm # Publish as a CNCF Wasm OCI Artifact act-build push my_component.wasm ghcr.io/actpkg/my-component:0.1.0 \ --also-tag latest \ --source https://github.com/actpkg/my-component \ --skip-if-identical ``` -------------------------------- ### Embed Metadata and Custom Sections with act-build Source: https://github.com/actcore/act-cli/blob/main/act-build/README.md Use `act-build pack` to embed ACT component metadata, skills, and WASM custom sections into a compiled WASM file. Specify the target WASM file path. ```bash # Embed act:component metadata, act:skill, and WASM custom sections act-build pack target/wasm32-wasip2/release/my_component.wasm ``` -------------------------------- ### Call a Tool in an ACT Component Source: https://github.com/actcore/act-cli/blob/main/act-cli/README.md Execute a specific tool within an ACT component using the `act call` command. Provide arguments, metadata, and directory mappings as needed. ```bash # Call a tool act call ghcr.io/actpkg/sqlite:0.1.0 query \ --args '{"sql":"SELECT sqlite_version()"}' \ --metadata '{"database_path":"/data/app.db"}' \ --allow-dir /data:./data ``` -------------------------------- ### Pack compiled WASM component with ACT metadata Source: https://context7.com/actcore/act-cli/llms.txt Use `act-build pack` to post-process a compiled WASM component. It resolves metadata, embeds CBOR-encoded `act:component` and `act:skill` custom sections, and writes the modified binary back in place. This command is typically run after a build (e.g., `cargo build`). ```bash # Pack after a Rust build cargo build --release --target wasm32-wasip2 act-build pack target/wasm32-wasip2/release/my_component.wasm ``` ```toml # Cargo.toml with inline ACT metadata # [package] # name = "my-component" # version = "0.1.0" # description = "Demonstrates inline ACT metadata" # # [package.metadata.act.std.capabilities."wasi:http"] ``` ```toml # act.toml (overrides Cargo.toml, adds capabilities) # [std.capabilities."wasi:filesystem"] # mode = "allowlist" # allow = ["/data/**"] ``` ```toml # Python (pyproject.toml) # [project] # name = "my-component" # version = "0.1.0" # description = "A Python WASM component" # # [tool.act.std.capabilities."wasi:http"] ``` -------------------------------- ### Call Component Tool Directly with `act call` Source: https://context7.com/actcore/act-cli/llms.txt Use `act call` to invoke a specific tool within a component. Arguments and metadata can be provided as inline JSON or from files. Supports stateful sessions and network policy configurations. ```bash # Basic tool call with inline JSON args act call ghcr.io/actpkg/sqlite:0.1.0 query \ --args '{"sql":"SELECT sqlite_version()"}' \ --metadata '{"database_path":"/data/app.db"}' \ --allow-dir /data:./data ``` ```bash # Call with metadata from a file act call ./component.wasm my-tool \ --args '{"key":"value"}' \ --metadata-file ./metadata.json \ --http-policy allowlist \ --http-allow api.openai.com ``` ```bash # Stateful call: open session, call tool, close session automatically act call ghcr.io/actpkg/my-bridge:1.0.0 query \ --args '{"sql":"SELECT 1"}' \ --session-args '{"connection_string":"postgres://localhost/mydb"}' \ --metadata '{}' ``` ```text # Expected stdout (for a query returning rows): # [{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}] ``` -------------------------------- ### Publish WASM Component as OCI Artifact Source: https://github.com/actcore/act-cli/blob/main/act-build/README.md Publish a WASM component as a CNCF Wasm OCI Artifact using `act-build push`. This command supports tagging, source linking, and skipping identical pushes. ```bash # Publish as a CNCF Wasm OCI Artifact act-build push my_component.wasm ghcr.io/actpkg/my-component:0.1.0 \ --also-tag latest \ --source https://github.com/actpkg/my-component \ --skip-if-identical ``` -------------------------------- ### Enable Debug Logging for ACT CLI Source: https://context7.com/actcore/act-cli/llms.txt Set the RUST_LOG environment variable to 'act=debug' to enable detailed debug logging for ACT CLI operations. This is useful for troubleshooting. ```bash RUST_LOG=act=debug act call ./component.wasm my-tool --args '{}' ``` -------------------------------- ### ACT HTTP Endpoints Source: https://github.com/actcore/act-cli/blob/main/act-cli/README.md Details of the HTTP endpoints exposed by the 'act' CLI when serving a component. ```APIDOC ## HTTP Endpoints (`run -l`) | Method | Path | Description | |--------|------|-------------| | `GET` | `/info` | Component metadata | | `POST` | `/metadata-schema` | JSON Schema for metadata | | `POST/QUERY` | `/tools` | List tools | | `POST/QUERY` | `/tools/{name}` | Call a tool (SSE with `Accept: text/event-stream`) | ``` -------------------------------- ### ACT HTTP Endpoints Source: https://github.com/actcore/act-cli/blob/main/act-build/README.md HTTP endpoints exposed when the ACT CLI is run with the `run -l` command. ```APIDOC ## GET /info ### Description Retrieve component metadata. ### Method GET ### Endpoint /info ``` ```APIDOC ## POST /metadata-schema ### Description Get the JSON Schema for metadata. ### Method POST ### Endpoint /metadata-schema ``` ```APIDOC ## POST /tools ### Description List available tools within the component. ### Method POST ### Endpoint /tools ``` ```APIDOC ## POST /tools/{name} ### Description Call a specific tool within the component. Supports Server-Sent Events (SSE). ### Method POST ### Endpoint /tools/{name} ### Headers - `Accept`: `text/event-stream` (for SSE) ``` -------------------------------- ### Validate WASM Component with act-build Source: https://github.com/actcore/act-cli/blob/main/act-build/README.md Use `act-build validate` to check the integrity and structure of a WASM component without modifying it. This is useful for pre-flight checks. ```bash # Validate without modifying act-build validate target/wasm32-wasip2/release/my_component.wasm ``` -------------------------------- ### Extract embedded Agent Skills Source: https://context7.com/actcore/act-cli/llms.txt Use `act skill` to unpack the `act:skill` tar archive from a component's WASM custom section. This makes the skill's `SKILL.md` and associated files available in `.agents/skills/` for AI agent frameworks. ```bash # Extract to default location (.agents/skills//) act skill ghcr.io/actpkg/sqlite:0.1.0 # Output: .agents/skills/sqlite/ ``` ```bash # Extract to a custom directory act skill ./component.wasm --output ./my-skills/ ``` ```bash # Inspect the extracted SKILL.md cat .agents/skills/sqlite/SKILL.md ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.