Help us shape the future of Go! Take the 2026 Go Developer Survey

cli

package
v0.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2026 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangePassword

func ChangePassword(serverAddr, username string) error

func CreateUser

func CreateUser(client pb.TaskQueueClient, user *pb.CreateUserRequest) error

func DeleteUser

func DeleteUser(client pb.TaskQueueClient, userId int32) error

func ListUsers

func ListUsers(client pb.TaskQueueClient) error

func Run

func Run(c CLI) error

func UpdateUser

func UpdateUser(client pb.TaskQueueClient, user *pb.User) error

Types

type Attr

type Attr struct {
	// Config commands
	Config *struct {
		ImportRclone *struct {
			Path string `arg:"positional" default:"~/.config/rclone/rclone.conf" help:"Path to existing rclone.conf to import"`
		} `arg:"subcommand:import-rclone" help:"Import an existing rclone.conf and print YAML fragment"`
	} `arg:"subcommand:config" help:"Configuration tools"`

	Server  string `arg:"-s,--server,env:SCITQ_SERVER" default:"localhost:50051" help:"gRPC server address"`
	TimeOut int    `arg:"-t,--timeout" default:"300" help:"Timeout for server interaction (in seconds)"`
	Token   string `arg:"-T,--token" default:"" help:"authentication token (used for tests)"`
	JSON    bool   `arg:"--json" help:"Output in JSON format (for scripting and AI agents)"`

	// Task Commands (Sub-Subcommands)
	Task *struct {
		Create *struct {
			Name         *string  `arg:"--name" help:"Optional name of the task"`
			Container    string   `arg:"--container,required" help:"Container to run"`
			Command      string   `arg:"--command,required" help:"Command to execute"`
			Shell        *string  `arg:"--shell" help:"Shell to use"`
			Input        []string `arg:"--input,separate" help:"Input values for the task (can be repeated)"`
			Resource     []string `arg:"--resource,separate" help:"Input values for the task (can be repeated)"`
			Output       string   `arg:"--output,separate" help:"Output folder where results are copied for the task"`
			StepId       *int32   `arg:"--step-id" help:"Step ID if task is affected to a step"`
			Dependencies []int32  `arg:"--dependency,separate" help:"IDs of tasks that this task depends on (can be repeated)"`
			ScitqAuth    bool     `` /* 200-byte string literal not displayed */
		} `arg:"subcommand:create" help:"Create a new task"`

		List *struct {
			Status     string `arg:"--status" help:"Filter tasks by status"`
			ShowHidden bool   `arg:"--show-hidden" help:"Include tasks marked as hidden (e.g., previous failed attempts)"`
			WorkerId   int32  `arg:"--worker-id" help:"Filter tasks by worker ID"`
			WorkflowId int32  `arg:"--workflow-id" help:"Filter tasks by workflow ID"`
			StepId     int32  `arg:"--step-id" help:"Filter tasks by step ID"`
			Command    string `arg:"--command" help:"Filter tasks by command substring"`
			Limit      int32  `arg:"--limit" default:"20" help:"Limit the number of tasks returned"`
			Offset     int32  `arg:"--offset" help:"Offset for pagination of tasks"`
			Long       bool   `arg:"-l,--long" help:"Show all task fields"`
		} `arg:"subcommand:list" help:"List all tasks"`

		Stdout *struct {
			ID int32 `arg:"--id,required" help:"Task ID"`
		} `arg:"subcommand:stdout" help:"Stream task stdout"`

		Stderr *struct {
			ID int32 `arg:"--id,required" help:"Task ID"`
		} `arg:"subcommand:stderr" help:"Stream task stderr"`

		Logs *struct {
			ID int32 `arg:"--id,required" help:"Task ID"`
		} `arg:"subcommand:logs" help:"Stream task stdout and stderr (colored)"`

		Retry *struct {
			ID    int32  `arg:"--id,required" help:"Task ID to retry"`
			Retry *int32 `arg:"--retry" help:"Number of retries left (optional)"`
		} `arg:"subcommand:retry" help:"Retry a failed task"`

		Edit *struct {
			ID      int32  `arg:"--id,required" help:"Task ID to edit and retry"`
			Command string `arg:"--command,required" help:"New command for the task"`
		} `arg:"subcommand:edit" help:"Edit a task's command and retry it"`

		Update *struct {
			ID               int32    `arg:"--id,required" help:"Task ID to update"`
			Command          *string  `arg:"--command" help:"Replace the task's command"`
			Container        *string  `arg:"--container" help:"Replace the task's container image"`
			ContainerOptions *string  `arg:"--container-options" help:"Replace the docker run extra options string"`
			Shell            *string  `arg:"--shell" help:"Replace the shell (e.g. bash, sh)"`
			Status           *string  `arg:"--status" help:"Replace the status (P/W/F/S/X/I/Z; worker-managed states are rejected)"`
			Output           *string  `arg:"--output" help:"Replace the output URI"`
			Publish          *string  `arg:"--publish" help:"Replace the publish URI"`
			Retry            *int32   `arg:"--retry" help:"Replace the retry counter"`
			Input            []string `arg:"--input,separate" help:"Replace the inputs (repeat the flag once per URI). Use --clear-input to set empty."`
			Resource         []string `arg:"--resource,separate" help:"Replace the resources (repeat the flag once per URI). Use --clear-resource to set empty."`
			ClearInput       bool     `arg:"--clear-input" help:"Set inputs to empty (overrides --input)"`
			ClearResource    bool     `arg:"--clear-resource" help:"Set resources to empty (overrides --resource)"`
			MinCpu           *float32 `` /* 144-byte string literal not displayed */
			MinMem           *float32 `` /* 147-byte string literal not displayed */
			MinDisk          *float32 `arg:"--min-disk" help:"Per-task minimum disk in GB (worker-fit predicate)."`
			MinGpu           *int32   `` /* 154-byte string literal not displayed */
		} `arg:"subcommand:update" help:"Update fields on a task in place (no retry; for fixing wrong submissions or unsticking state)"`

		Kill *struct {
			ID int32 `arg:"--id,required" help:"Task ID to kill"`
		} `arg:"subcommand:kill" help:"Send kill signal (SIGKILL) to a running task"`

		Stop *struct {
			ID    int32  `arg:"--id,required" help:"Task ID to stop"`
			Grace *int32 `arg:"--grace" help:"Grace period in seconds before SIGKILL (default: 10)"`
		} `arg:"subcommand:stop" help:"Send stop signal (SIGTERM) to a running task"`

		Delete *struct {
			ID int32 `arg:"--id,required" help:"Task ID to delete"`
		} `` /* 224-byte string literal not displayed */
	} `arg:"subcommand:task" help:"Manage tasks"`

	// Worker Commands (Sub-Subcommands)
	Worker *struct {
		List *struct {
			Long         bool `arg:"-l,--long" help:"Show extended worker details"`
			NeedsUpgrade bool `` /* 157-byte string literal not displayed */
		} `arg:"subcommand:list" help:"List all workers"`
		Deploy *struct {
			Flavor      string `arg:"--flavor,required" help:"Worker flavor"`
			Provider    string `arg:"--provider,required" help:"Worker provider in the form providerName.configName like azure.primary"`
			Region      string `arg:"--region" help:"Worker region, default to provider default region"`
			Count       int    `arg:"--count" help:"How many worker to create" default:"1"`
			StepId      int32  `arg:"--step" help:"Worker step ID if worker is affected to a task"`
			Concurrency int    `arg:"--concurrency" default:"1" help:"Worker initial concurrency"`
			Prefetch    int    `arg:"--prefetch" default:"0" help:"Worker initial prefetch"`
		} `arg:"subcommand:deploy" help:"Create and deploy a new worker instance"`
		Delete *struct {
			WorkerId   int32 `arg:"--worker-id,required" help:"The ID of the worker to be deleted"`
			Undeployed bool  `` /* 185-byte string literal not displayed */
		} `arg:"subcommand:delete" help:"Delete a worker instance"`
		Update *struct {
			WorkerId        int32    `arg:"--worker-id,required" help:"The ID of the worker to update"`
			StepId          *int32   `arg:"--step-id" help:"Step ID to assign the worker to"`
			WorkflowName    *string  `arg:"--workflow-name" help:"Workflow name to resolve step (lowest step_id if --step-name omitted)"`
			StepName        *string  `arg:"--step-name" help:"Step name to resolve step (requires --workflow-name)"`
			Concurrency     *int32   `arg:"--concurrency" help:"Update worker concurrency"`
			Prefetch        *int32   `arg:"--prefetch" help:"Update worker prefetch"`
			Permanent       bool     `arg:"--permanent" help:"Set worker as permanent"`
			NoPermanent     bool     `arg:"--no-permanent" help:"Unset permanent status"`
			ClearStep       bool     `` /* 165-byte string literal not displayed */
			RecyclableScope *string  `arg:"--recyclable-scope" help:"Update recyclable scope"`
			MaxCpu          *int32   `` /* 150-byte string literal not displayed */
			MaxMem          *float32 `arg:"--max-mem" help:"Update advertised memory cap in GiB. Same live-resize semantics as --max-cpu."`
		} `arg:"subcommand:update" help:"Update worker settings"`
		Stats *struct {
			WorkerIds []int32 `arg:"--worker-id,separate,required" help:"Worker IDs to get stats for"`
		} `arg:"subcommand:stats" help:"Fetch current stats for workers"`
		Upgrade *struct {
			WorkerId  int32 `arg:"positional" help:"Worker ID to upgrade (omit when --all is set)"`
			All       bool  `arg:"--all" help:"Flag every worker for upgrade"`
			Emergency bool  `arg:"--emergency" help:"Drain in-flight tasks (hard 30-min cap) before upgrading instead of waiting for natural idle"`
			Cancel    bool  `arg:"--cancel" help:"Clear a pending upgrade request instead of setting one"`
			Yes       bool  `arg:"-y,--yes" help:"Skip the confirmation prompt for --all --emergency"`
		} `` /* 136-byte string literal not displayed */
	} `arg:"subcommand:worker" help:"Manage workers"`

	// Flavor commands
	Flavor *struct {
		List *struct {
			Limit  int    `arg:"--limit" help:"Limit the number of answers" default:"10"`
			Filter string `arg:"--filter" help:"Filter flavor by a filter string like 'cpu>=12:mem>=30'"`
		} `arg:"subcommand:list" help:"List flavors"`
		Disable *struct {
			Provider   string  `arg:"--provider,required" help:"Provider in <name>.<config> form, e.g. azure.primary"`
			FlavorName string  `arg:"--flavor,required" help:"Flavor name to disable, e.g. Standard_DC32ads_cc_v5"`
			Region     *string `arg:"--region" help:"Restrict to one region (default: every region of that provider)"`
		} `` /* 129-byte string literal not displayed */
		Enable *struct {
			Provider   string  `arg:"--provider,required" help:"Provider in <name>.<config> form, e.g. azure.primary"`
			FlavorName string  `arg:"--flavor,required" help:"Flavor name to re-enable"`
			Region     *string `arg:"--region" help:"Restrict to one region (default: every region of that provider)"`
		} `arg:"subcommand:enable" help:"Re-enable a previously-disabled flavor for recruitment"`
	} `arg:"subcommand:flavor" help:"Find / manage flavors"`

	// Job (server-internal worker create/delete/restart operations) commands
	Job *struct {
		List *struct {
			Limit  int     `arg:"--limit" help:"Max jobs to fetch" default:"50"`
			Status *string `arg:"--status" help:"Filter to a single status: P (pending), R (running), S (succeeded), F (failed), X (cancelled)"`
			Long   bool    `arg:"-l,--long" help:"Show the full provider error message (otherwise just the class)"`
		} `` /* 156-byte string literal not displayed */
	} `arg:"subcommand:job" help:"Inspect server-internal jobs"`

	// User commands
	User *struct {
		List   *struct{} `arg:"subcommand:list" help:"List all users"`
		Update *struct {
			UserId   int32   `arg:"--id,required" help:"User ID to update"`
			Username *string `arg:"--username" help:"New username"`
			Email    *string `arg:"--email" help:"New email"`
			Admin    bool    `arg:"--admin" help:"Set admin status"`
			NoAdmin  bool    `arg:"--no-admin" help:"Remove admin rights"`
		} `arg:"subcommand:update" help:"Update a user"`
		Create *struct {
			Username string `arg:"--username,required" help:"New username"`
			Email    string `arg:"--email,required" help:"New email"`
			Password string `arg:"--password,required" help:"New password"`
			Admin    bool   `arg:"--admin" help:"Set admin status"`
		} `arg:"subcommand:create" help:"Create a new user"`
		Delete *struct {
			UserId int32 `arg:"--id,required" help:"User ID to delete"`
		} `arg:"subcommand:delete" help:"Delete a user"`
		ChangePassword *struct {
			Username string `arg:"--username,required" help:"Username for which password will be changed"`
		} `arg:"subcommand:change-password" help:"Change your password"`
	} `arg:"subcommand:user" help:"User management"`

	Recruiter *struct {
		List *struct {
			StepId int32 `arg:"--step-id" help:"Step ID to filter"`
		} `arg:"subcommand:list" help:"List all recruiters"`
		Create *struct {
			StepId           int32    `arg:"--step-id,required" help:"Step ID"`
			Rank             int32    `arg:"--rank" default:"1" help:"Recruiter rank"`
			Protofilter      string   `arg:"--filter,required" help:"A filter like 'cpu>=12:mem>=30' or 'flavor~Standard_D2s_%:region is default'"`
			Concurrency      *int32   `arg:"--concurrency" help:"Worker initial concurrency"`
			Prefetch         *int32   `arg:"--prefetch" help:"Worker initial prefetch"`
			PrefetchPercent  *int32   `arg:"--prefetch-percent" help:"Worker initial prefetc (expressed as a %% of concurrency)"`
			CpuPerTask       *int32   `arg:"--cpu-per-task" help:"Adaptative concurrency: CPU required for 1 task"`
			MemoryPerTask    *float32 `arg:"--memory-per-task" help:"Adaptative concurrency: Memory (Gb) required for 1 task"`
			DiskPerTask      *float32 `arg:"--disk-per-task" help:"Adaptative concurrency: Disk space (Gb) required for 1 task"`
			ConcurrencyMax   *int32   `arg:"--concurrency" help:"Adaptative concurrency: Maximum concurrency per worker"`
			ConcurrencyMin   *int32   `arg:"--concurrency" help:"Adaptative concurrency: Minimal concurrency per worker"`
			MaxWorkers       *int32   `arg:"--max-workers" help:"Maximum number of workers"`
			Rounds           int      `arg:"--rounds" help:"Number of rounds"`
			Timeout          int      `arg:"--timeout" default:"10" help:"Timeout in seconds"`
			SwapProportion   *float32 `` /* 144-byte string literal not displayed */
			ExtraStorageGb   *int32   `` /* 135-byte string literal not displayed */
			ExtraStorageType *string  `` /* 137-byte string literal not displayed */
		} `arg:"subcommand:create" help:"Create a new recruiter"`
		Update *struct {
			StepId           int32    `arg:"--step-id,required" help:"Step ID"`
			Rank             int32    `arg:"--rank,required" help:"Recruiter rank"`
			Protofilter      *string  `arg:"--filter" help:"Updated filter (e.g. 'cpu>=12:mem>=30')"`
			Concurrency      *int32   `arg:"--concurrency" help:"Updated concurrency"`
			Prefetch         *int32   `arg:"--prefetch" help:"Updated prefetch"`
			PrefetchPercent  *int32   `arg:"--prefetch-percent" help:"Updated prefetch (as %% of concurrency)"`
			CpuPerTask       *int32   `arg:"--cpu-per-task" help:"Updated CPU per task"`
			MemoryPerTask    *float32 `arg:"--memory-per-task" help:"Updated memory per task (GB)"`
			DiskPerTask      *float32 `arg:"--disk-per-task" help:"Updated disk per task (GB)"`
			ConcurrencyMax   *int32   `arg:"--concurrency-max" help:"Updated max concurrency"`
			ConcurrencyMin   *int32   `arg:"--concurrency-min" help:"Updated min concurrency"`
			MaxWorkers       *int32   `arg:"--max-workers" help:"Updated max workers"`
			Rounds           *int32   `arg:"--rounds" help:"Updated rounds"`
			Timeout          *int32   `arg:"--timeout" help:"Updated timeout (seconds)"`
			SwapProportion   *float32 `arg:"--swap-proportion" help:"Updated /scratch swapfile fraction (0 disables)"`
			ExtraStorageGb   *int32   `arg:"--extra-storage-gb" help:"Updated extra /scratch volume size in GB (OVH only)"`
			ExtraStorageType *string  `arg:"--extra-storage-type" help:"Updated extra volume class (OVH: classic/high-speed/high-speed-gen2)"`
		} `arg:"subcommand:update" help:"Update a recruiter"`
		Delete *struct {
			StepId int32 `arg:"--step-id,required" help:"Step ID to delete"`
			Rank   int   `arg:"--rank,required" help:"Recruiter rank to delete"`
		} `arg:"subcommand:delete" help:"Delete a recruiter"`
	} `arg:"subcommand:recruiter" help:"Recruiter management"`

	// Workflow commands
	Workflow *struct {
		List *struct {
			NameLike string `arg:"--name-like" help:"Filter workflows by name"`
			Long     bool   `arg:"-l,--long" help:"Show params used to launch each workflow"`
			Limit    int32  `arg:"--limit" default:"10" help:"Maximum number of workflows to return (default 10, use 0 for no limit)"`
			User     string `arg:"--user" help:"Filter workflows by username (default: current user)"`
			AllUsers bool   `arg:"--all-users" help:"Show workflows from all users (overrides --user)"`
		} `arg:"subcommand:list" help:"List workflows"`
		Create *struct {
			Name           string `arg:"--name,required" help:"Workflow name"`
			RunStrategy    string `` /* 283-byte string literal not displayed */
			MaximumWorkers *int32 `arg:"--maximum-workers" help:"Maximum number of workers"`
			Status         string `arg:"--status" help:"Initial workflow status (P/R/Z/D/F/S). Default is P."`
		} `arg:"subcommand:create" help:"Create a new workflow"`
		Update *struct {
			WorkflowId     int32  `arg:"--id,required" help:"Workflow ID to update"`
			Status         string `arg:"--status" help:"New workflow status (P/R/Z/D/F/S)"`
			MaximumWorkers *int32 `arg:"--maximum-workers" help:"Maximum number of workers"`
		} `arg:"subcommand:update" help:"Update a workflow"`
		Delete *struct {
			WorkflowId int32 `arg:"--id,required" help:"Workflow ID to delete"`
		} `arg:"subcommand:delete" help:"Delete a workflow"`
		Chain *struct {
			List *struct {
				WorkflowId *int32 `arg:"--workflow-id" help:"Filter to a specific parent workflow"`
				Status     string `arg:"--status" help:"Filter by lifecycle status (pending|suspended|skipped|fired|failed|cancelled)"`
			} `arg:"subcommand:list" help:"List chain entries"`
			Show *struct {
				EntryId int32 `arg:"--id,required" help:"Chain entry ID"`
			} `arg:"subcommand:show" help:"Show one chain entry in detail"`
			Suspend *struct {
				EntryId int32 `arg:"--id,required" help:"Chain entry ID (must be pending)"`
			} `arg:"subcommand:suspend" help:"Suspend a pending chain entry so the operator can edit it before it fires"`
			Resume *struct {
				EntryId int32 `arg:"--id,required" help:"Chain entry ID (must be suspended)"`
			} `arg:"subcommand:resume" help:"Resume a suspended chain entry; fires immediately if the parent has already terminated"`
			Cancel *struct {
				EntryId int32 `arg:"--id,required" help:"Chain entry ID (must be pending or suspended)"`
			} `arg:"subcommand:cancel" help:"Cancel a pending or suspended chain entry (terminal)"`
			Edit *struct {
				EntryId    int32    `arg:"--id,required" help:"Chain entry ID (must be suspended)"`
				Template   *string  `arg:"--template" help:"New target template name"`
				Version    *string  `arg:"--version" help:"New target version (use empty string to clear the pin and resolve latest at fire time)"`
				ParamsJson *string  `arg:"--params-json" help:"Replace the entire params_template JSON object"`
				Param      []string `arg:"--param,separate" help:"Set one params entry as key=value (repeatable). Merged into existing params."`
				ParamClear []string `arg:"--param-clear,separate" help:"Drop one params key (repeatable)"`
				When       *string  `arg:"--when" help:"New when expression"`
				On         *string  `arg:"--on" help:"New on filter (succeeded|always|failed)"`
				AlwaysNew  *bool    `arg:"--always-new" help:"Set always_new (true/false)"`
			} `arg:"subcommand:edit" help:"Edit a suspended chain entry"`
		} `arg:"subcommand:chain" help:"Manage workflow chain entries (see specs/workflow_chain.md)"`
	} `arg:"subcommand:workflow" help:"Manage workflows"`

	// Step commands
	Step *struct {
		List *struct {
			WorkflowId int32 `arg:"--workflow-id,required" help:"Workflow ID to list steps for"`
		} `arg:"subcommand:list" help:"List steps for a workflow"`
		Create *struct {
			WorkflowId          int32   `arg:"--workflow-id" help:"Workflow ID"`
			WorkflowName        string  `arg:"--workflow-name" help:"Workflow name (alternative to ID)"`
			Name                string  `arg:"--name,required" help:"Step name"`
			DefinitiveExitCodes []int32 `arg:"--definitive-exit-code,separate" help:"Exit code that marks a failure as definitive (no retry). Repeatable."`
			DefinitivePattern   string  `arg:"--definitive-pattern" help:"Regex matched against stderr tail; a match marks the failure as definitive (no retry)"`
		} `arg:"subcommand:create" help:"Create a step"`
		Delete *struct {
			StepId int32 `arg:"--id,required" help:"Step ID to delete"`
		} `arg:"subcommand:delete" help:"Delete a step"`
		Stats *struct {
			WorkflowId   *int32  `arg:"--workflow-id" help:"Workflow ID to get step stats for"`
			WorkflowName string  `arg:"--workflow-name" help:"Workflow name (alternative to ID, used to resolve ID)"`
			StepIds      []int32 `arg:"--step-id,separate" help:"Step IDs to get stats for (repeatable)"`
			TaskName     string  `arg:"--task-name" help:"Filter relevant step IDs by tasks whose name matches substring (case-insensitive, client-side)"`
			Totals       bool    `arg:"--totals" help:"Add totals line at the end of the stats"`
		} `arg:"subcommand:stats" help:"Show step statistics"`

		Edit *struct {
			StepId  int32  `arg:"--id,required" help:"Step ID"`
			Find    string `arg:"--find,required" help:"Text or regexp pattern to find in commands"`
			Replace string `arg:"--replace,required" help:"Replacement text"`
			Regexp  bool   `arg:"--regexp" help:"Treat --find as a regexp pattern"`
		} `arg:"subcommand:edit" help:"Find/replace in all failed tasks of a step and retry them"`
	} `arg:"subcommand:step" help:"Manage steps"`

	// File commands
	File *struct {
		RemoteList *struct {
			URI     string `arg:"positional,required" help:"URI to list files from (supports glob patterns)"`
			Timeout int    `arg:"--timeout" default:"30" help:"Timeout for listing files (in seconds)"`
		} `arg:"subcommand:remote-list" help:"List remote files"`
		Copy *struct {
			Src string `arg:"positional,required" help:"Source URI"`
			Dst string `arg:"positional,required" help:"Destination URI"`
		} `arg:"subcommand:copy" help:"Copy remote files"`

		List *struct {
			Src string `arg:"positional,required" help:"Source URI"`
		} `arg:"subcommand:list" help:"List remote files"`
	} `arg:"subcommand:file" help:"Remote file operations"`

	// (Workflow) Template commands
	Template *struct {
		Upload *struct {
			Path   string  `arg:"--path,required" help:"Path to the Python template script"`
			Force  bool    `arg:"--force" help:"Overwrite existing template with same name/version"`
			Folder *string `` /* 189-byte string literal not displayed */
		} `arg:"subcommand:upload" help:"Upload a new workflow template"`

		Run *struct {
			TemplateId      *int32   `arg:"--id" help:"ID of the template to run (either name or id is required)"`
			Name            *string  `arg:"--name" help:"Name of the template to run (either name or id is required)"`
			Version         *string  `arg:"--ver" help:"Optional version, e.g. 1.0.0 or 'latest' (default: latest)"`
			ParamPairs      []string `` /* 475-byte string literal not displayed */
			NoRecruiters    bool     `arg:"--no-recruiters" help:"Create workflow without recruiters"`
			ExtendWorkflow  *int32   `` /* 254-byte string literal not displayed */
			Continue        bool     `` /* 249-byte string literal not displayed */
			RetryFailedOnly bool     `` /* 210-byte string literal not displayed */
		} `arg:"subcommand:run" help:"Run a workflow template"`

		List *struct {
			Name        *string `arg:"--name" help:"Template name (can include wildcards like 'meta%')"`
			Version     *string `arg:"--ver" help:"Template version, exact or SQL LIKE wildcard (e.g. 1.0%); use 'latest' or omit for latest"`
			Latest      bool    `arg:"--latest" help:"DEPRECATED no-op: latest is now the default. Use --all-versions to opt out."`
			AllVersions bool    `arg:"--all-versions" help:"Show every version per template name (default: latest only)"`
			ShowHidden  bool    `arg:"--show-hidden" help:"Include templates marked hidden in the listing"`
			Folder      *string `` /* 192-byte string literal not displayed */
		} `arg:"subcommand:list" help:"List uploaded workflow templates (latest version per name by default)"`

		Detail *struct {
			TemplateId *int32  `arg:"--id" help:"Show detailed information for this template ID (either name or id is required)"`
			Name       *string `arg:"--name" help:"Name of the template to show (either name or id is required)"`
			Version    *string `arg:"--ver" help:"Optional version, e.g. 1.0.0 or 'latest' (default: latest)"`
		} `arg:"subcommand:detail" help:"Show a template's param JSON and metadata"`

		Download *struct {
			TemplateId *int32  `arg:"--id" help:"Template ID to download"`
			Name       *string `arg:"--name" help:"Name of the template to download"`
			Version    *string `arg:"--ver" help:"Optional version, e.g. 1.0.0 or 'latest' (default: latest)"`
			Output     *string `arg:"--output,-o" help:"Output file path (default: stdout)"`
		} `arg:"subcommand:download" help:"Download a template script"`

		Update *struct {
			TemplateId int32   `arg:"--id,required" help:"Template ID to update"`
			Hide       bool    `arg:"--hide" help:"Hide the template (excluded from default listings)"`
			Unhide     bool    `arg:"--unhide" help:"Unhide a previously hidden template"`
			Folder     *string `` /* 128-byte string literal not displayed */
		} `arg:"subcommand:update" help:"Update a template's metadata (hide/unhide, folder)"`
	} `arg:"subcommand:template" help:"Manage workflow templates"`

	// Module commands
	Module *struct {
		Upload *struct {
			Path  string  `arg:"--path,required" help:"Path to the module YAML file"`
			As    *string `` /* 186-byte string literal not displayed */
			Force bool    `arg:"--force" help:"Overwrite an existing module at the same (path, version)"`
		} `arg:"subcommand:upload" help:"Upload a YAML module to the server's module library"`

		List *struct {
			Tree     bool    `arg:"--tree" help:"Group the list by folder (namespace tree view)"`
			Versions *string `arg:"--versions" help:"Show every version at this path (e.g. --versions genomics/fastp)"`
			Latest   bool    `arg:"--latest" help:"Show only the highest version per path"`
			Origin   *string `arg:"--origin" help:"Filter by origin: bundled, local or forked"`
		} `arg:"subcommand:list" help:"List modules in the server library"`

		Download *struct {
			Name   string  `arg:"--name,required" help:"Module reference (e.g. 'genetic/fastp' or 'genetic/fastp@1.2.0')"`
			Output *string `arg:"--output,-o" help:"Output file path (default: stdout)"`
		} `arg:"subcommand:download" help:"Download a module by name (optionally @version)"`

		Upgrade *struct {
			Apply bool `arg:"--apply" help:"Write changes to the DB (default: dry-run — only show the diff)"`
		} `arg:"subcommand:upgrade" help:"Seed/update bundled modules from the installed scitq2 package (admin-only)"`

		Origin *struct {
			Name string `arg:"positional,required" help:"Module reference (e.g. 'genetic/fastp' or 'genetic/fastp@1.2.0')"`
		} `arg:"subcommand:origin" help:"Show provenance of a module version (bundled / local / forked, content hash, uploader)"`

		Fork *struct {
			Source     string `arg:"positional,required" help:"Source reference (e.g. 'genetic/fastp@1.0.0'; bare name forks the latest)"`
			NewVersion string `arg:"--new-version,required" help:"Version of the forked row (e.g. '1.0.0-site')"`
		} `arg:"subcommand:fork" help:"Clone a module version into a new local fork (admin-only)"`

		Delete *struct {
			Name string `arg:"positional,required" help:"Module reference 'path@version' (e.g. 'genomics/fastp@1.0.0')"`
		} `` /* 142-byte string literal not displayed */

		Conflicts *struct{} `arg:"subcommand:conflicts" help:"List modules where a local upload diverges from a bundled module at the same path/version"`
	} `arg:"subcommand:module" help:"Manage YAML modules (versioned library, bundled + local)"`

	// (Workflow) Template run commands
	Run *struct {
		List *struct {
			TemplateId *int32 `arg:"--template-id" help:"Filter runs by template ID"`
		} `arg:"subcommand:list" help:"List template runs"`

		Delete *struct {
			RunId int32 `arg:"--id,required" help:"ID of the template run to delete"`
		} `arg:"subcommand:delete" help:"Delete a template run"`
	} `arg:"subcommand:run" help:"Manage template runs"`

	// Login commands
	Login *struct {
		User     *string `arg:"--user" help:"Username to log in"`
		Password *string `arg:"--password" help:"Password to log in"`
	} `arg:"subcommand:login" help:"Login and provide a token, use with export SCITQ_TOKENs=$(scitq login)"`

	// Certificate command
	Cert *struct{} `arg:"subcommand:cert" help:"Print server TLS certificate (PEM)"`

	// Self-introspection commands
	Self *struct {
		Version *struct{} `arg:"subcommand:version" help:"Show CLI build info and compare against the server"`
	} `arg:"subcommand:self" help:"Inspect this CLI binary"`

	// HashPassword command
	HashPassword *struct {
		Password string `arg:"positional,required" help:"Password to hash"`
	} `arg:"subcommand:hashpassword" help:"Hash a password using bcrypt (useful for config files)"`

	// Worker event commands
	WorkerEvent *struct {
		List *struct {
			Limit    int    `arg:"--limit" default:"20" help:"Max number of events to show"`
			Level    string `arg:"--level" help:"Filter by level D/I/W/E as D:Debug/I:Info/W:Warning/E:Error"`
			Class    string `arg:"--class" help:"Filter by event_class"`
			WorkerId int32  `arg:"--worker-id" help:"Filter by worker id"`
		} `arg:"subcommand:list" help:"List worker events"`
		Delete *struct {
			Id int32 `arg:"--id,required" help:"Worker event ID to delete"`
		} `arg:"subcommand:delete" help:"Delete a worker event by ID"`
		Prune *struct {
			OlderThan string `arg:"--older-than" help:"Age to prune, e.g. 7d, 12h, 30m (required unless --dry-run)"`
			Level     string `arg:"--level" help:"Optional level filter D/I/W/E as D:Debug/I:Info/W:Warning/E:Error"`
			Class     string `arg:"--class" help:"Optional event_class filter"`
			WorkerId  int32  `arg:"--worker-id" help:"Optional worker id filter"`
			DryRun    bool   `arg:"--dry-run" help:"Only count matched rows; do not delete"`
		} `arg:"subcommand:prune" help:"Prune worker events by age and optional filters"`
	} `arg:"subcommand:worker-event" help:"Worker event logs"`
}

