Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
24c32c4
Add multi-profile auth: login --name, logout --name, auth list, auth …
514sid Jun 6, 2026
7062276
Return ProfileNotFound when active profile missing, show actionable e…
514sid Jun 6, 2026
ca9d932
Feat: add 'me' command to show current profile info
514sid Jun 6, 2026
ffdf3e3
Fix: apply rustfmt formatting
514sid Jun 6, 2026
4b9d07c
Clean up authentication imports and error message
514sid Jul 23, 2026
3920cb0
Make active-profile selection deterministic and handle logout errors
514sid Jul 23, 2026
8460079
Harden token store writes: atomic rename and 0o600 permissions
514sid Jul 23, 2026
4922ee9
Share authenticated client and accept object-or-array in profile info
514sid Jul 23, 2026
dcfb34c
Extract profile table helper and stop exposing tokens from list_profiles
514sid Jul 23, 2026
562930e
Fetch per-profile info in parallel
514sid Jul 23, 2026
45c492c
Clarify switch no-arg behavior and me profile source
514sid Jul 23, 2026
6acd7b3
Extract resolve_login_name for the --name safety check
514sid Jul 23, 2026
d137cdd
Add tests for auth safety checks and profile-info parsing
514sid Jul 23, 2026
4ae31a3
Apply rustfmt
514sid Jul 23, 2026
0c69e9f
Regenerate CommandLineHelp.md for auth switch docs
514sid Jul 23, 2026
c6f3bba
Merge remote-tracking branch 'origin/master' into feature/multi-token…
514sid Jul 23, 2026
6297cf6
Harden the token store against data loss and tighten the write path
514sid Jul 23, 2026
df627f5
Fix login regression and profile command UX
514sid Jul 23, 2026
52d6794
Document profiles and refresh generated CLI help
514sid Jul 23, 2026
a50ee24
Give a readable, actionable error for a corrupt credentials file
514sid Jul 23, 2026
855bca3
Treat an empty ~/.screenly as an empty store, not a corrupt one
514sid Jul 23, 2026
79c8aa6
Merge remote-tracking branch 'origin/master' into feature/multi-token…
514sid Aug 25, 2026
b65363d
Make `auth list` honor --output when no profiles are stored
514sid Aug 25, 2026
594e270
Don't promote another profile when logging out of the active one
514sid Aug 25, 2026
5f580c7
Report authentication errors the same way from every auth command
514sid Aug 25, 2026
966a250
Clean up the token temp file on a failed write and sync the directory
514sid Aug 25, 2026
5adecab
Store tokens in a BTreeMap for stable file order
514sid Aug 25, 2026
6dca332
Render `auth list` with prettytable like every other list command
514sid Aug 25, 2026
1f61080
Bound the profile-info requests with a timeout
514sid Aug 25, 2026
8c4973e
Treat an empty API_TOKEN as unset
514sid Aug 25, 2026
93ff498
Update the logout help text for profiles
514sid Aug 25, 2026
3e368f3
Document the store's concurrency and Windows permission limits
514sid Aug 25, 2026
607324f
Support non-interactive login instead of panicking on a non-tty
514sid Aug 25, 2026
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
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,47 @@ $ API_SERVER_NAME=local cargo build --release

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

## Authentication and profiles

Credentials are stored in `~/.screenly` as named profiles, with one profile active at a time. This lets you keep several tokens (for example one per workspace) and switch between them.

```bash
# Log in. On a fresh install this creates the "default" profile; with a
# profile already active it updates that profile (e.g. after a token rotation).
$ screenly login

# Log in under a specific profile name.
$ screenly login --name work

# Log in without a prompt, for scripts and CI. --token-stdin is optional when
# stdin is already a pipe or a file, and required to skip the prompt on a
# terminal.
$ echo "$SCREENLY_TOKEN" | screenly login --token-stdin --name ci

# Show the profile you are currently authenticated as.
$ screenly me

# List stored profiles (the active one is marked with *). Honors --output.
$ screenly auth list

# Switch the active profile.
$ screenly auth switch work

# Remove a profile. Without --name, removes the active one.
$ screenly logout
$ screenly logout --name work
```

