{"record":{"id":"640223a40f34ef00","repo":"hashicorp/nomad","slug":"warning-the-nomad-s-command-is-deprecated-ple","errorCode":null,"errorMessage":"WARNING! The \"nomad %s\" command is deprecated. Please use \"nomad %s\" instead. This command will be removed a later version of Nomad.","messagePattern":"WARNING! The \"nomad (.+?)\" command is deprecated\\. Please use \"nomad (.+?)\" instead\\. This command will be removed a later version of Nomad\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"command/commands.go","lineNumber":42,"sourceCode":"\n\t// EnvNomadCLIShowHints is an env var that toggles CLI hints.\n\tEnvNomadCLIShowHints = `NOMAD_CLI_SHOW_HINTS`\n)\n\n// DeprecatedCommand is a command that wraps an existing command and prints a\n// deprecation notice and points the user to the new command. Deprecated\n// commands are always hidden from help output.\ntype DeprecatedCommand struct {\n\tcli.Command\n\tMeta\n\n\t// Old is the old command name, New is the new command name.\n\tOld, New string\n}\n\n// Help wraps the embedded Help command and prints a warning about deprecations.\nfunc (c *DeprecatedCommand) Help() string {\n\tc.warn()\n\treturn c.Command.Help()\n}\n\n// Run wraps the embedded Run command and prints a warning about deprecation.\nfunc (c *DeprecatedCommand) Run(args []string) int {\n\tc.warn()\n\treturn c.Command.Run(args)\n}\n\nfunc (c *DeprecatedCommand) warn() {\n\tc.Ui.Warn(wrapAtLength(fmt.Sprintf(\n\t\t\"WARNING! The \\\"nomad %s\\\" command is deprecated. Please use \\\"nomad %s\\\" \"+\n\t\t\t\"instead. This command will be removed a later version of Nomad.\",\n\t\tc.Old,\n\t\tc.New)))\n\tc.Ui.Warn(\"\")\n}\n","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/command/commands.go#L24-L60","documentation":"DeprecatedCommand.Help wraps an embedded CLI command and calls warn() before returning the parent help text. The warning tells the user the invoked 'nomad <old>' command is deprecated and renamed to 'nomad <new>', and will be removed in a later version. It is informational output via Ui.Warn, not a failure.","triggerScenarios":"Running 'nomad help <old-command>' (or any path that resolves help for a command wrapped in DeprecatedCommand) for a registered deprecation pair.","commonSituations":"Users following old documentation/scripts that still call renamed commands like 'nomad acl policy delete' style legacy names, or automation pinned to old command names after a Nomad upgrade.","solutions":["Switch scripts and documentation to the new command name shown in the warning (the %s for New)","Check 'nomad <new> -help' to confirm equivalent flags before migrating","Silence by migrating; there is no supported way to suppress the deprecation warning"],"exampleFix":"// before\nnomad old-subcommand -help\n// after\nnomad new-subcommand -help","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Scan 'nomad help' output for deprecation notices after upgrades","Alias old command names in shell profiles during migration windows","Track Nomad release notes for command renames"],"tags":["cli","deprecation","warning"],"backgroundTag":"deprecated-command","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}