Skip to content

Commands

CVMI provides commands for managing skills, running gateways, connecting to remote servers, and generating typed clients from ContextVM servers.

Install ContextVM skills. Skills provide documentation, templates, and reference implementations to help you work with the ContextVM protocol.

Terminal window
npx cvmi add [options]
OptionDescription
--skill <name>Install a specific skill by name

Interactive installation (browse and select skills):

Terminal window
npx cvmi add

Install a specific skill:

Terminal window
npx cvmi add --skill overview
npx cvmi add --skill typescript-sdk
npx cvmi add --skill server-dev
npx cvmi add --skill client-dev

Install multiple skills:

Terminal window
npx cvmi add --skill overview --skill payments --skill deployment

Expose an MCP server as a gateway on the Nostr network. This allows Nostr clients to connect to your MCP server.

Terminal window
npx cvmi serve [options] -- <command> [args...]
OptionDescription
-e, --env <key=value>Pass environment variables to the spawned MCP server (repeatable)
--config <path>Use a custom configuration file

Serve a local stdio MCP server:

Terminal window
npx cvmi serve -- npx -y @modelcontextprotocol/server-filesystem /tmp

Serve with environment variables:

Terminal window
npx cvmi serve -e LOG_LEVEL=debug -- npx -y @modelcontextprotocol/server-filesystem /tmp

Serve a remote HTTP MCP server (configured via config file or environment):

Terminal window
npx cvmi serve

With debug logging:

Terminal window
LOG_LEVEL=debug npx cvmi serve -- npx -y @modelcontextprotocol/server-filesystem /tmp

cvmi serve spawns the MCP server directly (no shell). Prefer passing the command and its arguments as separate tokens:

Terminal window
# Correct - separate tokens
npx cvmi serve -- npx -y @modelcontextprotocol/server-filesystem /tmp
# Also works - CVMI will auto-split for you
npx cvmi serve -- "npx -y @modelcontextprotocol/server-filesystem /tmp"

Use a server from Nostr as a local stdio proxy. This allows standard MCP clients to connect to Nostr-based MCP servers.

Terminal window
npx cvmi use <serverPubkey> [options]
ArgumentDescription
serverPubkeyThe Nostr public key of the server (npub1… or hex)

Connect to a server by public key:

Terminal window
npx cvmi use npub1q...

Connect with specific logging:

Terminal window
LOG_LEVEL=warn npx cvmi use npub1q...

The use command is particularly useful when:

  • You have an MCP client that only supports stdio transport
  • You want to connect to a remote server published on Nostr
  • You’re testing or debugging Nostr-based MCP servers

Generate type-safe TypeScript clients from a ContextVM server. The cn command group is useful when you want an application-facing client instead of using the gateway or stdio proxy flows.

Terminal window
npx cvmi cn <command> [options]
SubcommandDescription
initInitialize cn in the current project
add <pubkey>Connect to a server and generate a client file
update [pubkey]Refresh one generated client or all added clients

Set up a project for generated ContextVM clients.

Terminal window
npx cvmi cn init

This command:

  • verifies that you are inside a valid project directory
  • creates a project-level .cvmi-cn.json file for client generation settings
  • creates the configured output directory for generated clients
  • warns if the required ContextVM SDK dependency is not installed

Connect to a ContextVM server by public key, inspect its tools, and generate a typed client.

Terminal window
npx cvmi cn add <serverPubkey>

During generation, CVMI lets you:

  • review discovered server metadata and tools
  • override the default generated client class name
  • print the generated code without saving it
  • save the generated file into the configured source directory

Refresh a previously added client.

Terminal window
npx cvmi cn update
npx cvmi cn update <serverPubkey>

When no pubkey is provided, CVMI prompts you to update one generated client or all configured clients.

Terminal window
# initialize the current project
npx cvmi cn init
# generate a typed client for a server
npx cvmi cn add npub1...
# later, refresh all generated clients
npx cvmi cn update

The following commands are planned for future releases:

Inspect a remote ContextVM server or invoke one of its tools directly from the terminal.

Terminal window
npx cvmi call <server>
npx cvmi call <server> <tool> [key=value ...] [options]
ArgumentDescription
serverServer alias, npub1..., or hex public key
toolOptional tool name to invoke
  • lists a server’s available tools when only the server is provided
  • shows per-tool input information to help with invocation
  • invokes a tool directly from the command line using key=value arguments
  • supports fast inspection and scripting without generating a client first
Terminal window
# inspect a server and list its tools
npx cvmi call npub1...
# invoke a tool with named arguments
npx cvmi call npub1... search query="weather in madeira"
# use a configured alias instead of a raw pubkey
npx cvmi call weather search city=Funchal

cvmi call is a good fit when you want to:

  • quickly inspect a remote server’s capabilities
  • manually test a tool without writing app code
  • script one-off calls from the shell
  • validate a server before generating a reusable client with cvmi cn

Inspect server schema and capabilities. Get detailed information about available tools, resources, and methods on a server.

All commands support these global options:

OptionDescription
--config <path>Specify a custom configuration file
--helpDisplay help for the command
--versionDisplay version information

See the Configuration page for details on environment variables that affect command behavior.