CLI struct encapsulates task & worker commands

func (Attr) Version

func (Attr) Version() string

Version enables go-arg's built-in --version handling. When users run `scitq --version`, go-arg will print this string and exit.

type CLI

type CLI struct {
	QC   lib.QueueClient
	Attr Attr
}

func (*CLI) ConfigImportRclone

func (c *CLI) ConfigImportRclone() error

ConfigImportRclone loads an rclone.conf and prints it as YAML fragment.

func (*CLI) Copy

func (c *CLI) Copy() error

func (*CLI) FileList

func (c *CLI) FileList() error

func (*CLI) FlavorList

func (c *CLI) FlavorList(limit int32, filter string) error

ListFlavors handles listing flavors.

func (*CLI) FlavorSetAvailability added in v0.8.1

func (c *CLI) FlavorSetAvailability(enable bool) error

FlavorSetAvailability flips `flavor_region.available` for the given flavor in a provider/region. With `enable=false`, the recruiter stops considering this flavor for new deployments; existing workers of the same flavor keep running. Mirrors the SetFlavorAvailability gRPC handler.

func (*CLI) JobList added in v0.8.1

func (c *CLI) JobList() error

JobList prints the server-internal job queue with provider error classes surfaced. Born from the 2026-05-05 incident: an Azure SP credential expired and recruitment hung silently for hours because nothing on the operator's main surfaces showed *why* deletes and creates were failing. The error_class column makes the failure mode visible at a glance ("auth", "quota", "capacity", ...) without having to grep journalctl.

