Merged
Conversation
Extract shared ArgsOpt struct and load_args helper into args.rs to deduplicate init-args handling across canister install, canister call, and deploy. CLI flags take priority over manifest init_args when deploying a single canister. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The type is used for both canister install and call args, not just init args. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Updates InitArgsFormat → ArgsFormat in JSON schemas and CLI reference docs. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
icp deployicp deploy accepts install args
There was a problem hiding this comment.
Pull request overview
This PR extends the icp deploy command to accept initialization/install arguments via CLI flags (matching icp canister install behavior), and generalizes the argument-format type to be shared across call/install/deploy paths.
Changes:
- Added
--args,--args-file, and--args-formattoicp deploy, with CLI args taking precedence over manifestinit_args. - Extracted a reusable
ArgsOpt(andload_args) for shared CLI arg parsing/encoding logic. - Renamed
InitArgsFormattoArgsFormatand updated Rust code + JSON schemas accordingly.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/schemas/icp-yaml-schema.json | Renames schema def from InitArgsFormat to ArgsFormat and updates $refs. |
| docs/schemas/environment-yaml-schema.json | Same schema rename/update for environment manifests. |
| docs/schemas/canister-yaml-schema.json | Same schema rename/update for canister manifests. |
| docs/reference/cli.md | Documents new icp deploy args flags. |
| crates/icp/src/project.rs | Updates manifest init-args resolution to use ArgsFormat. |
| crates/icp/src/manifest/project.rs | Updates tests to use ArgsFormat. |
| crates/icp/src/manifest/mod.rs | Re-exports ArgsFormat instead of InitArgsFormat. |
| crates/icp/src/manifest/canister.rs | Renames enum to ArgsFormat and updates manifest types/tests. |
| crates/icp/src/lib.rs | Updates InitArgs encoding to use ArgsFormat. |
| crates/icp-cli/src/commands/args.rs | Introduces ArgsOpt and shared load_args helper. |
| crates/icp-cli/src/commands/deploy.rs | Adds ArgsOpt to deploy and applies CLI-over-manifest precedence. |
| crates/icp-cli/src/commands/canister/install.rs | Refactors install args handling to use ArgsOpt. |
| crates/icp-cli/src/commands/canister/call.rs | Switches to ArgsFormat and reuses load_args for file/inline parsing. |
| crates/icp-cli/tests/deploy_tests.rs | Adds deploy test cases covering inline args, args file, hex format, and multi-canister failure. |
| CHANGELOG.md | Notes the new deploy flags feature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…gs field descriptions Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
adamspofford-dfinity
approved these changes
Apr 8, 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
--args,--args-file, and--args-formatflags toicp deployto pass install arguments at the command line, overridinginit_argsin the manifestArgsOptstruct (grouping--args,--args-file,--args-format) shared byicp canister installandicp deployInitArgsFormattoArgsFormatto reflect its broader useTest plan