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, trigger webhooks, inspect session artifacts, and manage Knowledge Hub documents.
Usage
stackgen ai [command]
Available commands
| Command | Description |
|---|---|
apply | Create or update Aiden resources from kinded YAML |
delete | Delete an Aiden resource by kind/name or from a manifest file |
get | Get an Aiden resource by kind/name or from a manifest file |
knowledge | Upload documents to an Aiden Knowledge Hub and check ingestion status |
list | List Aiden resources of a kind. Alias: ls |
run | Run an Aiden workflow as workflow/<name> with --input key=value pairs |
session | Inspect Aiden sessions and download artifacts |
webhook | Trigger an Aiden webhook by ID and optionally wait for the run |
workflow | Run Aiden workflows and optionally wait for completion |
Flags
| Flag | Description |
|---|---|
-h, --help | Help 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]
| Flag | Description |
|---|---|
--approve | Approve Workflow or Runbook versions after upsert |
--dry-run | Validate and normalize without calling Aiden APIs |
-f, --filename stringArray | Manifest file or directory (repeatable) |
-R, --recursive | Recurse into directories passed to -f |
--values string | YAML values file for Go text/template rendering |
-h, --help | Help 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]
| Flag | Description |
|---|---|
-f, --filename string | Manifest file (uses kind + metadata.name) |
-o, --output string | Output format: yaml or json (default yaml) |
-h, --help | Help 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]
| Flag | Description |
|---|---|
-f, --filename string | Manifest file (uses kind + metadata.name) |
-h, --help | Help 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]
| Flag | Description |
|---|---|
--input stringArray | Workflow input as key=value (repeatable) |
-h, --help | Help 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]
| Flag | Description |
|---|---|
--input string | Workflow input message (required). Use @<path> to read the message from a file (max 1 MiB). Use @@… to send a literal message that starts with @ |
--metadata stringArray | Source metadata as key=value (repeatable) |
--poll duration | Poll interval when --wait is set (default 5s) |
--session-id string | Optional existing session ID for shared context |
--timeout duration | Max time to wait when --wait is set (default 30m0s) |
--version int32 | Optional preferred workflow version |
--wait | Wait until the workflow execution completes or fails |
-h, --help | Help 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
stackgen ai workflow run observe-rabbitmq-backlog-rca --input @./alert.spine.input.json
After a successful wait, list or download artifacts with session artifacts.
stackgen ai webhook trigger
Trigger a named Aiden webhook by ID. StackGen login (JWT) is required, and so is the webhook token. Prefer an env var so the secret is not stored in shell history.
--wait polls until dispatch yields a session and the matching execution completes or fails. --wait is supported for agent and workflow targets only (not app-forward targets). If --data and --data-file are omitted, the trigger body is {}.
stackgen ai webhook trigger <webhook-id> [flags]
| Flag | Description |
|---|---|
--token string | Webhook token (required). Prefer --token "$WEBHOOK_TOKEN" |
--data string | Raw trigger payload |
--data-file string | Read trigger payload from a file (mutually exclusive with --data) |
--wait | Wait until the resulting execution completes or fails |
--poll duration | Poll interval when --wait is set (default 5s) |
--timeout duration | Max time to wait when --wait is set (default 30m0s) |
-h, --help | Help for trigger |
stackgen ai webhook trigger <webhook-id> --token "$WEBHOOK_TOKEN"
stackgen ai webhook trigger <webhook-id> --token "$WEBHOOK_TOKEN" --data '{"alert":"disk"}'
stackgen ai webhook trigger <webhook-id> --token "$WEBHOOK_TOKEN" --data-file ./payload.json --wait --timeout 30m
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-or-name> [flags]
The second argument accepts either the artifact id or the filename shown by list. Ids are matched first, then full filenames case-insensitively. When several artifacts share the same filename, the most recently created one is downloaded.
| Flag | Description |
|---|---|
--destination string | Directory to write the artifact into (default .) |
-h, --help | Help for download |
stackgen ai session artifacts download <session-id> <artifact-id>
stackgen ai session artifacts download <session-id> rca-report.md --destination ./out
Subcommands
knowledge
Upload documents to an Aiden Knowledge Hub, list documents, check ingestion status, delete documents, and list Knowledge Hubs.