Skip to main content
5 min read

stackgen ai

stackgen ai

Use stackgen ai to manage Aiden resources and Knowledge Hubs from the CLI. You can apply kinded YAML manifests, get or delete resources, list kinds, run workflows, inspect session artifacts, and manage Knowledge Hub documents.

Usage

stackgen ai [command]

Available commands

CommandDescription
applyCreate or update Aiden resources from kinded YAML
deleteDelete an Aiden resource by kind/name or from a manifest file
getGet an Aiden resource by kind/name or from a manifest file
knowledgeUpload documents to an Aiden Knowledge Hub and check ingestion status
listList Aiden resources of a kind. Alias: ls
runRun an Aiden workflow as workflow/<name> with --input key=value pairs
sessionInspect Aiden sessions and download artifacts
workflowRun Aiden workflows and optionally wait for completion

Flags

FlagDescription
-h, --helpHelp for ai.

Global flags

See Global flags for --project, --workspace, --output, --interactive, --log, --stackgen-home, and other options.

Kinded YAML apply

Click to view

Apply kinded YAML manifests (apiVersion + kind) to Aiden.

Supported kinds: Agent, Workflow, Runbook, Skill, Policy. Documents are applied Policy first, then Agent / Runbook / Skill, then Workflow. Use Kubernetes-style --- separators to pack multiple resources in one file. Optional --values renders manifests and *File includes with Go text/template.

stackgen ai apply [flags]
FlagDescription
--approveApprove Workflow or Runbook versions after upsert
--dry-runValidate and normalize without calling Aiden APIs
-f, --filename stringArrayManifest file or directory (repeatable)
-R, --recursiveRecurse into directories passed to -f
--values stringYAML values file for Go text/template rendering
-h, --helpHelp for apply

Examples

stackgen ai apply -f workflow.yaml
stackgen ai apply -f ./manifests/ --recursive --approve
stackgen ai apply -f agent.yaml -f runbook.yaml --dry-run
stackgen ai apply --values values.yaml -f common.yaml -f observe-uber-triage.yaml --dry-run

Get, list, and delete

Click to view

get

stackgen ai get [kind/name] [flags]
FlagDescription
-f, --filename stringManifest file (uses kind + metadata.name)
-o, --output stringOutput format: yaml or json (default yaml)
-h, --helpHelp for get
stackgen ai get workflow/observe-rabbitmq-backlog-rca
stackgen ai get -f workflow.yaml -o yaml

list

stackgen ai list <kind> [flags]

Aliases: list, ls

stackgen ai list workflow
stackgen ai list agent

delete

stackgen ai delete [kind/name] [flags]
FlagDescription
-f, --filename stringManifest file (uses kind + metadata.name)
-h, --helpHelp for delete
stackgen ai delete workflow/observe-rabbitmq-backlog-rca
stackgen ai delete -f agent.yaml

Run workflows

Click to view

stackgen ai run

stackgen ai run workflow/<name> [flags]
FlagDescription
--input stringArrayWorkflow input as key=value (repeatable)
-h, --helpHelp for run
stackgen ai run workflow/observe-rabbitmq-backlog-rca --input queue=orders --input vhost=/

stackgen ai workflow run

Start a named Aiden workflow and print run_id, trace_id, and session_id. Use --wait to poll until the execution completes or fails.

stackgen ai workflow run <name> [flags]
FlagDescription
--input stringWorkflow input message (required)
--metadata stringArraySource metadata as key=value (repeatable)
--poll durationPoll interval when --wait is set (default 5s)
--session-id stringOptional existing session ID for shared context
--timeout durationMax time to wait when --wait is set (default 30m0s)
--version int32Optional preferred workflow version
--waitWait until the workflow execution completes or fails
-h, --helpHelp for run
stackgen ai workflow run observe-rabbitmq-backlog-rca --input '{"queue":"orders"}'
stackgen ai workflow run observe-rabbitmq-backlog-rca --input hi --wait --timeout 30m
stackgen ai workflow run observe-rabbitmq-backlog-rca --input hi --metadata alert_id=a1 --version 2

After a successful wait, list or download artifacts with session artifacts.

Session artifacts

Click to view
stackgen ai session artifacts [command]

list

stackgen ai session artifacts list <session-id> [flags]
stackgen ai session artifacts list <session-id>
stackgen ai session artifacts list <session-id> -o json

download

stackgen ai session artifacts download <session-id> <artifact-id> [flags]
FlagDescription
--destination stringDirectory to write the artifact into (default .)
-h, --helpHelp for download
stackgen ai session artifacts download <session-id> <artifact-id>
stackgen ai session artifacts download <session-id> <artifact-id> --destination ./out

Subcommands

knowledge

Upload documents to an Aiden Knowledge Hub, list documents, check ingestion status, delete documents, and list Knowledge Hubs.