Complete reference for all Pocket CLI commands and options.
These options are available for all commands:
pocket [command] [flags]
Global Flags:
-h, --help Help for any command
-v, --verbose Enable verbose output
--output string Output format: text, json, yaml (default "text")
--no-color Disable colored outputExecute a workflow from a YAML or JSON file.
pocket run <workflow-file> [flags]Flags:
--dry-run- Validate workflow without executing--store-type string- Store type: memory, bounded (default "memory")--max-entries int- Max entries for bounded store (default 10000)--ttl duration- TTL for store entries--input string- Input data as JSON string--input-file string- Input data from file
Examples:
# Run a workflow
pocket run workflow.yaml
# Dry run to validate
pocket run workflow.yaml --dry-run
# With verbose output
pocket run workflow.yaml --verbose
# With custom store settings
pocket run workflow.yaml --store-type bounded --max-entries 5000 --ttl 30m
# With input data
pocket run workflow.yaml --input '{"name": "test"}'
pocket run workflow.yaml --input-file data.jsonManage and inspect available nodes.
List all available node types.
pocket nodes list [flags]Flags:
--category string- Filter by category (core, data, io, flow, script)--format string- Output format: table, json, yaml (default "table")
Examples:
# List all nodes
pocket nodes list
# List only data nodes
pocket nodes list --category data
# Output as JSON
pocket nodes list --format jsonShow detailed information about a node type.
pocket nodes info <node-type> [flags]Examples:
# Get info about http node
pocket nodes info http
# Get info as JSON
pocket nodes info transform --output jsonGenerate node documentation.
pocket nodes docs [flags]Flags:
--output string- Output file (default stdout)--format string- Format: markdown, json (default "markdown")
Manage Lua scripts.
List discovered Lua scripts.
pocket scripts list [flags]Flags:
--path string- Script directory (default "~/.pocket/scripts")
Examples:
# List all scripts
pocket scripts list
# List from custom directory
pocket scripts list --path ./my-scriptsValidate a Lua script.
pocket scripts validate <script-path> [flags]Examples:
# Validate a script
pocket scripts validate ~/.pocket/scripts/processor.lua
# Validate with verbose output
pocket scripts validate script.lua --verboseShow script metadata and information.
pocket scripts info <script-name> [flags]Examples:
# Get script info
pocket scripts info data-processor
# As JSON
pocket scripts info sentiment-analyzer --output jsonRun a script directly (for testing).
pocket scripts run <script-name> [input] [flags]Examples:
# Run with test input
pocket scripts run processor '{"test": "data"}'
# Run with input from file
pocket scripts run analyzer --input-file test.jsonManage WebAssembly plugins.
List installed plugins.
pocket plugins list [flags]Flags:
--path string- Plugin directory (default "~/.pocket/plugins")
Examples:
# List all plugins
pocket plugins list
# List with details
pocket plugins list --verboseInstall a plugin from a directory or archive.
pocket plugins install <path> [flags]Flags:
--name string- Override plugin name--force- Overwrite existing plugin
Examples:
# Install from directory
pocket plugins install ./my-plugin
# Install with custom name
pocket plugins install ./plugin --name custom-processor
# Force overwrite
pocket plugins install ./updated-plugin --forceRemove an installed plugin.
pocket plugins remove <plugin-name> [flags]Examples:
# Remove a plugin
pocket plugins remove sentiment-analyzer
# Remove with confirmation skip
pocket plugins remove old-plugin --yesShow detailed plugin information.
pocket plugins info <plugin-name> [flags]Examples:
# Get plugin details
pocket plugins info word-counter
# Show as JSON
pocket plugins info transformer --output jsonValidate a plugin without installing.
pocket plugins validate <path> [flags]Examples:
# Validate plugin structure
pocket plugins validate ./new-plugin
# Validate with verbose output
pocket plugins validate ./plugin --verboseTest a plugin function directly.
pocket plugins run <plugin> <node> <function> [input] [flags]Examples:
# Test plugin function
pocket plugins run analyzer sentiment exec '{"text": "Great product!"}'
# Test with prep/post
pocket plugins run processor transform prep '{"data": "test"}'Display version information.
pocket version [flags]Flags:
--json- Output as JSON--check-update- Check for updates (coming soon)
Examples:
# Show version
pocket version
# As JSON
pocket version --jsonPocket looks for configuration in these locations (in order):
./pocket.yaml~/.pocket/config.yaml/etc/pocket/config.yaml
Example configuration:
# pocket.yaml
log_level: info
store:
type: bounded
max_entries: 10000
ttl: 30m
plugins:
path: ~/.pocket/plugins
scripts:
path: ~/.pocket/scripts
defaults:
timeout: 30s
retry:
max_attempts: 3
delay: 1s# Set Pocket home directory
export POCKET_HOME="$HOME/.pocket"
# Set log level
export POCKET_LOG_LEVEL="debug"
# Set default store type
export POCKET_STORE_TYPE="bounded"
# Disable color output
export POCKET_NO_COLOR="true"Pocket uses standard exit codes:
0- Success1- General error2- Usage error (invalid arguments)3- Workflow validation error4- Workflow execution error5- Plugin error
# Create a workflow
cat > pipeline.yaml << EOF
name: data-pipeline
start: fetch
nodes:
- name: fetch
type: http
config:
url: "https://api.example.com/data"
- name: validate
type: validate
config:
schema:
type: object
required: [id, value]
- name: transform
type: transform
config:
jq: ".value * 1.1"
connections:
- from: fetch
to: validate
- from: validate
to: transform
EOF
# Validate it
pocket run pipeline.yaml --dry-run
# Run it
pocket run pipeline.yaml --verbose
# Run with custom settings
pocket run pipeline.yaml \
--store-type bounded \
--max-entries 1000 \
--ttl 10m# Install a plugin
pocket plugins install ./sentiment-analyzer
# Verify installation
pocket plugins list
pocket plugins info sentiment-analyzer
# Use in workflow
cat > analyze.yaml << EOF
name: sentiment-analysis
start: analyze
nodes:
- name: analyze
type: sentiment
config:
threshold: 0.7
EOF
pocket run analyze.yaml --input '{"text": "This is amazing!"}'
# Remove when done
pocket plugins remove sentiment-analyzerWorkflow not found:
pocket run workflow.yaml
# Error: workflow file not found
# Fix: Check file path
ls -la workflow.yamlInvalid YAML:
pocket run workflow.yaml --dry-run
# Error: yaml: line 5: found unexpected ':'
# Fix: Validate YAML syntaxNode type not found:
# Check available nodes
pocket nodes list
# Check if plugin is installed
pocket plugins listPermission denied:
# Fix: Check file permissions
chmod +r workflow.yaml
# For plugins
chmod +x ~/.pocket/plugins/*/plugin.wasmFor detailed debugging:
# Maximum verbosity
POCKET_LOG_LEVEL=debug pocket run workflow.yaml --verbose
# With execution trace
POCKET_TRACE=true pocket run workflow.yaml