Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ path = "src/main.rs"
[dependencies]
anyhow = "1.0.65"
clap = { version = "4.0.17", features = ["derive", "cargo"] }
csv = "1"
clap-markdown = "0.1.4"
dirs = "6.0.0"
futures = "0.3.28"
Expand Down
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,38 @@ $ API_SERVER_NAME=local cargo build --release

Explore available commands [here](https://developer.screenly.io/cli/#commands).

## Output Formats

All list and get commands support three output formats via the global `--output` (`-o`) flag:

| Format | Flag | Description |
|--------|------|-------------|
| Table | `--output table` | Human-readable table (default) |
| JSON | `--output json` | JSON output |
| CSV | `--output csv` | CSV output, suitable for piping to files or other tools |

```bash
# Human-readable table (default)
$ screenly screen list

# JSON output
$ screenly --output json asset list

# CSV output saved to a file
$ screenly --output csv screen list > screens.csv

# JSON output saved to a file
$ screenly --output json screen list > screens.json
```

> [!NOTE]
> In debug builds, the CLI outputs log messages to stdout. Use `RUST_LOG=off` to suppress them
> when redirecting output to a file:
> ```bash
> $ RUST_LOG=off screenly --output csv screen list > screens.csv
> $ RUST_LOG=off screenly --output json screen list > screens.json
> ```

## MCP Server (AI Assistant Integration)

The Screenly CLI includes a built-in [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server, enabling AI assistants like Claude, Cursor, and others to interact with your Screenly digital signage network.
Expand Down
81 changes: 23 additions & 58 deletions docs/CommandLineHelp.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,18 @@ Command line interface is intended for quick interaction with Screenly through t

###### **Options:**

* `-j`, `--json` — Enables JSON output
* `-o`, `--output <OUTPUT>` — Output format: table (default), json, or csv

Default value: `table`

Possible values:
- `table`:
Human-readable table (default)
- `json`:
JSON output
- `csv`:
CSV output




Expand Down Expand Up @@ -105,45 +116,33 @@ Screen related commands

Lists your screens

**Usage:** `screenly screen list [OPTIONS]`

###### **Options:**

* `-j`, `--json` — Enables JSON output
**Usage:** `screenly screen list`



## `screenly screen get`

Gets a single screen by id

**Usage:** `screenly screen get [OPTIONS] <UUID>`
**Usage:** `screenly screen get <UUID>`

###### **Arguments:**

* `<UUID>` — UUID of the screen

###### **Options:**

* `-j`, `--json` — Enables JSON output



## `screenly screen add`

Adds a new screen

**Usage:** `screenly screen add [OPTIONS] <PIN> [NAME]`
**Usage:** `screenly screen add <PIN> [NAME]`

###### **Arguments:**

* `<PIN>` — Pin code created with registrations endpoint
* `<NAME>` — Optional name of the new screen

###### **Options:**

* `-j`, `--json` — Enables JSON output



## `screenly screen delete`
Expand Down Expand Up @@ -182,45 +181,33 @@ Asset related commands

Lists your assets

**Usage:** `screenly asset list [OPTIONS]`

###### **Options:**

* `-j`, `--json` — Enables JSON output
**Usage:** `screenly asset list`



## `screenly asset get`

Gets a single asset by id

**Usage:** `screenly asset get [OPTIONS] <UUID>`
**Usage:** `screenly asset get <UUID>`

###### **Arguments:**

* `<UUID>` — UUID of the asset

###### **Options:**

* `-j`, `--json` — Enables JSON output



## `screenly asset add`

Adds a new asset

**Usage:** `screenly asset add [OPTIONS] <PATH> <TITLE>`
**Usage:** `screenly asset add <PATH> <TITLE>`

###### **Arguments:**

* `<PATH>` — Path to local file or URL for remote file
* `<TITLE>` — Asset title

###### **Options:**

* `-j`, `--json` — Enables JSON output



## `screenly asset delete`
Expand Down Expand Up @@ -332,7 +319,7 @@ Time reference (ms): 32400000=9AM, 43200000=12PM, 61200000=5PM

Examples: TRUE - Always show $WEEKDAY IN {1, 2, 3, 4, 5} - Weekdays only $TIME BETWEEN {32400000, 61200000} - 9 AM to 5 PM NOT $WEEKDAY IN {0, 6} - Exclude weekends

**Usage:** `screenly playlist create [OPTIONS] <TITLE> [PREDICATE]`
**Usage:** `screenly playlist create <TITLE> [PREDICATE]`

###### **Arguments:**

Expand All @@ -357,21 +344,13 @@ Examples: TRUE - Always show $WEEKDAY IN {1,

Default: TRUE

###### **Options:**

* `-j`, `--json` — Enables JSON output



## `screenly playlist list`

Lists your playlists

**Usage:** `screenly playlist list [OPTIONS]`

###### **Options:**

* `-j`, `--json` — Enables JSON output
**Usage:** `screenly playlist list`



Expand Down Expand Up @@ -403,36 +382,28 @@ Deletes a playlist. This cannot be undone

Adds an asset to the end of the playlist

**Usage:** `screenly playlist append [OPTIONS] <UUID> <ASSET_UUID> [DURATION]`
**Usage:** `screenly playlist append <UUID> <ASSET_UUID> [DURATION]`

###### **Arguments:**

* `<UUID>` — UUID of the playlist
* `<ASSET_UUID>` — UUID of the asset
* `<DURATION>` — Duration of the playlist item in seconds. Defaults to 15 seconds

###### **Options:**

* `-j`, `--json` — Enables JSON output



## `screenly playlist prepend`

Adds an asset to the beginning of the playlist

**Usage:** `screenly playlist prepend [OPTIONS] <UUID> <ASSET_UUID> [DURATION]`
**Usage:** `screenly playlist prepend <UUID> <ASSET_UUID> [DURATION]`

###### **Arguments:**

* `<UUID>` — UUID of the playlist
* `<ASSET_UUID>` — UUID of the asset
* `<DURATION>` — Duration of the playlist item in seconds. Defaults to 15 seconds

###### **Options:**

* `-j`, `--json` — Enables JSON output



## `screenly playlist update`
Expand Down Expand Up @@ -482,11 +453,7 @@ Creates an Edge App in the store

Lists your Edge Apps

**Usage:** `screenly edge-app list [OPTIONS]`

###### **Options:**

* `-j`, `--json` — Enables JSON output
**Usage:** `screenly edge-app list`



Expand Down Expand Up @@ -539,7 +506,6 @@ Lists Edge App settings
###### **Options:**

* `-p`, `--path <PATH>` — Path to the directory with the manifest. Defaults to the current working directory
* `-j`, `--json` — Enables JSON output



Expand Down Expand Up @@ -583,7 +549,6 @@ Lists Edge App instances
###### **Options:**

* `-p`, `--path <PATH>` — Path to the directory with the manifest. Defaults to the current working directory
* `-j`, `--json` — Enables JSON output



Expand Down
Loading
Loading