func (*CLI) List

func (c *CLI) List() error

func (*CLI) ModuleConflicts added in v0.8.5

func (c *CLI) ModuleConflicts() error

func (*CLI) ModuleDelete added in v0.8.5

func (c *CLI) ModuleDelete() error

func (*CLI) ModuleDownload added in v0.7.1

func (c *CLI) ModuleDownload() error

func (*CLI) ModuleFork added in v0.7.5

func (c *CLI) ModuleFork() error

func (*CLI) ModuleList added in v0.7.1

func (c *CLI) ModuleList() error

func (*CLI) ModuleOrigin added in v0.7.5

func (c *CLI) ModuleOrigin() error

func (*CLI) ModuleUpgrade added in v0.7.5

func (c *CLI) ModuleUpgrade() error

func (*CLI) ModuleUpload added in v0.7.1

func (c *CLI) ModuleUpload() error

func (*CLI) RecruiterCreate

func (c *CLI) RecruiterCreate() error

func (*CLI) RecruiterDelete

func (c *CLI) RecruiterDelete() error

func (*CLI) RecruiterList

func (c *CLI) RecruiterList() error

func (*CLI) RecruiterUpdate added in v0.7.3

func (c *CLI) RecruiterUpdate() error

func (*CLI) RunDelete

func (c *CLI) RunDelete() error

