Skip to content

Revamp CLI serve syntax#45

Merged
chocolatkey merged 4 commits into
developfrom
revamped-serve-syntax
Jul 7, 2025
Merged

Revamp CLI serve syntax#45
chocolatkey merged 4 commits into
developfrom
revamped-serve-syntax

Conversation

@chocolatkey

@chocolatkey chocolatkey commented Jul 7, 2025

Copy link
Copy Markdown
Member

This changes the current readium serve <directory> [flags] syntax, moving the directory parameter to a --file-directory flag.
It also adds a --scheme/-s flag that accepts a list of schemes to enable for accessing content (file, http, https, s3, gs). file is enabled by default. If a scheme is not enabled, but relevant flags are specified, warnings are logged to help with troubleshooting. Certain schemes also require certain relevant flags.
To help with migration, an explanatory message is displayed if a <directory> argument is still provided (no arguments expected, base directory for local files is now set with a flag).
The Docker container has been modified to no longer embed any test publications, and instead by default run service http and https schemes only.

Example commands:

readium serve --s3-endpoint https://xxx --s3-access-key yyy --s3-secret-key zzz -s s3
readium serve --file-directory ./publications
readium serve -s http,https

Closes #23

@HadrienGardeur

Copy link
Copy Markdown
Member

Since file is used by default, is there a default directory as well?

@chocolatkey

Copy link
Copy Markdown
Member Author

@HadrienGardeur There is not. If you run the command without any arguments you will get Error: file scheme is enabled, but no local directory was specified with the --file-directory flag

@HadrienGardeur HadrienGardeur left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chocolatkey chocolatkey merged commit 56ed5a9 into develop Jul 7, 2025
4 checks passed
@chocolatkey chocolatkey deleted the revamped-serve-syntax branch July 7, 2025 15:02
ampasowa pushed a commit to ampasowa/cli that referenced this pull request Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for HTTP/HTTPS/S3/GCS should require an optional flag

2 participants