> For the complete documentation index, see [llms.txt](https://docs.slingdata.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.slingdata.io/sling-platform/platform/cli-usage.md).

# Deploy from CLI

The `sling platform` command helps you manage projects on the Sling Data Platform. The older `sling platform` name still aliases here. It provides several subcommands for project management and job operations.

```bash
$ sling platform
platform - Interact with a project on the Sling Data Platform

See more details at https://docs.slingdata.io/

  Usage:
    platform [init|status|trial|jobs|executions|files|connections|sync]

  Subcommands: 
    init          create or link to a sling platform
    status        see project status
    trial         run Sling Platform locally in trial mode
    jobs          manage project jobs
    executions    manage project executions
    files         manage project files on the platform
    connections   manage project connections on the platform
    sync          Push local file changes

  Flags: 
    --version   Displays the program version string.
    -h --help      Displays help with available flag, subcommand, and positional value parameters.
```

## Prerequisites

* A valid Sling Project Token (`SLING_PROJECT_TOKEN` environment variable, obtained from the `Settings` section). Not required for `sling platform trial`.
* For `sling platform trial`, a platform license token (`SLING_PLATFORM_LICENSE`, from [dash.slingdata.io](https://dash.slingdata.io)).
* For self-hosted platform setups, the `SLING_PLATFORM_HOST` environment variable pointing to your platform server (e.g. `https://sling.mycompany.com`)

### Trial

```bash
export SLING_PLATFORM_LICENSE=<token>
sling platform trial
```

See [Trial mode](/sling-platform/platform.md#trial-mode).

## Commands

### Initialize Project

Links your local directory to a Sling project:

```bash
# navigate to the root folder of your project first
$ sling platform init
```

This command will:

* Create or link to an existing Sling project
* Generate a `.sling.json` file in your project directory
* Configure project settings like paths and ID

#### Project File (.sling.json)

The project configuration is stored in `.sling.json`:

```json
{
  "id": "project_id",
  "paths": ["subfolder1", "subfolder2"]
}
```

* `id`: The Sling project ID
* `paths`: Array of subfolders to monitor for files (relative to project root). This is optional. If not provided, the root directory will be used.

### Check Project Status

View the current project status and configuration:

```bash
$ sling platform status
```

This displays:

* Project ID and name
* Organization details
* Owner information
* Project folder location
* Configured project paths
* Additional project status details

### Manage Jobs

#### List Jobs

View all jobs in the project:

```bash
$ sling platform jobs list
```

Shows a table with:

* Job ID
* Name
* File Name
* Status
* Active status
* Schedule information

#### List Executions

See recent run history:

```bash
$ sling platform executions list
```

(Released builds may still show the short name `execs`.)

#### Trigger Job

Run a specific job by its ID:

```bash
$ sling platform jobs trigger job_123456
```

### Sync Files

Push local file changes to the Sling platform (one way sync):

```bash
$ sling platform sync [--force]
```

The sync command:

* Compares local files with remote versions
* Identifies new and modified files
* Prompts for confirmation before pushing changes (unless --force is used)
* Shows a summary of synced files

#### Options

* `--force`: Skip confirmation prompt and push changes immediately

## Examples

```bash
# Initialize a new project
$ sling platform init

# Check project status
$ sling platform status

# List all jobs
$ sling platform jobs list

# Trigger a specific job
$ sling platform jobs trigger job_abc123

# Sync local changes
$ sling platform sync

# Force sync without confirmation
$ sling platform sync --force
```

## Environment Variables

| Variable              | Description                                                                            | Required                    |
| --------------------- | -------------------------------------------------------------------------------------- | --------------------------- |
| `SLING_PROJECT_TOKEN` | Your project token, obtained from the **Settings** section of the Sling Platform       | Yes                         |
| `SLING_PLATFORM_HOST` | The URL of your self-hosted Sling Platform server (e.g. `https://sling.mycompany.com`) | Only for self-hosted setups |

### Cloud-Hosted (Default)

For Sling's cloud platform, you only need to set the project token:

```bash
export SLING_PROJECT_TOKEN="your_project_token_here"
```

### Self-Hosted Platform

If you are running a self-hosted Sling Platform, you must also set `SLING_PLATFORM_HOST` so the CLI knows where to validate your project token and communicate with the platform API:

```bash
export SLING_PLATFORM_HOST="https://sling.mycompany.com"
export SLING_PROJECT_TOKEN="your_project_token_here"
```

When `SLING_PLATFORM_HOST` is set, all platform commands (init, status, jobs, executions, sync, …) will communicate with your self-hosted server instead of the Sling cloud API.

## Notes

* The project token must be valid and have appropriate permissions
* File syncing only pushes changes from local to remote (not from remote to local)
* Jobs can be managed through both CLI and the Sling Platform interface
* Project paths are relative to the project root directory


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.slingdata.io/sling-platform/platform/cli-usage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