func (*CLI) RunList

func (c *CLI) RunList() error

func (*CLI) SelfVersion added in v0.8.1

func (c *CLI) SelfVersion() error

SelfVersion handles `scitq self version` — prints the build identity of this CLI plus the server's, and the comparison verdict. Always exits 0.

func (*CLI) StepCreate

func (c *CLI) StepCreate() error

func (*CLI) StepDelete

func (c *CLI) StepDelete() error

func (*CLI) StepEdit added in v0.7.1

func (c *CLI) StepEdit() error

StepEdit does find/replace on all failed tasks in a step and retries them.

func (*CLI) StepList

func (c *CLI) StepList() error

func (*CLI) StepStats

func (c *CLI) StepStats() error

StepStats implements the stats subcommand for steps.

func (*CLI) TaskCreate

func (c *CLI) TaskCreate() error

createTask sends a task creation request.

func (*CLI) TaskDelete added in v0.8.8

func (c *CLI) TaskDelete() error

TaskDelete removes a task row. If the task is active, the server queues SIGKILL on the worker first and waits up to 15s for the worker to ack the ping before removing the row — see server.DeleteTask for the rationale.

func (*CLI) TaskEdit added in v0.7.1

func (c *CLI) TaskEdit() error

TaskEdit edits a task's command and retries it.

