Skip to content

feat(cli): make --config a global option - #243

Open
YuMo12268 wants to merge 1 commit into
stack-rs:suite-agentfrom
YuMo12268:global-config
Open

YuMo12268 wants to merge 1 commit into
stack-rs:suite-agentfrom
YuMo12268:global-config

Conversation

@YuMo12268

Copy link
Copy Markdown

Summary

  • Make --config a global CLI option shared by all runtime modes
  • Allow --config to be specified at different subcommand levels
  • Forward the global config path to client, coordinator, worker, agent, and manager-spawned workers
  • Update manager process detection to recognize workers started with root-level --config
  • Update client, coordinator, worker, and manager guides

@YuMo12268

Copy link
Copy Markdown
Author

@un-lock-able Could you please review this PR? Thanks!

@un-lock-able
un-lock-able self-requested a review September 17, 2026 07:36

@un-lock-able un-lock-able left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This PR may need more discussion before merging.

Comment thread guide/src/guide/client.md

```md
DEFAULT <- `$CONFIG_DIR`/mitosis/config.toml <- config file specified by `cli.config` or loal `config.toml` <- env prefixed by `MITO_` <- cli arguments
DEFAULT <- `$CONFIG_DIR`/mitosis/config.toml <- config file specified by the root-level `--config` option or loal `config.toml` <- env prefixed by `MITO_` <- cli arguments

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What is "loal config.toml"?

This command:

- Lists all currently running `mito worker` processes
- Lists all currently running worker processes, including those started with the root-level `--config` option

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No need to mention the global --config option here.

Comment thread netmito/src/manager.rs
use crate::config::{manager::ManagerCommand, ManagerConfigCli, WorkerConfigCli};
use crate::error;

const WORKER_PROCESS_PATTERN: &str = r"mito( --config(=[^ ]+| [^ ]+))? worker( |$)";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This may need some more discussion. Will this match command like bash mito ...?

@un-lock-able

Copy link
Copy Markdown

Making config global will making merging the config using figment and serializing the config tedious. We will keep the current behavior for now.

This branch has not been deployed

No deployments
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.

2 participants