Workflow
cmd/crewship/cmd_workflow.go exposes the workflow-template surface. A workflow template defines a reusable issue lifecycle — the ordered list of stages (e.g. backlog → in_progress → review → done) that crews attach to their issue trackers. Backed by /api/v1/workflow-templates (see internal/api/workflow_templates_handler.go).
Aliases: workflows, workflow-template, workflow-templates.
All commands operate on the active workspace (crewship workspace use) and resolve <slug> arguments against the stored template name — both an exact-name hit (case-insensitive) and a kebab-cased form like engineering-standard are accepted. Ambiguous slugs that match multiple templates fail with a hint to retry using the exact name.
crewship workflow list
GET /api/v1/workflow-templates. Lists every template visible to the workspace — built-in rows first, then user-created.
ID, NAME, BUILTIN, STAGES, ICON, COLOR. The STAGES column counts entries inside the stored template_json blob — a value of 0 indicates a corrupt row that should be inspected via workflow get.
crewship workflow get <slug>
GET /api/v1/workflow-templates/{id} after resolving <slug> via the list endpoint. Prints every column including the full template_json so you can pipe it through jq to inspect the stage list.
crewship workflow create --file <manifest.yaml>
POST /api/v1/workflow-templates. The CLI reads a SPEC-2 YAML manifest, validates the minimum shape locally, and posts the canonical template_json to the server (which re-validates the stage list).
Validation rules
Enforced both client- and server-side (validateTemplateJSON in internal/api/workflow_templates_handler.go):
spec.stagesmust contain at least one stage.- Every stage requires
name,type, andposition. stage.typemust be one ofopen,started,completed,cancelled.- Exactly one stage with
type: open; at least one withtype: completed. nameandpositionvalues are unique within the template;positionmust be> 0.stage.color(if set) must be a hex string like#3B82F6.
409 Conflict.
crewship workflow update <slug> --file <manifest.yaml>
PATCH /api/v1/workflow-templates/{id}. Resolves <slug> against the stored template name (same matching as get/delete), then PATCHes the parsed manifest onto that row. The manifest uses the exact same SPEC-2 envelope as create, and the server re-runs the full stage validation — a manifest rejected on create is rejected on update too.
is_builtin: true) and rows in another workspace surface as 404 Not found; renaming into an existing template’s name returns 409 Conflict.
crewship workflow delete <slug>
DELETE /api/v1/workflow-templates/{id} after resolving <slug>. Aliases: remove, rm. Prompts for confirmation unless -y/--yes is passed.
See also
crewship apply— declarative path for the same manifest envelope; reconciles templates as part of a larger bundle.- WorkflowTemplate manifest schema — full YAML field reference.
crewship issue— issues whose stage column is governed by these templates.