func (*CLI) TaskKill added in v0.7.2

func (c *CLI) TaskKill() error

TaskKill sends a kill signal to a running task.

func (*CLI) TaskList

func (c *CLI) TaskList() error

listTasks fetches and displays all tasks.

func (*CLI) TaskLogs added in v0.6.2

func (c *CLI) TaskLogs() error

TaskLogs streams both stdout and stderr of a task, with colors (blue for stdout, red for stderr).

func (*CLI) TaskRetry

func (c *CLI) TaskRetry() error

TaskRetry retries a failed task.

func (*CLI) TaskStderr added in v0.6.2

func (c *CLI) TaskStderr() error

TaskStderr streams stderr of a task by ID.

func (*CLI) TaskStdout added in v0.6.2

func (c *CLI) TaskStdout() error

TaskStdout streams stdout of a task by ID.

func (*CLI) TaskStop added in v0.7.2

func (c *CLI) TaskStop() error

TaskStop sends a graceful stop signal (SIGTERM) to a running task.

func (*CLI) TaskUpdate added in v0.7.7

func (c *CLI) TaskUpdate() error

TaskUpdate calls EditTask to update a subset of fields on an existing task in place, without triggering a retry. Useful for fixing a typo'd container, swapping inputs/resources after a wrong submission, or pushing a stuck task back to W/P. Use TaskRetry / TaskEdit when you want a retry as well.

