CLI Pro

Use CLI Pro to enable advanced features

CLI Pro Features

Sling CLI Pro extends the core functionality with advanced features designed for production environments and complex data operations.

API Sources

Extract data from any REST API with powerful YAML-based specifications called API Specs:

  • Define authentication methods (Bearer, Basic, OAuth2)

  • Configure endpoints with pagination strategies

  • Process responses with JMESPath extraction

  • Manage state for incremental synchronization

  • Support for queues and dependent requests

  • Built-in retry and error handling

In your env.yaml:

connections:
  stripe_api:
    type: api
    spec: stripe  # Use official spec or custom YAML (e.g. file://path/to/stripe.spec.yaml)
    secrets:
      api_key: sk_live_xxxxxx

In your replication:

source: stripe_api
target: ducklake

defaults:
  object: stripe.{stream_name}

streams:
  customers:
    mode: incremental

See API Specs for complete documentation and examples.

Stream Chunking & Parallel Processing

Process large datasets efficiently with automatic chunking and parallel execution:

  • Break down data into manageable chunks for various modes (full-refresh, truncate,incremental, backfill)

  • Support for time-based (hours, days, months), numeric, count-based, and expression-based chunks

  • Run multiple streams concurrently with automatic retry mechanisms

  • Configurable concurrency and retry settings

streams:
  my_schema.events:
    mode: full-refresh  # works with various modes
    primary_key: [id]
    update_key: event_date
    source_options:
      chunk_count: 8  # Process in 8 equal sized chunks

  my_schema.orders:
    mode: incremental  # works with various modes
    update_key: order_date
    source_options:
      chunk_size: 7d  # Process in 7-day chunks

env:
  SLING_THREADS: 3   # maximum of 3 streams concurrently
  SLING_RETRIES: 1   # maximum of 1 retry per failed stream

Environment variables:

  • SLING_THREADS sets the maximum number of concurrent stream runs. Accepts an integer value, default is 1.

  • SLING_RETRIES sets the maximum number of retries for a failed stream run. Accepts an integer value, default is 0.

See Chunking for detailed examples.

Pipelines & Hooks

Extend functionality with hooks and pipelines to create complex workflows. Hooks are used within replications to execute custom logic before/after operations, while Pipelines are standalone workflows that execute multiple steps in sequence.

Available action types:

Step Type
Description
Documentation

Check

Validate conditions and control flow

Command

Run any command/process

Copy

Transfer files between local or remote storage connections

Delete

Remove files from local or remote storage connections

Group

Run sequences of steps or loop over values

HTTP

Make HTTP requests to external services

Inspect

Inspect a file or folder

List

List files in folder

Log

Output custom messages and create audit trails

Query

Execute SQL queries against any defined connection

Read

Read contents of files from storage connections

Replication

Run a Replication

Routine

Execute reusable step sequences from external files

Store

Store values for later in-process access

Write

Write content to files in storage connections

See Hooks and Pipelines for usage examples and patterns.

Staged Transforms

Transform data with advanced multi-stage processing using expressions and functions:

  • Apply transformations in sequential stages with cross-column references

  • Create new columns dynamically without modifying source schemas

  • Use 50+ built-in functions for string, numeric, date, and conditional operations

  • Build complex logic with if/then/else conditions and record references

streams:
  customers:
    transforms:
      # Stage 1: Clean and normalize data
      - first_name: "trim_space(value)"
        last_name: "trim_space(value)" 
        email: "lower(value)"
      
      # Stage 2: Create computed columns
      - full_name: 'record.first_name + " " + record.last_name'
        email_hash: 'hash(record.email, "md5")'
      
      # Stage 3: Add business logic
      - customer_type: 'record.total_orders >= 50 ? "vip" : "regular"'
        discount_rate: 'record.customer_type == "vip" ? 0.15 : 0.05'

See Transforms for detailed examples and Available Functions for all available functions.

State Based Incremental Loading

Maintain state across file & database loads with intelligent incremental processing:

  • Track and resume file processing from last successful position

  • Support for incremental writes to databases and files

  • Automatic file partitioning and truncation management

See Database to Database Incremental Loading, Database to File Incremental Loading and File to Database Incremental Loading for detailed examples.

Capture Deletes (CDC)

Track deleted records using a deleted_at column:

  • Automatically detect and mark deleted records

  • Maintain historical record states

  • Support for soft deletes in target systems

See Delete Missing Records for implementation details.

MCP Server

Enable AI assistants like Claude and GitHub Copilot to interact with your data infrastructure through the Model Context Protocol (MCP):

  • Query Databases: Run SQL queries against 30+ database systems

  • Explore File Systems: List, copy, and inspect files across cloud storage and local systems

  • Manage Connections: Discover schemas, tables, columns, and endpoints

  • Execute Workflows: Run data replications and pipelines programmatically

  • API Integration: Create, test, and debug API specifications

  • AI-Powered Analysis: Leverage AI assistants for data exploration and pipeline creation

See Sling MCP Server for complete documentation, usage examples, and configuration for all AI assistants.

Frequently Asked Questions

How are tokens validated?

Tokens are validated through CloudFlare's global network, ensuring high reliability and fast response times worldwide. This validation occurs when the Sling CLI process initializes. If you'd like to confirm validation, run sling in debug mode (with flag -d), and you should see a log message: CLI Pro token validated.

Can I get an offline/air-gapped token?

For air-gapped or high-security environments, we offer offline license tokens - please contact [email protected] to request one.

How many subscriptions do I need?

Each CLI Pro subscription includes 2 tokens:

  • 1 Production token: For use in production environments

  • 1 Development token: For development and testing

We recommend purchasing one subscription per team or project, regardless of your deployment method. This allows you to:

  • Use the production token across your production environments (whether permanent servers or ephemeral containers)

  • Share the development token among team members for testing and development

For example:

  • A data engineering team handling customer data → 1 subscription

  • A separate analytics team handling reporting → 1 subscription

  • Multiple teams in an organization → 1 subscription per team

  • Consultancy/Freelancer with multiple customers → 1 subscription per customer

Important Licensing Restrictions:

Please use tokens responsibly and in accordance with our Terms of Service. Each subscription is intended for use within a single organization or team, not for redistribution to external parties.

Last updated

Was this helpful?