# Set up Sling with a coding agent This file is for a coding agent (Claude Code, Codex, Cursor or similar). A person asked you to set up Sling. Sling moves data between databases, files and APIs. Do the steps in order. Before each command, tell the person in one sentence what it does. Rules: - Do not use sudo or admin rights. Sling installs in the home folder of the user. - Do not change or remove entries that exist in `~/.sling/env.yaml`. Add new entries with new names. Ask before you change an entry. - Never ask for a password, key or token in the chat. Tell the person where to put it. - Work in a new folder `~/sling-quickstart`. Do not work in the current repository. ## 1. Check where you run If you cannot run shell commands, or your files are removed after the session (for example in claude.ai or ChatGPT), do not install anything. Tell the person to connect the Sling MCP server `https://api.slingdata.io/mcp`. The steps for each app are at https://slingdata.io/ai. Stop here. ## 2. Check the shell Check the shell, not only the OS. Run `uname -s`. If that fails, you are in PowerShell. Run `$PSVersionTable.PSVersion`. | Result | Shell | Use the commands for | |---|---|---| | `Darwin` | macOS | macOS / Linux | | `Linux` | Linux | macOS / Linux | | `Linux`, and `grep -qi microsoft /proc/version` succeeds | WSL | macOS / Linux. WSL has its own `~/.sling/env.yaml`, apart from Windows. Tell the person. | | `MINGW...`, `MSYS...` or `CYGWIN...` | Git Bash on Windows (Claude Code uses it) | Git Bash | | a version number | PowerShell on Windows | PowerShell | In Windows PowerShell 5.1, `curl` is a different command. Use `irm`. ## 3. Install the CLI If `sling --version` works, do not install again. macOS / Linux / WSL: curl -fsSL https://slingdata.io/install.sh -o /tmp/sling-install.sh && bash /tmp/sling-install.sh Git Bash: powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "irm https://slingdata.io/install.ps1 | iex" < /dev/null PowerShell: irm https://slingdata.io/install.ps1 -OutFile "$env:TEMP\sling-install.ps1"; powershell -NoProfile -ExecutionPolicy Bypass -File "$env:TEMP\sling-install.ps1" The installer puts sling in `~/.sling/bin` and adds it to PATH for new shells. Your shell does not see the new PATH. Use the full path in this session. Below, `sling` means: - macOS / Linux / WSL: `~/.sling/bin/sling` - Git Bash: `"$(cygpath -u "$USERPROFILE")/.sling/bin/sling.exe"` - PowerShell: `& "$HOME\.sling\bin\sling.exe"` Check: `sling --version`. ### If your tool blocks the install Some agents block downloads or `curl | bash` (for example Claude Code in auto mode). Do not look for a way around the block. Show the person one line. Ask them to approve it, or to run it. In Claude Code, they can type `!` and then the line. - macOS / Linux / WSL / Git Bash: `curl -fsSL https://slingdata.io/install.sh | bash` - PowerShell: `irm https://slingdata.io/install.ps1 | iex` Then continue with `sling --version`. ## 4. Load the Sling skills sling skills It prints an index of the Sling skills. Read a skill only when the task needs it: sling skills sling-replications sling skills sling-replications/CDC.md If `sling skills` does not exist (an error, or the general help text), read the skills from GitHub. In PowerShell, use `irm` with the same URL: curl -fsSL https://raw.githubusercontent.com/slingdata-io/sling-cli/main/core/sling/assist/skills/sling/SKILL.md For other skills, change `sling/SKILL.md` to `sling-replications/SKILL.md`, `sling-pipelines/SKILL.md`, `sling-api-specs/SKILL.md` or `sling-platform/SKILL.md`. The skills name MCP tools. If you do not have the Sling MCP tools, use these commands: | MCP tool action | CLI command | |---|---| | connection list | `sling conns list` | | connection test | `sling conns test NAME` | | connection discover | `sling conns discover NAME` | | database query | `sling conns exec NAME "select ..."` | | replication run | `sling run -r replication.yaml` | | pipeline run | `sling run -p pipeline.yaml` | ## 5. Ask one question If the prompt names a Sling Platform project, do step 7 first. Then ask if the person wants a first pipeline. Else ask: "How do you want to start?" 1. CLI only: run Sling on this computer. 2. Live demo: see the Platform with sample data, no sign-up: https://demo.slingdata.io 3. Platform: the web app with schedules, monitoring and alerts. Start free: https://slingdata.io/platform 4. Talk to us: https://slingdata.io/contact For 2 or 4, give the link. Stop, unless the person also wants the CLI. For 1, do step 6. For 3, do step 6, then step 7. ## 6. Make a first pipeline macOS / Linux / WSL / Git Bash: mkdir -p ~/sling-quickstart && cd ~/sling-quickstart PowerShell: New-Item -ItemType Directory -Force "$HOME\sling-quickstart" | Out-Null; Set-Location "$HOME\sling-quickstart" 1. Run `sling conns list`. Ask which source and which target to use. 2. Add each new connection with key=value pairs and without the secret: sling conns set MY_PG type=postgres host=db.example.com port=5432 user=app database=sales Ask the person to add the password to `~/.sling/env.yaml` under `MY_PG`, or as an environment variable. In PowerShell, do not build long quoted strings or URLs. Use key=value pairs, or edit `env.yaml` as a file. 3. If the person has no database, offer a local DuckDB file as the target: `sling conns set QUICKSTART_DUCKDB type=duckdb instance=./quickstart.duckdb` 4. Test each connection: `sling conns test MY_PG`. 5. Write `replication.yaml` in the folder. Use the `sling-replications` skill. Start with one or two small streams. 6. Run it: `sling run -r replication.yaml`. Show the result to the person. ## 7. Connect to the Sling Platform Do this step when the person picked the Platform, or when the prompt names a project, for example: `connect Sling to my Sling Platform project "Acme Analytics" (id: acme-analytics)`. 1. Look for a project token. Do not print it. - bash: `[ -n "$SLING_PROJECT_TOKEN" ] && echo set` - PowerShell: `[bool]$env:SLING_PROJECT_TOKEN` - env.yaml: `grep -c SLING_PROJECT_TOKEN ~/.sling/env.yaml` (PowerShell: `Select-String -Quiet SLING_PROJECT_TOKEN "$HOME\.sling\env.yaml"`) 2. If you found a token, run `sling platform status`. Check that it shows the project id from the prompt. 3. If there is no token, or the token is for a different project, run `sling platform login --project `. It opens a browser. The person signs in there. 4. If `sling platform login` does not exist, ask the person to make a project token in the Platform (Settings, Tokens) and to add it to `~/.sling/env.yaml` themselves: variables: SLING_PROJECT_TOKEN: Then run `sling platform status` again. 5. Never ask for the token in the chat. ## 8. Next sessions The skills that you read help only in this session. Offer this command, and run it only if the person agrees: sling assist setup It installs the Sling skills and the Sling MCP server in the agent for the next sessions.