func (*CLI) TemplateDetail

func (c *CLI) TemplateDetail() error

func (*CLI) TemplateDownload added in v0.7.1

func (c *CLI) TemplateDownload() error

func (*CLI) TemplateList

func (c *CLI) TemplateList() error

func (*CLI) TemplateRun

func (c *CLI) TemplateRun() error

func (*CLI) TemplateUpdate added in v0.7.7

func (c *CLI) TemplateUpdate() error

TemplateUpdate hides or unhides a workflow template via UpdateTemplate. Mutually exclusive flags: --hide and --unhide.

func (*CLI) TemplateUpload

func (c *CLI) TemplateUpload() error

func (*CLI) WithTimeout

func (cli *CLI) WithTimeout() (context.Context, context.CancelFunc)

WithTimeout provides a context with a timeout

func (*CLI) WorkerDelete

func (c *CLI) WorkerDelete() error

WorkerDelete deletes a worker instance.

func (*CLI) WorkerDeploy

func (c *CLI) WorkerDeploy() error

WorkerDeploy deploys a new worker instance.

func (*CLI) WorkerEventDelete

func (c *CLI) WorkerEventDelete() error

func (*CLI) WorkerEventList

func (c *CLI) WorkerEventList() error

func (*CLI) WorkerEventPrune

