Skip to content

feat(cli): allow runner configuration to be an object with cwd and args#13811

Merged
Legend-Master merged 9 commits into
tauri-apps:devfrom
mhbagheri-99:improve-runner-configuration
Jul 13, 2025
Merged

feat(cli): allow runner configuration to be an object with cwd and args#13811
Legend-Master merged 9 commits into
tauri-apps:devfrom
mhbagheri-99:improve-runner-configuration

Conversation

@mhbagheri-99
Copy link
Copy Markdown
Contributor

This PR implements the feature requested in #13779 to allow the "runner" configuration in tauri.conf.json to be either a string (existing behavior) or an object with additional properties.

Changes

  • Enhanced the runner configuration to support an object format with the following properties:
    • cmd: The command to execute (equivalent to the previous string format)
    • cwd: Optional working directory to run the command from
    • args: Optional array of arguments to pass to the runner

Example Usage

The runner can now be configured as an object:

{
  "build": {
    "runner": {
      "cmd": "my_custom_cargo",
      "cwd": "/path/to/project",
      "args": ["--quiet", "--offline"]
    }
  }
}

Or continue using the existing string format for backwards compatibility:

{
  "build": {
    "runner": "cargo"
  }
}

Backwards Compatibility

This change maintains full backwards compatibility - existing configurations using a string for the runner will continue to work as before.

Closes #13779


Replaces runner String with RunnerConfig in CLI and config, allowing advanced runner configuration via string or object with cmd, cwd, and args. Updates schema and usage to support new format, and adds tests for serialization, deserialization, and API. Enables more flexible build and run command customization.
Cleaned up the test module in config.rs by removing the unused RunnerConfig import from two test functions.
@mhbagheri-99 mhbagheri-99 requested a review from a team as a code owner July 11, 2025 22:51
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jul 12, 2025

Package Changes Through 2f39a12

There are 6 changes which include @tauri-apps/cli with patch, tauri-cli with minor, @tauri-apps/api with patch, tauri-bundler with patch, tauri with minor, tauri-utils with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.6.0 2.6.1
tauri-utils 2.5.0 2.6.0
tauri-bundler 2.5.0 2.5.1
tauri-runtime 2.7.0 2.7.1
tauri-runtime-wry 2.7.1 2.7.2
tauri-codegen 2.3.0 2.3.1
tauri-macros 2.3.1 2.3.2
tauri-plugin 2.3.0 2.3.1
tauri-build 2.3.0 2.3.1
tauri 2.6.2 2.7.0
@tauri-apps/cli 2.6.2 2.6.3
tauri-cli 2.6.2 2.7.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

mhbagheri-99 and others added 2 commits July 12, 2025 22:31
Updates related tests in tauri-utils to improve readability and maintain consistency. Minor import reordering in tauri-cli for clarity.
Legend-Master
Legend-Master previously approved these changes Jul 13, 2025
Copy link
Copy Markdown
Contributor

@Legend-Master Legend-Master left a comment

Choose a reason for hiding this comment

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

Thanks! Just a nitpick

Comment thread crates/tauri-utils/src/config.rs Outdated
Relocated the RunnerConfig enum and its associated implementations to appear before the BuildConfig definition. This improves code organization and logical grouping of configuration-related types.
@Legend-Master Legend-Master merged commit 33d0793 into tauri-apps:dev Jul 13, 2025
27 checks passed
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.

[feat] Allow "runner" in tauri build config to be an object

2 participants