show-config

Reference for linuxguard-agent show-config — print the entire current configuration as indented JSON for inspection or debugging.

Synopsis

Print the full agent configuration as indented JSON to stdout. Useful for verifying enrolment state, inspecting logging.* settings, or capturing the live config for a support ticket. The output is NOT redacted — fields like api_key, tenant_id, and base_url appear verbatim. For a redacted form suitable for sharing externally, use support-bundle collect, which produces a config.redacted.json file inside the archive.

linuxguard-agent show-config

Comparison with config list-keys

show-config and config list-keys overlap but serve different purposes:

Command
Output
Scope
Format

show-config

Entire config.Config struct

All fields, including identity (server_id, tenant_id, api_key, base_url) and operational state

Indented JSON, full structure

Only toggleable keys (those mutable via config set)

Excludes identity fields by design

Flat <key> <value> per line

Use show-config for full inspection (incident triage, support ticket attachment). Use config list-keys when you specifically need to know what config set accepts.

Flags

show-config takes no flags.

Environment

show-config reads no LINUXGUARD_* environment variables of its own. The command operates entirely on the already-loaded config object held by the agent context (which is populated by config.Setup at the binary's Before hook).

Signals

show-config is a one-shot CLI invocation — it does not install signal handlers via signal.Notify. Ctrl-C aborts the command via Go's default SIGINT handler.

Exit codes

Code
Meaning

0

The configuration was marshalled to JSON and printed. Followed by >> Configuration displayed above on stdout.

1

General error — json.MarshalIndent failed (should not happen for a struct of supported types) or the config context was not initialised. Surfaced via log.Fatal.

Examples

Inspect an enrolled host

Sample stdout (truncated):

Security Note: The output includes the long-lived API key in plaintext. Do NOT paste show-config output into support tickets, chat threads, or screenshots. Use support-bundle collect instead — it emits the same struct with credentials redacted as config.redacted.json.

Pipe to jq for a single field

Stdout:

show-config writes the closing status line >> Configuration displayed above to stdout after the JSON. The sed '/^>>/d' filter strips it so jq only sees valid JSON.

Diff config between two hosts

On two hosts in the same tenant, capture the JSON and compare:

Per-host differences in ServerID, RegisteredAt, Tags, and PID-file paths are expected; differences in LogLevel, LogLevelLocalPinned, or logging.* flag the config-drift to investigate.


Related: config | enroll | support-bundle | CLI Reference

Last updated

Was this helpful?