func (c *CLI) WorkerEventPrune() error

func (*CLI) WorkerList

func (c *CLI) WorkerList() error

ListWorkers handles listing workers

func (*CLI) WorkerStats

func (c *CLI) WorkerStats() error

func (*CLI) WorkerUpdate

func (c *CLI) WorkerUpdate() error

WorkerUpdate updates worker settings (user-scoped).

func (*CLI) WorkerUpgrade added in v0.8.1

func (c *CLI) WorkerUpgrade() error

WorkerUpgrade flags one worker (by ID) or all workers for an operator-triggered upgrade. The worker observes the resulting flag on its next ping and acts. See specs/worker_autoupgrade.md (Phase II).

func (*CLI) WorkflowChainEdit added in v0.8.5

func (c *CLI) WorkflowChainEdit() error

func (*CLI) WorkflowChainLifecycle added in v0.8.5

func (c *CLI) WorkflowChainLifecycle(action string) error

WorkflowChainLifecycle is shared by suspend / resume / cancel: each is a single-id RPC that returns the new entry state. Keeping one handler keeps the three subcommand branches honest about being only-an-ID operations.

func (*CLI) WorkflowChainList added in v0.8.5

func (c *CLI) WorkflowChainList() error

func (*CLI) WorkflowChainShow added in v0.8.5

func (c *CLI) WorkflowChainShow() error

func (*CLI) WorkflowCreate

func (c *CLI) WorkflowCreate() error

func (*CLI) WorkflowDelete

func (c *CLI) WorkflowDelete() error

func (*CLI) WorkflowList

func (c *CLI) WorkflowList() error

func (*CLI) WorkflowUpdateStatus

func (c *CLI) WorkflowUpdateStatus() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL