Documentation
¶
Index ¶
- Constants
- Variables
- func DatatugCommand() *cobra.Command
- func EnsureDaemonForCaller(root *cobra.Command, args []string, stderr io.Writer)
- func Exit(message string, code int) error
- func InstallCommand() *cobra.Command
- func SelfUpdateCommand(ver string) *cobra.Command
- func UpgradeCommand(ver string) *cobra.Command
- type Encoder
- type ExitCoder
- type Options
Constants ¶
const ( // ClientFlag and ClientEnv name the global caller flag and its environment fallback. ClientFlag = "client" ClientEnv = "DATATUG_CLIENT" )
Variables ¶
var ( //ErrUnknownProjectName signals an unknown project was requested/referred ErrUnknownProjectName = errors.New("unknown project name") )
Functions ¶
func DatatugCommand ¶
DatatugCommand builds the `datatug` root command tree.
A bare `datatug` invocation (and any invocation whose first positional argument does not match a registered subcommand) falls through to `ui` — this replicates urfave/cli/v3's DefaultCommand: "ui" behaviour, which took priority over the root's own Action in every case, including when --tui was set (the root Action's TUIFlag.IsSet() check was consequently dead code: DefaultCommand always intercepted execution first). Only the --tui/-t flag surface is preserved here; the root RunE ignores it, exactly as the unreachable original Action's callers never observed it either.
func EnsureDaemonForCaller ¶ added in v0.84.0
EnsureDaemonForCaller is the --client wrapper (spec daemon#req:client-ensures-daemon): when args name a command run by a known caller, it makes sure the daemon runs after the command's own work. It writes only to stderr, only when it warns, and never changes the command's exit code.
func Exit ¶ added in v0.12.0
Exit returns an error that carries a specific process exit code. Returning it from a command's RunE propagates up to main, which exits with code — the same contract github.com/urfave/cli/v3's cli.Exit provided.
The message is shown as it is. A message that names a source builds the name with dbcopy.SourceDisplay (or takes it from a BackendRef, whose Raw and String are that), and an error from a parser or a driver is classified by dbcopy and never quoted, so there is no password in the text for a redactor to find. The top-level error handler in main.go still runs the text through dbcopy.RedactText, as a last line of defence that nothing relies on.
func InstallCommand ¶ added in v0.31.0
InstallCommand returns the "install" command, built from github.com/strongo/cli-helpers/cliinstall/cobracmd against datatug's own catalog id (cli-install#req:host-identity-from-catalog). `install` lists the fleet CLIs relevant to datatug (`ingitdb`, `ovdb`, `specscore`) with their live status, and `install <name>...` installs them the same way datatug itself was installed. cobracmd.New panics if "datatug" is absent from the compiled catalog — a programming error this package's own tests catch (TestInstallCommand_Shape proves the real entry resolves), never a runtime state a user sees.
func SelfUpdateCommand ¶ added in v0.31.0
SelfUpdateCommand returns the "self-update" command, built from github.com/strongo/cli-helpers/selfupdate/cobracmd against datatugSelfUpdateConfig's identity.
func UpgradeCommand ¶ added in v0.31.0
UpgradeCommand returns the "upgrade" command, built from github.com/strongo/cli-helpers/cliinstall/cobracmd against datatug's own catalog id. HostConfig comes from the exact same datatugSelfUpdateConfig helper SelfUpdateCommand uses, and datatug's self-update has no after-update hook to pass as HostAfterUpdate, so `datatug self-update` and `datatug upgrade datatug` reach the exact same library call (cli-install#req:self-update-equals-upgrade-self). ver is the running build's own version, matching SelfUpdateCommand's own parameter.
Types ¶
type Encoder ¶
type Encoder interface {
Encode(v interface{}) error
}
Encoder defines interface to encode
type ExitCoder ¶ added in v0.12.0
ExitCoder is implemented by an error that must terminate the process with a specific exit code. It is this package's replacement for github.com/urfave/cli/v3's ExitCoder contract, which several mutating commands (db copy, entity authoring, --git mode validation) relied on before the migration to cobra. main() checks for this interface after the root command returns and exits with ExitCode() when present.
Source Files
¶
- chat_ai_profile.go
- chat_cloud.go
- chat_cloud_refusal.go
- chat_consent.go
- chat_narrowing.go
- chat_saved_queries.go
- cli_console_command.go
- client_flag.go
- cmd_board.go
- cmd_chat.go
- cmd_chat_recent.go
- cmd_compare.go
- cmd_compare_database.go
- cmd_config.go
- cmd_config_client.go
- cmd_config_server.go
- cmd_config_url.go
- cmd_daemon.go
- cmd_dataset.go
- cmd_dataset_data.go
- cmd_dataset_def.go
- cmd_datasets.go
- cmd_db_add.go
- cmd_db_copy.go
- cmd_db_copy_faithful.go
- cmd_db_copy_ingitdb.go
- cmd_db_copy_sqlscript.go
- cmd_db_export.go
- cmd_db_schema.go
- cmd_db_schema_source.go
- cmd_db_table.go
- cmd_demo.go
- cmd_detective_ui.go
- cmd_entity.go
- cmd_execute_sql.go
- cmd_execution.go
- cmd_exit_codes.go
- cmd_incident.go
- cmd_init_project.go
- cmd_install.go
- cmd_open_db.go
- cmd_plan.go
- cmd_project_source.go
- cmd_projects.go
- cmd_projects_add.go
- cmd_queries.go
- cmd_query.go
- cmd_query_bigquery.go
- cmd_query_bigquery_pilot.go
- cmd_query_lookup.go
- cmd_query_results.go
- cmd_query_run_saved.go
- cmd_render.go
- cmd_scan_db.go
- cmd_self_update.go
- cmd_serve.go
- cmd_session.go
- cmd_session_dashboard.go
- cmd_session_detective.go
- cmd_session_import.go
- cmd_session_recovery.go
- cmd_session_result.go
- cmd_show_project.go
- cmd_ui.go
- cmd_upgrade.go
- cmd_validate.go
- command.go
- detective_cloud.go
- detective_module.go
- errors.go
- field_types.go
- git_integration.go
- grid.go
- native_context_fixture_disabled.go
- options.go
- project_base_command.go
- project_folder_link.go
- query_output.go
- query_result_files.go
- query_result_meta.go
- serve_runtime_settings.go
- ui_result.go
- workspace.go