Working with AI π€
Using Sling CLI with AI coding assistants like Claude Code
Sling CLI integrates seamlessly with AI coding assistants through the slingdata-ai plugin, enabling you to research APIs, design data integrations, and debug configurations using natural languageβall within your AI assistant. See github repo https://github.com/slingdata-io/slingdata-ai for resources.
Overview
The slingdata-ai plugin provides:
Slash commands for direct execution of replications and pipelines
Specialized agents for complex workflows (API research, spec building, replication design)
Skills that load contextual documentation automatically
MCP integration that connects your AI assistant to Sling CLI tools
Supported AI Assistants:
Claude Code (primary)
Installation
From Marketplace (Recommended)
If using Claude Code with marketplace support:
Local Development
For contributing or local development:
Prerequisites
Sling CLI v1.5.0+ must be installed
Connections configured in
~/.sling/env.yamlAI assistant with MCP support
Install Sling CLI:
Quick Start
1. Configure a Connection
See the Environment documentation for details on managing connections.
2. Use Commands in AI Assistant (Claude Code)
List connections:
Test a connection:
Discover tables:
3. Build with Natural Language
Instead of writing YAML manually, describe what you want:
Example: API Integration
The AI will:
Use the
api-researcheragent to analyze Stripe's API documentationInvoke
api-spec-builderto create the YAML API specificationUse
api-spec-testerto validate and debugGenerate a replication config to sync data to your database
Example: Database Replication
The AI will use the replication-builder agent to create a proper replication YAML with incremental settings.
Slash Commands (Claude Code)
Slash commands provide direct access to Sling CLI operations:
/sling:run
Execute a replication or pipeline file with validation.
Usage:
The command will:
Parse and validate the YAML file
Check connection availability
Execute the replication or pipeline
Display progress and results
/sling:conns
Manage connections interactively.
List all connections:
Test a connection:
Discover streams (tables/files/endpoints):
Specialized Agents
Agents are AI sub-processes that handle complex, multi-step tasks autonomously. They have access to specific tools and are optimized for particular workflows.
API Specification Agents
Build custom REST API connectors through a research β build β test workflow.
api-researcher
Research REST API documentation to gather authentication methods, endpoints, pagination patterns, and rate limits.
Example:
Outputs:
Authentication type and credentials needed
Available endpoints and their purposes
Pagination strategy (cursor, offset, page-based)
Rate limit information
api-spec-builder
Create Sling API specification YAML files from research findings.
Example:
Outputs:
Complete
shopify.yamlspecificationAuthentication configuration
Endpoint definitions with pagination
Data Integration Agents
replication-builder
Design replication configurations for moving data between databases, files, and APIs.
Example:
Outputs:
Replication YAML with proper modes (full-refresh vs incremental)
Stream selection and transformations
Performance optimizations
pipeline-builder
Design multi-step data workflows with validation, transformations, and notifications.
Example:
Outputs:
Skills
Skills are topic-specific documentation modules that load automatically based on keywords in your conversation. They provide contextual guidance without requiring explicit invocation.
Available Skills
sling
"sling", "data integration"
Platform overview and tools
sling-troubleshooting
"error", "debug", "fix"
Error diagnosis
Example:
When you ask:
The sling-hooks skill automatically loads, providing context about:
Hook types (http, sql, check, command)
Placement options (pre/post replication)
Configuration examples
Variable access in hooks
Common Workflows
Building a Custom API Connector
Goal: Extract data from a REST API that Sling doesn't natively support. See the API Specifications concept guide for detailed information.
Steps:
Research the API
β Uses api-researcher agent
Build the specification
β Uses api-spec-builder agent
Test the spec
β Uses api-spec-tester agent if issues arise
Create replication
β Uses replication-builder agent
Execute
Database Migration
Goal: Migrate a database from Postgres to Snowflake. See database-to-database examples.
Steps:
Set up connections
Design replication
See replication modes and incremental examples.
Review and adjust The AI generates a replication YAML. You can refine:
Execute
ETL Pipeline with Validation
Goal: Build a pipeline that syncs data, validates it, and sends notifications. See pipeline examples.
Steps:
Describe the pipeline
Review generated YAML The
pipeline-builderagent creates a pipeline with:
HTTP webhook for Slack
HTTP webhook for email alerts
Execute
MCP Tools Reference
The plugin communicates with Sling CLI through Model Context Protocol (MCP) tools. These are invoked automatically by the AI but understanding them helps debug issues.
For detailed information about the MCP server, configuration options, and using Sling MCP with other AI assistants (Claude Desktop, VSCode Copilot, ChatGPT), see the MCP Server documentation.
connection
Manage connections (list, test, discover, set). See database connections, storage connections, and API connections.
Actions:
list- Show all connectionstest- Test connection validitydiscover- List streams (tables/files/endpoints)set- Create or update connection
database
Query databases and retrieve metadata.
Actions:
query- Execute SELECT queriesget_schemata- Get schema/table/column metadataget_columns- Get column details
file_system
List, copy, and inspect files.
Actions:
list- List files/directoriescopy- Copy between storage connectionsinspect- Get file metadata
replication
Manage replications.
Actions:
parse- Validate YAML syntaxcompile- Full validationrun- Execute replication
pipeline
Manage pipelines.
Actions:
parse- Validate YAML syntaxrun- Execute pipeline
api_spec
Work with API specifications.
Actions:
parse- Load and validate spectest- Test API endpoints
Troubleshooting
Plugin Not Loading
Check installation:
You should see sling@slingdata-ai in the list.
Verify Sling CLI:
Should return v1.5.0 or higher.
MCP Connection Issues
Check MCP server status: The plugin uses sling mcp as the MCP server. Test it:
Should start an MCP server on stdio.
Configuration location: .mcp.json in the plugin directory configures the server.
For more MCP troubleshooting: See the MCP Server troubleshooting section for log locations, debug output, and detailed diagnostics.
Commands Not Working
Check syntax:
Check file paths: Use absolute paths or paths relative to current working directory.
Agent Failures
Enable debug mode: When testing connections or API specs, add debug flag:
Check credentials: Verify secrets in ~/.sling/env.yaml:
Review agent output: Agents provide detailed error messages. Look for:
Authentication failures (401/403)
Rate limit errors (429)
Invalid endpoints (404)
Malformed requests (400)
Best Practices
Use Natural Language First
Instead of manually writing YAML, describe what you want:
The AI will generate proper configuration and explain design decisions.
Iterate with Agents
For complex tasks, work step-by-step with agents:
Research (api-researcher)
Cross-reference (api-cross-referencer)
Build (api-spec-builder)
Test (api-spec-tester)
Each agent focuses on its specialty, improving quality.
Use Skills for Learning
Skills auto-load based on keywords. To learn about a topic, ask questions:
What's Next?
MCP Server - Use Sling with Claude Desktop, VSCode Copilot, and other AI assistants
Environment Setup - Configure connections and credentials
Replications - Deep dive into replication configs
Pipelines - Build multi-step workflows
API Specifications - Create custom API connectors
Hooks - Add pre/post actions
Last updated
Was this helpful?