Skip to main content

Bulk-edit Storylane demos (text and AI voiceovers) from the command line via an Excel round-trip.

Project description

slcli — Storylane CLI

Bulk-edit Storylane demos from the command line.

slcli lets you export a demo's text and AI voiceovers to an Excel spreadsheet, edit them offline, and push the changes back. It's significantly faster than clicking through every widget in the web UI when a demo has more than a handful of steps.

Unofficial. This tool talks to Storylane's private API — the same one their web app uses — and is not endorsed by Storylane. Behaviour may break if their API changes.

Install

pipx install storylane-cli

Or with uv:

uv tool install storylane-cli

The installed command is slcli (the PyPI package name is namespaced, but the binary stays short).

Or run without installing

For a one-off invocation, uvx fetches and executes the package ephemerally:

uvx storylane-cli login
uvx storylane-cli export <project-id>

Under uvx the command is storylane-cli rather than slcli, since uvx runs the script whose name matches the package.

Quick start

# 1. Log in once (the auth token is cached in your OS keyring).
slcli login

# 2. Export a demo's text content to an Excel file.
slcli export <project-id>

# 3. Open output/texts.xlsx, fill in the `new text` and/or `new voiceover`
#    columns on the rows you want to change. The other columns are protected.

# 4. Push the edits back.
slcli update

The project ID is the UUID in the demo's URL inside the Storylane web app — e.g. https://app.storylane.io/project/78f4ee34-51fd-11f1-84bd-e41fd5b9abcb.

Commands

slcli login

Prompts for your Storylane email and password, calls POST /api/v1/login, and stores the returned bearer token in your OS keyring (macOS Keychain, Windows Credential Manager, or Secret Service on Linux). All subsequent commands use the cached token silently.

slcli login                       # interactive
slcli login --email you@corp.com  # skip the email prompt

slcli logout

Clears the cached token from the keyring.

slcli export <project-id>

Fetches the project and writes output/texts.xlsx with one row per widget. Columns include the widget's HTML and markdown text, the page URL, the CTA label, and two empty editable columns: new text and new voiceover. The sheet is locked except for those two columns, so you can't accidentally damage the metadata columns that slcli update uses to identify widgets.

slcli export <project-id>
slcli export -x demo-edits.xlsx <project-id>   # custom output path
slcli export -o ./dump <project-id>            # also save the raw API JSON

slcli update

Reads an edited xlsx and PATCHes each widget that has a non-empty new text or new voiceover cell. Markdown in new text is rendered to HTML before being sent. new voiceover cells trigger a TTS regeneration: the text goes to Storylane's TTS endpoint, the resulting mp3 is uploaded through their S3 bucket, and the widget's audio_url, media_duration, and transcription_options.prompt are updated together.

The project ID is read from the xlsx — no need to repeat it.

slcli update                                        # read output/texts.xlsx
slcli update -x demo-edits.xlsx                     # custom input
slcli update --yes                                  # skip the confirmation prompt
slcli update --voice-name brian                     # voice for widgets that have none
slcli update --voice-name matilda --voice-override  # force this voice everywhere
slcli update --voice-id nPczCjzI2devNBz1zQrb        # by id if you prefer

By default, when a widget already has an assigned voice, slcli update keeps it and --voice-name / --voice-id only apply as a fallback for widgets that have no voice yet. Pass --voice-override to force the CLI-provided voice everywhere.

slcli voices

Lists the TTS voices available in your Storylane account (typically over 100). Useful for finding a voice_id or a voice_name.

slcli voices                       # pretty table on stdout
slcli voices -x voices.xlsx        # browsable spreadsheet, includes preview_url
slcli voices --all                 # include legacy/deprecated voices

How it works

slcli authenticates by POST /api/v1/login and reuses the returned auth_token as a bearer token for the rest of Storylane's private API. The token lives in your OS keyring; --key overrides it for one-off invocations without touching the cache.

  • Export pulls GET /api/v1/company/projects/<id> plus the pages and themes endpoints, then writes the xlsx using save-as-xlsx.
  • Update reads the xlsx with openpyxl, converts markdown with markdown-it-py, regenerates audio via POST /api/v1/ai/transcriptions → S3 upload → POST /api/v1/uploads, computes media_duration locally with mutagen, and PATCHes each widget at /api/v1/company/projects/<pid>/flows/<fid>/widgets/<wid>.
  • Voices is a thin wrapper around GET /api/v1/ai/transcriptions/voices.

If a request returns 401, slcli prints a hint telling you to run slcli logout (which clears the stale token so the next command re-prompts via slcli login).

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

storylane_cli-0.1.1.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

storylane_cli-0.1.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file storylane_cli-0.1.1.tar.gz.

File metadata

  • Download URL: storylane_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for storylane_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 55393ba8ef32ca3611776dca58edb3322246899bcbb47fb46c2baf3e7764a1c0
MD5 b48f1401143b3637e73089d438921397
BLAKE2b-256 78936628c6c5dcd288b64c2342a7eeaed2f61e3b1c19b194db31ac1328f02d3c

See more details on using hashes here.

File details

Details for the file storylane_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: storylane_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.1 {"installer":{"name":"uv","version":"0.11.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for storylane_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e2bf9515b3fd76b3a6097e4b83ffddfd1acc752e68e086480b46a4f4cca1a3a2
MD5 92f267301058bbbb1dbd956817ba8a91
BLAKE2b-256 782610af0b1101d13b5b5f50a4bdf15d38aba981a64fdd21ee6b195e58dcdf55

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page