Files
Noah StrideandTim Buckley 13633219f1 Consistency of tbot CLI flags (#62880)
* Consistency of `tbot` CLI flags

* MWI: Unhide `tbot keypair create` from help (#62900)

This unhides the `tbot keypair create` utility, which was previously
hidden. It's directly referenced in guides and documented on the web
reference page, so it shouldn't remain hidden.

* Fix missing "the"

---------

Co-authored-by: Tim Buckley <tim@goteleport.com>
2026-01-19 11:09:20 +00:00

49 lines
1.8 KiB
Go

/*
* Teleport
* Copyright (C) 2024 Gravitational, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package cli
// ProxyCommand supports `tbot proxy`
type ProxyCommand struct {
*genericExecutorHandler[ProxyCommand]
DestinationDir string
Cluster string
ProxyServer string
ProxyRemaining *[]string
}
// NewProxyCommand initializes the subcommand for `tbot proxy`
func NewProxyCommand(app KingpinClause, action func(*ProxyCommand) error) *ProxyCommand {
cmd := app.Command("proxy", "Starts a local TLS proxy via tsh to connect to Teleport in single-port mode.")
c := &ProxyCommand{}
c.genericExecutorHandler = newGenericExecutorHandler(cmd, c, action)
cmd.Flag("proxy-server", "The address of the Teleport proxy server to use, in host:port form.").StringVar(&c.ProxyServer)
cmd.Flag("destination-dir", "The destination directory to provide tsh for authentication.").StringVar(&c.DestinationDir)
cmd.Flag("cluster", "The cluster name. Extracted from the certificate if unset.").StringVar(&c.Cluster)
c.ProxyRemaining = RemainingArgs(cmd.Arg(
"args",
"Arguments to `tsh proxy ...`; prefix with `-- ` to ensure flags are passed correctly.",
))
return c
}