Repository navigation
feat(cli): accept init-script files on create - #573
Merged
Merged
Conversation
Contributor
📋 Check Results✨ JS SDK - Code FormattingShow format check results🔍 JS SDK - TypeScript Type CheckShow type check output🧪 JS SDK - Test ResultsShow test output📝 JS SDK - Lint CheckShow lint results🌐 JS SDK - Browser CompatibilityShow browser test results🌐 Browser Compatibility ReportBrowser compatibility tests completed across:
The SDK has been verified to work in modern browser environments. Check run: https://github.com/Phala-Network/phala-cloud/actions/runs/42635789755 |
Leechael
marked this pull request as ready for review
November 9, 2026 11:34
pacoyang
previously approved these changes
Nov 9, 2026
Leechael
force-pushed
the
feat/cli-init-script
branch
from
November 9, 2026 14:27
ed573e1 to
830a6a3
Compare
--init-script still takes platform slugs (docker_cleanup, env_merge) for create and update. Other values are script files whose contents are sent as compose_file.init_script on create, in argument order. A value that matches a slug is always a slug; use ./docker_cleanup for a same-named file. Mixing slugs and files is rejected. File paths cannot be used with --cvm-id. At most five files. A mistyped slug is reported as unknown before mix or count errors. Help still describes slugs only.
readInitScriptFiles already asserts each path exists. Read the bytes with readFileSync instead of calling readScriptFile again (which re-checked existence and used the path as a dummy error message). readScriptFile remains the helper for --pre-launch-script.
Leechael
force-pushed
the
feat/cli-init-script
branch
from
November 9, 2026 14:33
830a6a3 to
3023762
Compare
pacoyang
approved these changes
Nov 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
phala deploy --init-scriptstill takes the platform slugsdocker_cleanupandenv_mergeon create and update. Other values are treated as script files. On create, the file contents are sent ascompose_file.init_scriptin argument order. A value that matches a slug is always a slug; use./docker_cleanupto send a file with that name.Behavior
--cvm-id(raw scripts are create-only). Slug updates are unchanged.--app-composechecks. A mistyped slug on update is reported as unknown and notes that file paths are create-only.--clear-init-scriptsis unchanged.The JS SDK provision request keeps
compose_file.init_scripton the wire (it is no longer an undeclared passthrough-only field).Out of scope
File-mode wording is not added to
--helpor examples.Test plan
compose_file.init_scriptin order, noinit_scripts--cvm-id+ file → error--init-scriptline has no file-mode wording