Class: Pvectl::Commands::Config::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/pvectl/commands/config/command.rb,
sig/pvectl/commands/config/command.rbs

Overview

Registers the pvectl config command group with all subcommands.

Examples:

Commands::Config::Command.register(cli)

Class Method Summary collapse

Class Method Details

.register(cli) ⇒ void

This method returns an undefined value.

Registers the config command and all subcommands with the CLI.

Parameters:

  • the CLI application object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/pvectl/commands/config/command.rb', line 16

def self.register(cli)
  cli.desc "Manage pvectl configuration"
  cli.long_desc "    Manage pvectl configuration. Configuration uses kubeconfig-style\n    contexts to support multiple Proxmox clusters.\n\n    Configuration file location: ~/.pvectl/config\n\n    SUBCOMMANDS\n      config get-contexts       List all available contexts\n      config use-context NAME   Switch to a different context\n      config set-context NAME   Create or modify a context\n      config set-cluster NAME   Create or modify a cluster definition\n      config set-credentials NAME  Create or modify user credentials\n      config view               Display current configuration (secrets masked)\n\n    EXAMPLES\n      View current configuration:\n        $ pvectl config view\n\n      Switch to a different context:\n        $ pvectl config use-context production\n\n      Set up a new cluster:\n        $ pvectl config set-cluster prod --server=https://pve.example.com:8006\n        $ pvectl config set-credentials admin --token-id=root@pam!pvectl --token-secret=xxx\n        $ pvectl config set-context prod --cluster=prod --user=admin\n\n    NOTES\n      On first run, pvectl launches an interactive wizard if no config exists.\n\n      Environment variables (PROXMOX_HOST, PROXMOX_TOKEN_ID, etc.) override\n      config file values. Use PVECTL_CONTEXT to override the active context.\n\n    SEE ALSO\n      pvectl help ping          Test connectivity after configuration\n  HELP\n  cli.command :config do |c|\n    UseContext.register_subcommand(c)\n    GetContexts.register_subcommand(c)\n    SetContext.register_subcommand(c)\n    SetCluster.register_subcommand(c)\n    SetCredentials.register_subcommand(c)\n    View.register_subcommand(c)\n  end\nend\n"