@pixelml/agenticflow-cli 1.6.2 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -4
- package/dist/cli/changelog.d.ts.map +1 -1
- package/dist/cli/changelog.js +30 -0
- package/dist/cli/changelog.js.map +1 -1
- package/dist/cli/main.d.ts.map +1 -1
- package/dist/cli/main.js +47 -12
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/playbooks.d.ts.map +1 -1
- package/dist/cli/playbooks.js +11 -1
- package/dist/cli/playbooks.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -32,10 +32,14 @@ af workforce init --blueprint dev-shop --name "My Dev Team" --json
|
|
|
32
32
|
|
|
33
33
|
## What you can build
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
|
|
35
|
+
| You want… | Use | Because |
|
|
36
|
+
|---|---|---|
|
|
37
|
+
| A single chat endpoint / customer-facing bot / one assistant | **`af agent create`** then `af agent run` | One prompt handles routing. Iterate with `af agent update --patch` |
|
|
38
|
+
| Multiple agents that hand off (research → write, triage → specialist, dev shop, marketing agency, Amazon seller team, …) | **`af workforce init --blueprint <id>`** | Creates workforce + N agents + wired DAG in one command. Atomic rollback on failure |
|
|
39
|
+
| A DAG of prompt/tool/logic nodes (not necessarily multi-agent) | **`af workflow create`** then `af workflow run` | Classic workflow engine |
|
|
40
|
+
| Attach Google Docs/Sheets/Slack/Notion to an agent | **`af mcp-clients list/inspect`** then `af agent update --patch` | Inspect before attach to avoid Pipedream write-capability traps |
|
|
41
|
+
|
|
42
|
+
Don't reach for a workforce when a single agent suffices — the 6 built-in workforce blueprints are for genuine multi-agent orchestration (dev-shop, marketing-agency, sales-team, content-studio, support-center, amazon-seller).
|
|
39
43
|
|
|
40
44
|
## Authentication
|
|
41
45
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../src/cli/changelog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,eAAO,MAAM,SAAS,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"changelog.d.ts","sourceRoot":"","sources":["../../src/cli/changelog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,eAAO,MAAM,SAAS,EAAE,cAAc,EAkOrC,CAAC;AAEF,wBAAgB,kBAAkB,IAAI,cAAc,CAEnD;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,EAAE,CAInE"}
|
package/dist/cli/changelog.js
CHANGED
|
@@ -5,6 +5,36 @@
|
|
|
5
5
|
* and displayed after upgrade.
|
|
6
6
|
*/
|
|
7
7
|
export const CHANGELOG = [
|
|
8
|
+
{
|
|
9
|
+
version: "1.6.4",
|
|
10
|
+
date: "2026-04-14",
|
|
11
|
+
highlights: [
|
|
12
|
+
"`af bootstrap` now surfaces a `data_fresh` boolean and `data_fresh_hint` when the backend health check fails — empty `agents`/`workforces` arrays no longer look identical to 'workspace is empty'. Also added `auth.health_error` with the underlying fetch error message",
|
|
13
|
+
"`af bootstrap --strict` exits non-zero when backend health is false — use in CI to prevent downstream mutations against a degraded workspace",
|
|
14
|
+
"`af workforce list --name-contains <substr> --fields id,name --json` — same client-side filter + projection as `af agent list` and `af mcp-clients list`. Closes a documentation lie where the flag was advertised but not implemented",
|
|
15
|
+
"`af workforce init --blueprint --help` no longer references the deprecated `af paperclip blueprints` as the canonical list source. Points at `af bootstrap --json > blueprints[]` with inline slug names",
|
|
16
|
+
"README + CONTEXT.md + the gitbook-hosted `docs/09-developers/cli/` pages updated to v1.6 surface (native workforce lead, `--patch`, MCP inspect, paperclip deprecation notice, error-envelope shape)",
|
|
17
|
+
],
|
|
18
|
+
for_ai: [
|
|
19
|
+
"After `af bootstrap --json`, check `data_fresh`. If false, the empty lists are UNVERIFIED — don't assume the workspace is empty. Fix network/auth before mutating",
|
|
20
|
+
"In CI, run `af bootstrap --strict` instead of the bare form — non-zero exit guards the rest of the pipeline",
|
|
21
|
+
"`af workforce list --fields id,name --name-contains <substr> --json` now works (was documented but broken in prior versions) — use it to find your own test workforces before bulk delete",
|
|
22
|
+
],
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
version: "1.6.3",
|
|
26
|
+
date: "2026-04-14",
|
|
27
|
+
highlights: [
|
|
28
|
+
"`af schema agent --field suggested_messages` now shows the real shape: `array of { title, label, action }` (object, not strings). Previously the CLI doc said 'array of strings' and the server 422'd — verified against the AgenticFlow `AgentSuggestedMessage` pydantic model in workflow_chef",
|
|
29
|
+
"New agent-vs-workforce decision table added to README (top-of-page) + CONTEXT.md + `af context` invariants. A single customer-facing bot should be `af agent create` with rules in the system prompt — not a `support-center` workforce",
|
|
30
|
+
"`af playbook first-touch` STEP 2 fixed: no longer references `af paperclip blueprints` (was a stale leak from the v1.6.1 playbook pass). Points at `af bootstrap > blueprints[]` instead",
|
|
31
|
+
],
|
|
32
|
+
for_ai: [
|
|
33
|
+
"If you need `suggested_messages` on an agent, each item is `{title: string, label: string, action: string}` — `title` shows as the button text, `action` is the message sent on click",
|
|
34
|
+
"DECISION HEURISTIC: one chat endpoint → `af agent create`. Multiple agents with hand-off → `af workforce init --blueprint <id>`. When in doubt, start with agent — you can always graduate to a workforce later",
|
|
35
|
+
"`af context --json` invariants now include the agent-vs-workforce choice explicitly — it used to over-rotate operators toward workforce",
|
|
36
|
+
],
|
|
37
|
+
},
|
|
8
38
|
{
|
|
9
39
|
version: "1.6.2",
|
|
10
40
|
date: "2026-04-14",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"changelog.js","sourceRoot":"","sources":["../../src/cli/changelog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,MAAM,CAAC,MAAM,SAAS,GAAqB;IACzC;QACE,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE;YACV,0SAA0S;YAC1S,+JAA+J;YAC/J,4NAA4N;YAC5N,uFAAuF;SACxF;QACD,MAAM,EAAE;YACN,oKAAoK;YACpK,kHAAkH;YAClH,iJAAiJ;SAClJ;KACF;IACD;QACE,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE;YACV,gQAAgQ;YAChQ,kJAAkJ;YAClJ,yLAAyL;YACzL,8KAA8K;SAC/K;QACD,MAAM,EAAE;YACN,+NAA+N;YAC/N,8KAA8K;YAC9K,uLAAuL;SACxL;KACF;IACD;QACE,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE;YACV,wRAAwR;YACxR,iJAAiJ;YACjJ,gJAAgJ;YAChJ,qLAAqL;YACrL,2IAA2I;SAC5I;QACD,MAAM,EAAE;YACN,kPAAkP;YAClP,uKAAuK;YACvK,kMAAkM;YAClM,+JAA+J;YAC/J,0KAA0K;SAC3K;KACF;IACD;QACE,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE;YACV,kPAAkP;YAClP,kOAAkO;YAClO,oPAAoP;SACrP;QACD,MAAM,EAAE;YACN,mMAAmM;YACnM,gMAAgM;YAChM,wOAAwO;SACzO;KACF;IACD;QACE,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE;YACV,8PAA8P;YAC9P,2JAA2J;YAC3J,0KAA0K;YAC1K,uNAAuN;YACvN,2RAA2R;Y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,EAAE;YACN,6FAA6F;YAC7F,+GAA+G;YAC/G,qFAAqF;YACrF,6EAA6E;YAC7E,qEAAqE;YACrE,oHAAoH;YACpH,wGAAwG;YACxG,mGAAmG;SACpG;KACF;IACD;QACE,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE;YACV,gEAAgE;YAChE,uEAAuE;YACvE,mDAAmD;YACnD,4CAA4C;SAC7C;QACD,MAAM,EAAE;YACN,6CAA6C;YAC7C,6DAA6D;SAC9D;KACF;IACD;QACE,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE;YACV,kCAAkC;YAClC,6CAA6C;YAC7C,qCAAqC;SACtC;QACD,MAAM,EAAE;YACN,0CAA0C;SAC3C;KACF;CACF,CAAC;AAEF,MAAM,UAAU,kBAAkB;IAChC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,MAAM,GAAG,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;IAC9D,IAAI,GAAG,IAAI,CAAC;QAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACjC,CAAC"}
|
|
1
|
+
{"version":3,"file":"changelog.js","sourceRoot":"","sources":["../../src/cli/changelog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,MAAM,CAAC,MAAM,SAAS,GAAqB;IACzC;QACE,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE;YACV,4QAA4Q;YAC5Q,8IAA8I;YAC9I,wOAAwO;YACxO,0MAA0M;YAC1M,sMAAsM;SACvM;QACD,MAAM,EAAE;YACN,mKAAmK;YACnK,6GAA6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;YACN,6FAA6F;YAC7F,+GAA+G;YAC/G,qFAAqF;YACrF,6EAA6E;YAC7E,qEAAqE;YACrE,oHAAoH;YACpH,wGAAwG;YACxG,mGAAmG;SACpG;KACF;IACD;QACE,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE;YACV,gEAAgE;YAChE,uEAAuE;YACvE,mDAAmD;YACnD,4CAA4C;SAC7C;QACD,MAAM,EAAE;YACN,6CAA6C;YAC7C,6DAA6D;SAC9D;KACF;IACD;QACE,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE;YACV,kCAAkC;YAClC,6CAA6C;YAC7C,qCAAqC;SACtC;QACD,MAAM,EAAE;YACN,0CAA0C;SAC3C;KACF;CACF,CAAC;AAEF,MAAM,UAAU,kBAAkB;IAChC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC;AACtB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,OAAe;IAC/C,MAAM,GAAG,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;IAC9D,IAAI,GAAG,IAAI,CAAC;QAAE,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACjC,CAAC"}
|
package/dist/cli/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAi8BpC,wBAAgB,aAAa,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/cli/main.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAi8BpC,wBAAgB,aAAa,IAAI,OAAO,CA6iLvC;AAED,wBAAsB,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAwB3D"}
|
package/dist/cli/main.js
CHANGED
|
@@ -830,7 +830,7 @@ export function createProgram() {
|
|
|
830
830
|
suggest_replies: "bool (default: true) — generate suggested follow-up replies",
|
|
831
831
|
auto_generate_title: "bool (default: true) — auto-title new threads",
|
|
832
832
|
welcome_message: "string — greeting on new thread",
|
|
833
|
-
suggested_messages: "array of
|
|
833
|
+
suggested_messages: "array of { title: string, label: string, action: string } — pre-populated example prompts shown to users. `title` is the short display text; `label` is the sub-text; `action` is the message body sent on click. NOT an array of strings — server rejects strings",
|
|
834
834
|
sub_agents: "array — sub-agent configurations for agent teams",
|
|
835
835
|
plugins: "array — plugin configurations",
|
|
836
836
|
},
|
|
@@ -937,22 +937,28 @@ export function createProgram() {
|
|
|
937
937
|
program
|
|
938
938
|
.command("bootstrap")
|
|
939
939
|
.description("Single-command AI agent setup: verify auth, list agents, return schemas. Combines context + doctor + schema + agent list.")
|
|
940
|
-
.
|
|
940
|
+
.option("--strict", "Exit non-zero when the backend health check fails. Useful in CI / for scripts that shouldn't proceed into a degraded workspace.")
|
|
941
|
+
.action(async (opts) => {
|
|
941
942
|
// Combine everything an AI needs in one response
|
|
942
943
|
const client = buildClient(program.opts());
|
|
943
944
|
const token = resolveToken(program.opts());
|
|
944
945
|
let health = false;
|
|
946
|
+
let healthError = null;
|
|
945
947
|
let agents = [];
|
|
946
948
|
try {
|
|
947
949
|
const sdk = client.sdk;
|
|
948
950
|
const resp = await sdk.get("/v1/health");
|
|
949
951
|
health = resp.ok;
|
|
952
|
+
if (!resp.ok)
|
|
953
|
+
healthError = `HTTP ${resp.statusCode}`;
|
|
954
|
+
}
|
|
955
|
+
catch (err) {
|
|
956
|
+
healthError = err instanceof Error ? err.message : String(err);
|
|
950
957
|
}
|
|
951
|
-
catch { /* unhealthy */ }
|
|
952
958
|
try {
|
|
953
959
|
agents = (await client.agents.list({ limit: 10 }));
|
|
954
960
|
}
|
|
955
|
-
catch { /* no agents or unauth */ }
|
|
961
|
+
catch { /* no agents or unauth — list stays empty */ }
|
|
956
962
|
// Workforces are the AgenticFlow-native multi-agent primitive. Fetch
|
|
957
963
|
// the first 10 for the bootstrap snapshot. Tolerate failure (endpoint
|
|
958
964
|
// may 404 in very old backends).
|
|
@@ -961,14 +967,24 @@ export function createProgram() {
|
|
|
961
967
|
workforces = (await client.workforces.list({ limit: 10 }));
|
|
962
968
|
}
|
|
963
969
|
catch { /* no workforces or unauth */ }
|
|
970
|
+
// Annotate data-freshness so callers know whether the empty arrays mean
|
|
971
|
+
// "nothing there" or "couldn't verify because backend was unreachable".
|
|
972
|
+
// Matches codex-round-1 friction point F1 — previously an empty agents[]
|
|
973
|
+
// looked identical whether the workspace was empty or the API was down.
|
|
974
|
+
const dataFresh = health;
|
|
964
975
|
printResult({
|
|
965
976
|
schema: "agenticflow.bootstrap.v1",
|
|
966
977
|
auth: {
|
|
967
978
|
authenticated: !!token,
|
|
968
979
|
health,
|
|
980
|
+
health_error: healthError,
|
|
969
981
|
workspace_id: client.sdk.workspaceId,
|
|
970
982
|
project_id: client.sdk.projectId,
|
|
971
983
|
},
|
|
984
|
+
data_fresh: dataFresh,
|
|
985
|
+
data_fresh_hint: dataFresh
|
|
986
|
+
? undefined
|
|
987
|
+
: "Backend unreachable — `agents`, `workforces`, and the `blueprints` array are the local/bundled shape only. Empty lists DO NOT mean 'nothing in your workspace'. Fix network/auth before mutating.",
|
|
972
988
|
agents: Array.isArray(agents)
|
|
973
989
|
? agents.slice(0, 10).map((a) => {
|
|
974
990
|
const ag = a;
|
|
@@ -1025,6 +1041,11 @@ export function createProgram() {
|
|
|
1025
1041
|
datasets: webUrl("datasets", { workspaceId: client.sdk.workspaceId }),
|
|
1026
1042
|
},
|
|
1027
1043
|
});
|
|
1044
|
+
// --strict turns degraded-backend into a non-zero exit so CI / automation
|
|
1045
|
+
// doesn't race ahead into mutations against an unreachable API.
|
|
1046
|
+
if (opts.strict && !health) {
|
|
1047
|
+
process.exit(1);
|
|
1048
|
+
}
|
|
1028
1049
|
});
|
|
1029
1050
|
// ═════════════════════════════════════════════════════════════════
|
|
1030
1051
|
// changelog
|
|
@@ -1065,9 +1086,10 @@ export function createProgram() {
|
|
|
1065
1086
|
"ALWAYS use --json for machine-readable output in automation",
|
|
1066
1087
|
"ALWAYS use --dry-run before mutating create/deploy commands you're not 100% sure about",
|
|
1067
1088
|
"ALWAYS use --fields on list commands (saves context window)",
|
|
1089
|
+
"CHOOSE agent vs workforce by orchestration need: single chat endpoint / one assistant → `af agent create`. Multiple agents with hand-off (research → write, triage → specialist, the 6 built-in blueprints) → `af workforce init --blueprint <id>`. Don't use a workforce for single-bot use cases",
|
|
1068
1090
|
"PREFER `af agent update --patch` over full-body PUT — preserves MCP clients + tools + code_exec while changing only the fields you supply",
|
|
1069
|
-
"PREFER `af workforce init --blueprint <id>` over wiring agents manually — one command
|
|
1070
|
-
"USE `af schema <resource> --field <name>` to drill into nested payload shapes (e.g. mcp_clients, response_format) instead of guessing",
|
|
1091
|
+
"PREFER `af workforce init --blueprint <id>` over wiring a workforce's agents manually — one command creates workforce + agents + wired DAG (v1.6+)",
|
|
1092
|
+
"USE `af schema <resource> --field <name>` to drill into nested payload shapes (e.g. mcp_clients, suggested_messages, response_format) instead of guessing",
|
|
1071
1093
|
"BEFORE attaching an MCP client, run `af mcp-clients inspect --id <id>` — pattern=pipedream with write_capable_tools is likely to fail on execute. See `af playbook mcp-client-quirks`",
|
|
1072
1094
|
"ON errors, check `hint` and `details.payload` — the CLI tells you exactly what to fix before you retry",
|
|
1073
1095
|
"NEVER hard-code IDs — fetch dynamically via list/get",
|
|
@@ -4293,13 +4315,26 @@ export function createProgram() {
|
|
|
4293
4315
|
.option("--workspace-id <id>", "Workspace ID (overrides env)")
|
|
4294
4316
|
.option("--limit <n>", "Limit")
|
|
4295
4317
|
.option("--offset <n>", "Offset")
|
|
4318
|
+
.option("--name-contains <substr>", "Client-side case-insensitive substring filter on workforce `name`.")
|
|
4319
|
+
.option("--fields <fields>", "Comma-separated fields to return (e.g. id,name,is_public). Applies after --name-contains.")
|
|
4296
4320
|
.action(async (opts) => {
|
|
4297
4321
|
const client = buildClient(program.opts());
|
|
4298
|
-
await run(() =>
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4322
|
+
await run(async () => {
|
|
4323
|
+
const rows = await client.workforces.list({
|
|
4324
|
+
workspaceId: opts.workspaceId,
|
|
4325
|
+
limit: parseOptionalInteger(opts.limit, "--limit", 1),
|
|
4326
|
+
offset: parseOptionalInteger(opts.offset, "--offset", 0),
|
|
4327
|
+
});
|
|
4328
|
+
let out = rows;
|
|
4329
|
+
const needle = opts.nameContains?.toLowerCase();
|
|
4330
|
+
if (needle && Array.isArray(out)) {
|
|
4331
|
+
out = out.filter((r) => {
|
|
4332
|
+
const n = r["name"];
|
|
4333
|
+
return typeof n === "string" && n.toLowerCase().includes(needle);
|
|
4334
|
+
});
|
|
4335
|
+
}
|
|
4336
|
+
return applyFieldsFilter(out, opts.fields);
|
|
4337
|
+
});
|
|
4303
4338
|
});
|
|
4304
4339
|
workforceCmd
|
|
4305
4340
|
.command("get")
|
|
@@ -4628,7 +4663,7 @@ export function createProgram() {
|
|
|
4628
4663
|
"(v1.6+): creates a real agent per non-optional blueprint slot, then wires " +
|
|
4629
4664
|
"them into a runnable DAG. Use --skeleton-only for the old v1.5 behavior " +
|
|
4630
4665
|
"(trigger + output + blueprint metadata, no agents).")
|
|
4631
|
-
.requiredOption("--blueprint <slug>", "Blueprint id
|
|
4666
|
+
.requiredOption("--blueprint <slug>", "Blueprint id. See `af bootstrap --json > blueprints[]` for available ids (dev-shop, marketing-agency, sales-team, content-studio, support-center, amazon-seller).")
|
|
4632
4667
|
.option("--name <name>", "Workforce name (defaults to blueprint name)")
|
|
4633
4668
|
.option("--workspace-id <id>", "Workspace ID (overrides env)")
|
|
4634
4669
|
.option("--project-id <id>", "Project ID to use for agent creation (defaults to env / client config)")
|