Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 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
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
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).

## 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

# 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
```

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.

## Output Formats

All list and get commands support three output formats via the global `--output` (`-o`) flag:
Expand Down
59 changes: 57 additions & 2 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 @@ -58,6 +62,8 @@ Command line interface is intended for quick interaction with Screenly through t

* `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
* `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,64 @@ 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



## `screenly logout`

Logs out and removes the stored token

**Usage:** `screenly logout`
**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:**

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



Expand Down
Loading
Loading