Skip to main content

/docs/cli-examples

iicp-node examples

This is a task-oriented companion to iicp-node --help. Every example is designed for copying, but you should still read the command and replace sample names, URLs, models, and limits before running it.

IICP is in Beta. Commands can gain additive options between releases, so the installed CLI help remains the authority for exact syntax. Interested users and implementers are welcome to participate through the public repositories and community channels.

Start and inspect

Set up the CLI, inspect its local state, and diagnose a saved node before changing anything.

Check the installed version and commands

available

Confirm which release is on your PATH and read its built-in command reference.

iicp-node --version iicp-node --help

Expected: The CLI prints its release and the commands supported by that exact binary.

Create an operator and first node

available

Run the interactive setup wizard and save a reusable node configuration.

iicp-node init

Expected: The wizard stores operator and node configuration under the IICP home directory.

Note: Review every value before accepting it. Secret material must not be copied into tickets, logs, or shared configuration files.

List saved nodes and run diagnostics

available

Find saved node names, then inspect one without starting a provider.

iicp-node list iicp-node doctor --node my-node iicp-node doctor --node my-node --json

Expected: Doctor reports local configuration, backend, directory, and recovery findings. The JSON form is suitable for scripts.

Use the mesh

Submit a conversational task. Directory discovery does not receive the prompt, but the selected executor does.

Submit a chat task

available

Discover an eligible chat provider and print its response.

iicp-node query "Explain IICP in one sentence."

Expected: The client discovers a route, submits the task to the selected provider, and prints the response.

Note: Do not submit confidential material unless the selected execution path and your policy permit it.

Apply routing and response limits

available

Require the sensitive routing profile and bound response length and waiting time.

iicp-node query "Summarise this non-secret text." \ + --routing-profile sensitive \ + --max-tokens 256 \ + --timeout-ms 90000

Expected: The client fails closed if the profile cannot be satisfied and stops waiting after the caller timeout.

Use a private directory explicitly

available

Query a directory selected by the operator instead of the public default.

iicp-node query "Hello from my trust domain." \ + --directory-url https://directory.example.test/api

Expected: Only the configured directory is contacted for discovery.

Note: Finding a directory is not the same as trusting it. Use the identity and trust configuration required by your deployment.

Run a provider

Expose only a backend and model you intend to make available. Start locally before adding a public endpoint.

Serve a saved node

available

Start a node created by the setup wizard.

iicp-node serve --node my-node

Expected: The node loads its saved configuration, registers where configured, and begins serving and heartbeating.

Serve a local Ollama model

available

Expose one local model through the default OpenAI-compatible backend path.

iicp-node serve \ + --model qwen2.5:0.5b \ + --backend-url http://localhost:11434

Expected: The node advertises the configured chat service and forwards accepted tasks to the local backend.

Serve a vLLM or llama.cpp endpoint

available

Select an explicitly supported backend interface.

# vLLM iicp-node serve --model my-model --backend-type vllm --backend-url http://127.0.0.1:8000 # llama.cpp iicp-node serve --model my-model --backend-type llamacpp --backend-url http://127.0.0.1:8080

Expected: The node uses the selected adapter while advertising the effective service it can expose end to end.

Run only on the local machine

available

Start without public discovery or federation dependencies.

iicp-node serve --node my-local-node --mode local_only

Expected: The runtime applies the saved local-only configuration.

Note: Validate the projected configuration first. Restricted-mode enforcement is being completed across all peer, gossip, relay, and CIP paths during Beta.

Operate and integrate

Use explicit health, configuration, proxy, MCP, credit, and supervisor interfaces instead of inferring state from process presence.

Check runtime health

available

Read the node's explicit liveness and readiness snapshot.

iicp-node healthcheck --node my-node

Expected: The command reports runtime health for the selected saved node.

Validate canonical configuration

available

Check a configuration file before using it to start a node.

iicp-node config validate --file iicp-node.json

Expected: Invalid combinations fail before the runtime is started.

Run the local compatibility proxy

available

Expose a loopback OpenAI/Ollama/Anthropic-compatible gateway for existing applications.

iicp-node proxy --host 127.0.0.1 --port 9483

Expected: The compatibility API listens on loopback and routes through IICP.

Note: Keep the proxy on loopback unless you have deliberately added authentication and network policy.

Inspect credit evidence

available

Read the selected node's ledger and verify signed award evidence.

iicp-node credits --node my-node iicp-node credits --node my-node --verify

Expected: The first command prints the balance; the second audits awards against the signed log.

Bridge an MCP server

available

Expose an explicitly approved local MCP server as an IICP provider.

iicp-node mcp-gateway --help

Expected: The CLI prints the gateway options supported by the installed release.

Note: Start with help because transport, tool allowlists, and execution policy are deployment-specific. Tool generation does not imply permission to execute tools.

Install a supervised service

available

Generate or install the operating-system service supported by the current CLI.

iicp-node service --help

Expected: The CLI shows the available launchd, systemd, or platform-specific actions.

Note: Inspect generated service definitions before installing them. Service supervision does not prove backend or network readiness.

Need the detailed contract?

Use these guides for installation, reachability, privacy boundaries, errors, and configuration context.