Skip to content

Improve CliConfig / CliClient constructor naming and discoverability #1686

@Keinberger

Description

@Keinberger

Context

From PR #1642 discussion, questions were raised about the naming and structure of CliConfig and CliClient constructors.

Current API

  • CliConfig::default() - creates a config with default relative paths
  • CliConfig::from_system() - loads config from local/global .miden directories (recommended)
  • CliClient::from_system_user_config() - creates a client using CLI config discovery (recommended)

Feedback

  1. The naming from_system() and from_system_user_config() doesn't clearly convey these are the recommended constructors
  2. The role of CliConfig::default() vs from_system() may be confusing to users

Current constraints

  • Default::default() is used by the figment Provider trait impl (config.rs:71) and the init command (init.rs:167)
  • Using default() for filesystem I/O would be non-idiomatic in Rust

Potential approaches

  • Rename to more intuitive names (e.g., CliClient::new(), CliConfig::load())
  • Keep current naming but improve documentation
  • Restructure to make the recommended path more obvious

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    cliRelated to the CLI

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions