LLMling CLI Guide¶
LLMling provides a command-line interface for managing resources, tools, and prompts. This guide explains how to use the CLI effectively.
Note: Server-related commands are documented in the
mcp-server-llmlingpackage.
Configuration Management¶
Before using LLMling, you need to set up a configuration file. The CLI provides several ways to manage configurations:
# Create a new config with basic settings
llmling config init myconfig.yml
# Register configs for easy access
llmling config add dev ~/configs/dev.yml
llmling config add prod s3://bucket/prod.yml # Supports various protocols
# Set active config
llmling config set dev
# List registered configs
llmling config list
Once a config is set as active, you can run commands without specifying the config file. You can always override the active config using the -c/--config option:
Working with Resources¶
Resources are the main input for LLMling. You can list, inspect, and load resources defined in your config:
# List all resources
llmling resource list
# Show details of a resource
llmling resource show my_resource
# Load resource content
llmling resource load my_resource
Tip: Use
-o yamlor-o jsonto get machine-readable output:
Using Tools¶
Tools are functions that can be called by LLMs. The CLI lets you explore and test tools:
# List available tools
llmling tool list
# Show tool documentation
llmling tool show my_tool
# Call a tool with arguments
llmling tool call open_url url=https://github.com
Managing Prompts¶
Prompts define how LLMs interact with resources and tools:
Global Options¶
All commands support these options:
| Option | Description |
|--------|-------------|
| -c, --config | Config file or name |
| -o, --output-format | Output format (text/json/yaml) |
| -v, --verbose | Enable debug logging |
Shell Completion¶
LLMling provides shell completion for: - Command names and options - Registered config names - Output formats
To enable completion:
Common Workflows¶
-
Initial Setup:
-
Resource Management:
-
Tool Testing:
Tips¶
- Use
--helpwith any command to see available options - The active config is shown in help text and command output
- Most commands support different output formats for scripting
- Error messages include suggestions for fixing issues
Error Handling¶
Common error scenarios and solutions:
- No config set: Use -c or set an active config
- Resource not found: Check resource list for available resources
- Tool errors: Check arguments with tool show