moonbitstack/moonctl/cli does not have a README file

    Command

    pub(all) struct Command {
    name : String
    usage : String
    summary : String
    }

    One command: what it is called, the line that shows how to call it, and one sentence saying what it does.

    Config

    pub(all) struct Config {
    version : Int
    home : String
    remote : String
    branch : String
    style : String
    templates : Array[String]
    }

    One configuration: the fields mctl understands. version is the file format, not the mctl version, and it goes up when migrate_config learns a new shape.

    TemplateEntry

    pub(all) struct TemplateEntry {
    name : String
    kind : String
    description : String
    path : String
    }

    One template: the name a user types, the kind of spec it reads, one sentence on what it produces, and the directory under the template home it lives in.

    bug_report

    fn bug_report(title : String, version : String, rows : Array[(String, String)]) -> String

    mctl bug: a report with the environment filled in and the questions a maintainer would otherwise have to ask. title may be empty, in which case the report asks for one.

    command_names

    fn command_names() -> Array[String]

    The words a shell should complete at the first position.

    commands

    fn commands() -> Array[Command]

    Every command mctl accepts, in the order help prints them: the generators, the scaffolds, the spec tools, then the housekeeping.

    completion

    fn completion(shell : String) -> String

    A shell completion script for shell, or "" for a shell mctl has none for. Completion is generated from commands and subcommands, so a new command is completable the moment it is in the table.

    config_get

    fn config_get(c : Config, key : String) -> String?

    The value of one key, or None when mctl has no such key.

    config_keys

    fn config_keys() -> Array[String]

    The keys config get and config set accept.

    config_set

    fn config_set(c : Config, key : String, value : String) -> Config

    c with one key set. template appends — a config may name several — while a scalar key replaces what was there. An unknown key is returned unchanged, so a caller checks the key against config_keys first.

    config_text

    fn config_text(c : Config) -> String

    The configuration as the file it is stored in, with a comment saying what the file is for and where the keys come from.

    default_config

    fn default_config() -> Config

    The file mctl writes when there is none yet: the bundled library, the default branch, the gozero spelling.

    env_report

    fn env_report(version : String, rows : Array[(String, String)]) -> String

    mctl env: one line per setting, then a hint at what to change. rows pairs a setting with its value and, in parentheses, where it came from.

    find_template

    fn find_template(name : String) -> TemplateEntry?

    The template called name, or None.

    migrate_config

    fn migrate_config(text : String) -> (String, Array[String])

    A v1 configuration — the uppercase, environment-style keys mctl read before it had a file — rewritten as the current shape. Returns the new text and one line per key that changed, so mctl config migrate can say what it did.

    mod_pins

    fn mod_pins(mod : String) -> Array[(String, String)]

    The version strings of mod, as (name, version) pairs: every pin the file carries, in order.

    parse_config

    fn parse_config(text : String) -> Config

    Read a configuration. A key mctl does not know is kept out of the result rather than refused, so a file written by a newer mctl still loads. An empty or unreadable-text file is the default configuration.

    pin_module

    fn pin_module(mod : String, name : String, version : String) -> (String, String?)

    mod with name pinned at version, or mod unchanged when it does not pin that name. Returns the new text and the change it made, if any.

    pinned_version

    fn pinned_version(mod : String, name : String) -> String?

    The version name is pinned at in mod, or None when the file does not pin it.

    subcommands

    fn subcommands(name : String) -> Array[String]

    The second word of a command that takes a sub-command, for a completion script that completes two levels deep.

    template_detail

    fn template_detail(t : TemplateEntry) -> String

    mctl template show <name>: one entry, and where it sits in the library.

    template_table

    fn template_table() -> String

    mctl template list: a table a reader scans rather than a paragraph they read.

    templates

    fn templates() -> Array[TemplateEntry]

    The bundled library, in the order it is listed.

    templates_of

    fn templates_of(kind : String) -> Array[TemplateEntry]

    The templates of one kind — the ones a gen of that kind may pick.

    upgrade_pins

    fn upgrade_pins(mod : String, modules : Array[String], version : String) -> (String, Array[String])

    mctl upgrade <version>: every name in modules moved to version, plus one line per name that changed. A name the file does not pin is left alone and reported as skipped — pinning it would be a change the user did not ask for.

    usage_text

    fn usage_text(version : String) -> String

    The mctl help page: what mctl is, then one line per command, then the flags every generator shares.

    Powered by MoonBit

    Site sourceReport issueModulesSkillsBuild queueStatistics

    © 2026 mooncakes.io