| name | Xling CLI Expert |
| description | Expert knowledge about xling CLI tool for managing AI tools (Claude Code, Codex, Gemini) and executing AI prompts with multi-provider support. Use when user asks about xling commands, configuration, or workflows. |
| version | 1.0.0 |
Xling CLI Expert
This skill provides comprehensive knowledge about the xling CLI tool for managing AI CLI tools and executing AI prompts.
When to Use This Skill
Use this skill when the user:
- Asks about xling commands (
x,p,sx,settings:*) - Needs help configuring AI providers
- Wants to create command shortcuts
- Asks about multi-provider setup and fallback
- Needs troubleshooting help with xling
- Wants to integrate xling with git workflows
Core Commands
Quick Launcher: xling x
Launch Claude Code or Codex with yolo mode enabled by default.
Syntax:
xling x [FLAGS] [-- ...args]
Key Flags:
-t, --tool <claude|codex>- Target tool (default: claude)--no-yolo- Disable yolo mode-c, --continue- Resume most recent session-r, --resume- Show session picker-C, --cwd <dir>- Run from different directory
Examples:
xling x # Launch Claude with yolo
xling x -t codex # Launch Codex
xling x -c # Continue last session
xling x -- chat "Hello" # Forward args to Claude
Prompt Command: xling p
Execute AI prompts with multi-provider support, intelligent routing, and automatic fallback.
Key Features:
- Multi-provider support (OpenAI, Azure, custom)
- Intelligent model routing
- Automatic fallback on failure
- Priority-based provider selection
Syntax:
xling p [FLAGS] <prompt>
Key Flags:
-m, --model <model>- Model to use-s, --system <text>- System prompt-f, --file <path>- Read context from file--stdin- Read from stdin-t, --temperature <0.0-2.0>- Temperature--max-tokens <n>- Max tokens--json- JSON output-i, --interactive- Interactive chat mode
Examples:
# Basic usage
xling p "Explain quantum computing"
# With model
xling p --model gpt-4-turbo "Write a poem"
# From file
xling p -f README.md "Summarize this"
# From stdin (great for pipelines)
git diff | xling p --stdin "Review this diff"
# Interactive mode
xling p -i "Let's chat"
Configuration (~/.claude/xling.json):
{
"prompt": {
"providers": [
{
"name": "openai-primary",
"baseUrl": "https://api.openai.com/v1",
"apiKey": "sk-proj-xxx",
"models": ["gpt-4", "gpt-4-turbo"],
"priority": 1,
"timeout": 60000
}
],
"defaultModel": "gpt-4",
"retryPolicy": {
"maxRetries": 2,
"backoffMs": 1000
}
}
}
How It Works:
- User specifies model (or uses defaultModel)
- System finds providers supporting that model
- Providers sorted by priority (lower = higher)
- Tries first provider
- On failure, checks if retriable (network errors, 5xx, 429)
- If retriable, applies exponential backoff and tries next provider
- If all fail, shows all errors
Shortcuts: xling sx
Execute predefined command shortcuts with three types: command, shell, and pipeline.
Syntax:
xling sx <name> [...args]
xling sx --list
Shortcut Types:
1. Command Type (Xling commands):
{
"lc": {
"command": "x",
"args": ["-t", "claude", "-c"],
"description": "Launch Claude and continue"
}
}
2. Shell Type (Shell commands):
{
"gdp": {
"shell": "git diff | xling p --stdin 'Summarize changes'",
"description": "Git diff with AI summary"
}
}
3. Pipeline Type (Command pipelines):
{
"gcm": {
"pipeline": [
{ "command": "git", "args": ["diff", "--cached"] },
{ "command": "xling", "args": ["p", "--stdin", "Generate commit"] }
],
"description": "Generate commit message"
}
}
Examples:
# List shortcuts
xling sx --list
# Execute shortcut
xling sx lc
# With additional args
xling sx lc --no-yolo
Settings Management: xling settings:*
Unified interface for managing configurations across Claude Code, Codex, and Gemini CLI.
Commands:
settings:list - List configurations
xling settings:list --tool <claude|codex|gemini> --scope <user|project|local>
settings:get - Display full config
xling settings:get --tool claude --scope user
settings:set - Open config in IDE
xling settings:set --tool claude --name hxi --ide code
settings:switch - Switch profile/variant
xling settings:switch <profile> --tool codex
settings:inspect - Show file info
xling settings:inspect --tool claude --scope user
Configuration Scopes:
- Claude Code:
user,project,local - Codex:
user - Gemini:
user,project,system
Configuration Structure
Main Config: ~/.claude/xling.json
{
"prompt": {
"providers": [
{
"name": "provider-name",
"baseUrl": "https://api.example.com/v1",
"apiKey": "your-key",
"models": ["model1", "model2"],
"priority": 1,
"timeout": 60000,
"headers": {
"X-Custom": "value"
}
}
],
"defaultModel": "model-name",
"retryPolicy": {
"maxRetries": 2,
"backoffMs": 1000
}
},
"shortcuts": {
"shortcut-name": {
"command": "xling-command",
"args": ["arg1", "arg2"],
"description": "Description"
}
}
}
Provider Fields:
name- Unique identifierbaseUrl- API base URLapiKey- API keymodels- Supported models arraypriority- Lower = higher priority (optional)timeout- Request timeout in ms (optional)headers- Custom headers (optional)
Common Workflows
1. Setup New Provider
# Edit config
vim ~/.claude/xling.json
# Add provider to prompt.providers array
# Test it
xling p --model your-model "test prompt"
2. Create Git Integration Shortcut
# Add to shortcuts in config:
{
"gcm": {
"pipeline": [
{ "command": "git", "args": ["diff", "--cached"] },
{ "command": "xling", "args": ["p", "--stdin", "Generate commit message"] }
],
"description": "Generate commit message"
}
}
# Use it
git add .
xling sx gcm
3. AI Code Review
# Review current changes
git diff | xling p --stdin "Review this code"
# Review specific file
xling p -f src/app.ts "Find bugs and suggest improvements"
# Interactive review
xling p -i -f src/app.ts "Let's review together"
Troubleshooting
"Model not supported" Error
Check:
- Model name spelling
- At least one provider has model in
modelsarray - Run
xling settings:list --tool xlingto see available models
"All providers failed" Error
Check:
- API keys are valid
- Network connectivity
- Provider URLs are correct
- Check error details for each provider
Config Parse Error
Check:
- JSON syntax is valid
- Config follows new format with
promptnamespace - Old format is auto-migrated but may have issues
Shortcut Not Found
Check:
- Shortcut name is correct
- Run
xling sx --listto see available shortcuts - Config file has
shortcutssection
Best Practices
- Use shortcuts for common tasks - Create shortcuts for frequently used commands
- Set up multiple providers - Configure backup providers for reliability
- Use priority wisely - Lower priority = higher preference
- Secure your config - File automatically gets 600 permissions
- Use stdin for pipelines - Great for git workflows
- Interactive mode for exploration - Use
-ifor conversations - Organize shortcuts - Use prefixes (l=launch, g=git, s=settings)
Important Notes
- Config format changed: Old format had
providersat top level, new format hasprompt.providers(auto-migrated) - Yolo mode default:
xling xenables yolo by default, use--no-yoloto disable - Shortcuts are powerful: Can execute commands, shell scripts, or pipelines
- Provider priority: Lower number = higher priority
- Retriable errors: Network errors and 5xx are retried, 4xx are not
Example Configurations
Multi-Provider Setup
{
"prompt": {
"providers": [
{
"name": "openai-primary",
"baseUrl": "https://api.openai.com/v1",
"apiKey": "sk-proj-xxx",
"models": ["gpt-4", "gpt-4-turbo"],
"priority": 1
},
{
"name": "openai-backup",
"baseUrl": "https://api.openai.com/v1",
"apiKey": "sk-proj-yyy",
"models": ["gpt-4", "gpt-3.5-turbo"],
"priority": 2
}
],
"defaultModel": "gpt-4"
}
}
Useful Shortcuts
{
"shortcuts": {
"lc": {
"command": "x",
"args": ["-t", "claude", "-c"],
"description": "Launch Claude and continue"
},
"gdp": {
"shell": "git diff | xling p --stdin 'Summarize changes'",
"description": "Git diff with AI summary"
},
"gcm": {
"pipeline": [
{ "command": "git", "args": ["diff", "--cached"] },
{ "command": "xling", "args": ["p", "--stdin", "Generate commit"] }
],
"description": "Generate commit message"
}
}
}