Module: Ace::B36ts::CLI

Extended by:
Support::Cli::RegistryDsl
Defined in:
lib/ace/b36ts/cli.rb,
lib/ace/b36ts/cli/commands/config.rb,
lib/ace/b36ts/cli/commands/decode.rb,
lib/ace/b36ts/cli/commands/encode.rb

Overview

CLI interface for ace-b36ts using ace-support-cli

This follows the Hanami pattern with all commands in CLI::Commands

namespace.

Examples:

Encode a timestamp

$ ace-b36ts encode "2025-01-06 12:30:00"
i50jj3

Decode a compact ID

$ ace-b36ts decode i50jj3
2025-01-06 12:30:00 UTC

Show configuration

$ ace-b36ts config
year_zero: 2000
alphabet: 0123456789abcdefghijklmnopqrstuvwxyz

Defined Under Namespace

Modules: Commands

Constant Summary collapse

PROGRAM_NAME =
"ace-b36ts"
REGISTERED_COMMANDS =
[
  ["encode", "Encode timestamp to compact ID"],
  ["decode", "Decode compact ID to timestamp"],
  ["config", "Show current configuration"]
].freeze
HELP_EXAMPLES =
[
  "ace-b36ts encode                          # Generate ID from now",
  "ace-b36ts encode 2024-01-15T10:30:00Z     # Encode specific time",
  "ace-b36ts decode abc123                   # Decode ID to timestamp"
].freeze