howdy/ui/cli

The gleam run -m howdy/ui command line.

Options: --to=<dir> chooses the directory, --force overwrites, --dry-run shows what would change without changing it, --install runs gleam add for missing packages, and --registry=<url or dir> takes entries from another registry published with registry.

Types

Something that can be copied: a built-in entry with its source, or an entry from another registry.

pub type Item {
  Item(
    name: String,
    kind: String,
    category: String,
    description: String,
    module: String,
    source: String,
    dependencies: List(String),
    packages: List(String),
    origin: String,
  )
}

Constructors

  • Item(
      name: String,
      kind: String,
      category: String,
      description: String,
      module: String,
      source: String,
      dependencies: List(String),
      packages: List(String),
      origin: String,
    )

    Arguments

    origin

    Where it came from, for the header of a copy.

What a command wants done, before any file is touched.

pub type Options {
  Options(
    names: List(String),
    to: option.Option(String),
    force: Bool,
    dry_run: Bool,
    install: Bool,
    registry: option.Option(String),
    insecure: Bool,
    theme: option.Option(String),
    out: option.Option(String),
  )
}

Constructors

Values

pub fn execute(args: List(String)) -> Result(String, String)

Run a command and return its output, or the reason it could not.

pub fn generated(
  item: Item,
  items: List(Item),
  module_path: String,
) -> String

The file add writes: the source with a header, and its imports of the entries it depends on pointed at the copies beside it.

pub fn item_json(item: Item) -> json.Json
pub fn run(args: List(String)) -> Nil

Run a command and print what happened.

pub fn template(module: String) -> Result(String, String)

The shipped source of a module: from the project’s build directory for a hex dependency, from the path in manifest.toml for a path dependency, or from src when developing howdy_ui itself.

pub fn version() -> String

This package’s version, written into every generated file. Read from the loaded application, so it cannot drift from gleam.toml; the constant is only for a raw Erlang caller that never loaded it.

✨ Search Document