Removing the active profile leaves no profile active, even when others are still stored. The CLI will not pick a replacement for you, because doing so would silently point the next command at a different workspace. Run `screenly auth switch <name>` to choose one.

The `API_TOKEN` environment variable overrides the stored profiles when set, so `me` and every other command authenticate with that token regardless of the active profile.

Plain-text `~/.screenly` files from older versions are migrated to the profile format automatically on first write.

If `~/.screenly` becomes malformed (for example from a hand-edit), the CLI reports the problem and leaves the file untouched rather than discarding credentials. Fix the file's YAML, or delete it and run `screenly login` to start fresh.

The file holds every profile's token in plain text. On Linux and macOS it is created with `0600` permissions, so only your user can read it. On Windows it inherits the permissions of your home directory, so treat it the way you would any other credentials file. Avoid running two `login` commands at the same time: the CLI replaces the file atomically, but it does not lock it, so simultaneous writes can drop one of the two profiles.

## Output Formats

All list and get commands support three output formats via the global `--output` (`-o`) flag:
Expand Down
64 changes: 60 additions & 4 deletions docs/CommandLineHelp.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ This document contains the help content for the `screenly` command-line program.
* [`screenly`↴](#screenly)
* [`screenly login`↴](#screenly-login)
* [`screenly logout`↴](#screenly-logout)
* [`screenly me`↴](#screenly-me)
* [`screenly auth`↴](#screenly-auth)
* [`screenly auth list`↴](#screenly-auth-list)
* [`screenly auth switch`↴](#screenly-auth-switch)
* [`screenly screen`↴](#screenly-screen)
* [`screenly screen list`↴](#screenly-screen-list)
* [`screenly screen get`↴](#screenly-screen-get)
Expand Down Expand Up @@ -57,7 +61,9 @@ Command line interface is intended for quick interaction with Screenly through t
###### **Subcommands:**

* `login` — Logs in with the provided token and stores it for further use if valid. You can set the API_TOKEN environment variable to override the stored token
* `logout` — Logs out and removes the stored token
* `logout` — Removes a stored authentication profile. Removing the active profile leaves no profile active; other profiles are kept
* `me` — Show information about the currently authenticated profile
* `auth` — Manage stored authentication profiles
* `screen` — Screen related commands
* `asset` — Asset related commands
* `playlist` — Playlist related commands
Expand Down Expand Up @@ -85,15 +91,65 @@ Command line interface is intended for quick interaction with Screenly through t

Logs in with the provided token and stores it for further use if valid. You can set the API_TOKEN environment variable to override the stored token

**Usage:** `screenly login`
**Usage:** `screenly login [OPTIONS]`

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

* `--name <NAME>` — Profile name to store the token under. Defaults to the active profile, or "default" on a fresh install
* `--token-stdin` — Read the token from stdin instead of prompting, for scripts: `echo "$TOKEN" | screenly login --token-stdin`. Implied when stdin is not a terminal



## `screenly logout`

Logs out and removes the stored token
Removes a stored authentication profile. Removing the active profile leaves no profile active; other profiles are kept

**Usage:** `screenly logout [OPTIONS]`

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

* `--name <NAME>` — Profile name to remove. Removes the active profile if not specified



## `screenly me`

Show information about the currently authenticated profile

**Usage:** `screenly me`



## `screenly auth`

Manage stored authentication profiles

**Usage:** `screenly auth <COMMAND>`

###### **Subcommands:**

* `list` — List stored authentication profiles
* `switch` — Switch the active authentication profile



## `screenly auth list`

List stored authentication profiles

**Usage:** `screenly auth list`



## `screenly auth switch`

Switch the active authentication profile

**Usage:** `screenly auth switch [NAME]`

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

**Usage:** `screenly logout`
* `<NAME>` — Profile name to activate. If omitted, the available profiles are listed and the command exits with an error



Expand Down
Loading
Loading