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-aiarrow-up-right 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:

Installation

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.yaml

  • AI 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:

  1. Use the api-researcher agent to analyze Stripe's API documentation

  2. Invoke api-spec-builder to create the YAML API specification

  3. Use api-spec-tester to validate and debug

  4. Generate 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:

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:

  • Pipeline YAML with sequential steps

  • Hook configurations for notifications

  • Error handling and retries

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

Skill
Triggers
Purpose

sling

"sling", "data integration"

Platform overview and tools

sling-connections

"connection", "connect to"

sling-replications

"replication", "sync", "copy"

sling-pipelines

"pipeline", "workflow"

sling-transforms

"transform", "convert"

sling-hooks

"hook", "before", "after"

sling-troubleshooting

"error", "debug", "fix"

Error diagnosis

sling-api-specs

"api spec", "rest api"

Example:

When you ask:

The sling-hooks skill automatically loads, providing context about:

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:

  1. Research the API

β†’ Uses api-researcher agent

  1. Build the specification

β†’ Uses api-spec-builder agent

  1. Test the spec

β†’ Uses api-spec-tester agent if issues arise

  1. Create replication

β†’ Uses replication-builder agent

  1. Execute

Database Migration

Goal: Migrate a database from Postgres to Snowflake. See database-to-database examples.

Steps:

  1. Set up connections

  1. Design replication

See replication modes and incremental examples.

  1. Review and adjust The AI generates a replication YAML. You can refine:

  1. Execute

ETL Pipeline with Validation

Goal: Build a pipeline that syncs data, validates it, and sends notifications. See pipeline examples.

Steps:

  1. Describe the pipeline

  1. Review generated YAML The pipeline-builder agent creates a pipeline with:

  1. Execute

MCP Tools Reference

The plugin communicates with Sling CLI through Model Context Protocolarrow-up-right (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 Desktoparrow-up-right, VSCode Copilotarrow-up-right, 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 connections

  • test - Test connection validity

  • discover - List streams (tables/files/endpoints)

  • set - Create or update connection

database

Query databases and retrieve metadata.

Actions:

  • query - Execute SELECT queries

  • get_schemata - Get schema/table/column metadata

  • get_columns - Get column details

file_system

List, copy, and inspect files.

Actions:

  • list - List files/directories

  • copy - Copy between storage connections

  • inspect - Get file metadata

replication

Manage replications.

Actions:

  • parse - Validate YAML syntax

  • compile - Full validation

  • run - Execute replication

pipeline

Manage pipelines.

Actions:

  • parse - Validate YAML syntax

  • run - Execute pipeline

api_spec

Work with API specifications.

Actions:

  • parse - Load and validate spec

  • test - 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:

  1. Research (api-researcher)

  2. Cross-reference (api-cross-referencer)

  3. Build (api-spec-builder)

  4. 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?

Last updated

Was this helpful?