Class CliState

java.lang.Object
io.aether.cli.CliState

public class CliState extends Object
Manages the persistent JSON state file (~/.aether-cli-state.json) for storing user preferences like aliases.
  • Constructor Details

    • CliState

      public CliState()
  • Method Details

    • load

      public void load()
      Loads the state from the JSON file on disk.
    • save

      public void save()
      Saves the current state (including all aliases) to the JSON file.
    • addAlias

      public void addAlias(String alias, String uuid)
      Adds a new alias and persists it to disk.
      Parameters:
      alias - The alias name.
      uuid - The UUID string.
    • getAliases

      public Map<String,String> getAliases()
      Returns:
      The map of user-defined aliases.
    • hasAlias

      public boolean hasAlias(String alias)
      Checks if a given alias exists.
      Parameters:
      alias - The alias name.
      Returns:
      true if the alias exists.
    • getUuidForAlias

      public String getUuidForAlias(String alias)
      Gets the UUID string for a given alias.
      Parameters:
      alias - The alias name.
      Returns:
      The UUID string or null if not found.