Command-line interface for ResourceX - the resource management protocol for AI Agents.
npm install -g @resourcexjs/cliOr with other package managers:
# pnpm
pnpm add -g @resourcexjs/cli
# yarn
yarn global add @resourcexjs/cli
# bun
bun add -g @resourcexjs/cli# Add a resource from local directory
rx add ./my-prompt
# Use a resource
rx use my-prompt.text@1.0.0
# List local resources
rx list
# Push to remote registry
rx config set registry https://registry.example.com
rx push my-prompt.text@1.0.0Add a resource from a local directory to local storage.
rx add ./my-promptThe directory must contain a resource.json manifest file.
List all local resources. Optionally filter by search query.
# List all resources
rx list
# Filter by name
rx list promptShow detailed information about a resource.
rx info hello.text@1.0.0Output includes locator, name, type, version, and file tree.
Execute a resource and output the result.
rx use hello.text@1.0.0- String results are printed to stdout
- Binary results are written to stdout
- JSON/object results are pretty-printed
Remove a resource from local storage.
rx remove hello.text@1.0.0Link a resource directory for development. Changes to the source are reflected immediately.
rx link ./dev-promptRemove a development link.
rx unlink dev-prompt.text@1.0.0Push a local resource to a remote registry.
# Use configured registry
rx push my-prompt.text@1.0.0
# Override registry
rx push my-prompt.text@1.0.0 --registry https://registry.example.comOptions:
-r, --registry <url>- Registry URL (overrides config)
Pull a resource from a remote registry to local cache.
# Use configured registry
rx pull hello.text@1.0.0
# Override registry
rx pull hello.text@1.0.0 --registry https://registry.example.comOptions:
-r, --registry <url>- Registry URL (overrides config)
Search resources in a remote registry.
rx search prompt
# Limit results
rx search prompt --limit 10Options:
--limit <n>- Maximum results (default: 20)
Clear cached remote resources.
# Clear all cached resources
rx cache clear
# Clear resources from specific registry
rx cache clear --registry registry.example.comOptions:
-r, --registry <host>- Only clear resources from this registry
Display current configuration.
rx config listSet a configuration value.
# Set default registry
rx config set registry https://registry.example.com
# Set storage path
rx config set path /custom/pathValid keys:
path- Local storage path (default:~/.resourcex)registry- Default registry URL
Start a registry API server for hosting resources.
# Start with defaults (port 3000, storage ./data)
rx server
# Custom port and storage
rx server --port 8080 --storage /var/resourcexOptions:
--port <n>- Port to listen on (default: 3000)--storage <path>- Storage path for resources (default:./data)
Server endpoints:
GET /health- Health checkPOST /publish- Publish resourceGET /resource/:loc- Get manifestGET /content/:loc- Get contentGET /search- Search resources
Configuration is stored at ~/.resourcex/config.json:
{
"path": "~/.resourcex",
"registry": "https://registry.example.com"
}Environment variables take precedence over config file:
RX_HOME- Override storage pathRX_REGISTRY- Override default registry
~/.resourcex/
├── config.json # CLI configuration
├── local/ # Local resources (rx add)
├── cache/ # Cached remote resources (rx pull)
└── linked/ # Development symlinks (rx link)
Resources use a Go-style locator format:
# Local resource (no registry)
name.type@version
hello.text@1.0.0
# Remote resource (with registry)
registry/name.type@version
registry.example.com/hello.text@1.0.0
Apache-2.0