diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fce6b28f..23fdd4d1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -67,8 +67,12 @@ jobs: - name: Build run: go build ./... + # go vet ./..., except the finding Speakeasy produces on purpose for each + # OpenAPI const property (an unexported field with a json tag). Bare + # go vet has failed on every master run since 2026-10-06, when the spec + # gained its first const properties. See scripts/vet.sh. - name: Vet - run: go vet ./... + run: scripts/vet.sh - name: Unit tests run: go test ./... diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 2f41355a..78dc5961 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -66,7 +66,7 @@ cli: interactiveAuth: true interactiveMode: true interactiveTheme: - accentColor: '#38BDF8' + accentColor: '#397DFF' dimmedColor: '#64748B' errorColor: '#F87171' subtleColor: '#475569' diff --git a/.speakeasy/out.openapi.yaml b/.speakeasy/out.openapi.yaml index 92aa469e..7260fa2d 100644 --- a/.speakeasy/out.openapi.yaml +++ b/.speakeasy/out.openapi.yaml @@ -26385,10 +26385,6 @@ components: overridden: description: Present when this link does not run, because the step is not the last of its block. type: boolean - enum: - - true - x-enumNames: - - "TRUE" effectiveTo: description: 'With overridden: the step that runs instead.' type: string @@ -28858,10 +28854,6 @@ components: atStart: description: Insert as the first step of the block. Send this or afterStepID. type: boolean - enum: - - true - x-enumNames: - - "TRUE" step: $ref: '#/components/schemas/StableWorkflowStepInput' expectedSteps: @@ -30491,10 +30483,6 @@ components: atStart: description: Add them before every other action on this exit. type: boolean - enum: - - true - x-enumNames: - - "TRUE" expectedActions: maxItems: 20 type: array @@ -42068,10 +42056,6 @@ components: incomplete: description: 'Present when the search did not read everything: it stopped at its time limit, or a regular expression read only the first 1,000 characters of a longer line. The counts cover only what it read.' type: boolean - enum: - - true - x-enumNames: - - "TRUE" notSearched: type: array items: @@ -42423,10 +42407,6 @@ components: literalText: description: The pattern ran as plain text; `note` says why. type: boolean - enum: - - true - x-enumNames: - - "TRUE" hits: type: array items: diff --git a/.speakeasy/overlays/optional-literal-flags.yaml b/.speakeasy/overlays/optional-literal-flags.yaml new file mode 100644 index 00000000..9459dfed --- /dev/null +++ b/.speakeasy/overlays/optional-literal-flags.yaml @@ -0,0 +1,42 @@ +overlay: 1.0.0 +info: + title: Optional literal flags as plain optional booleans + version: 1.0.0 +# The realtime API (voiceflow/creator-app, apps/realtime) declares these five +# properties as zod `z.literal(true).optional()`: absent, or true. That reaches +# the spec as `type: boolean` with a one-value `enum: [true]`, and Speakeasy +# generates a one-value enum as a const field, which its JSON code always +# encodes and never decodes. So the CLI sent `"atStart": true` on every +# insert-step and add-actions request (the server rejects atStart together +# with afterStepID, so inserting after a step always failed), and every +# decoded response reported overridden, incomplete and literalText as true. +# +# Dropping the one-value enum leaves each one a plain optional boolean, which +# keeps "absent" distinct from "true" in both directions. The descriptions +# still come from the API. Remove this overlay once the API spec stops +# emitting these as one-value enums. +# +# Left alone on purpose: StableFunctionCheckResponseUnion.checked (true or +# false picks the union variant) and StableWorkflowStepReadOnlyContent.readOnly +# (required, always true). Those really are constants. +actions: + - target: $.components.schemas.StableWorkflowStepInsertRequest.properties.atStart.enum + remove: true + - target: $.components.schemas.StableWorkflowStepInsertRequest.properties.atStart['x-enumNames'] + remove: true + - target: $.components.schemas.StableWorkflowPortActionsAddRequest.properties.atStart.enum + remove: true + - target: $.components.schemas.StableWorkflowPortActionsAddRequest.properties.atStart['x-enumNames'] + remove: true + - target: $.components.schemas.StableWorkflowLink.properties.overridden.enum + remove: true + - target: $.components.schemas.StableWorkflowLink.properties.overridden['x-enumNames'] + remove: true + - target: $.components.schemas.StableEnvironmentSearchTextReadResponse.properties.incomplete.enum + remove: true + - target: $.components.schemas.StableEnvironmentSearchTextReadResponse.properties.incomplete['x-enumNames'] + remove: true + - target: $.components.schemas.StableTranscriptGrepResponse.properties.literalText.enum + remove: true + - target: $.components.schemas.StableTranscriptGrepResponse.properties.literalText['x-enumNames'] + remove: true diff --git a/.speakeasy/workflow.yaml b/.speakeasy/workflow.yaml index 6a28fdcf..5a089866 100644 --- a/.speakeasy/workflow.yaml +++ b/.speakeasy/workflow.yaml @@ -4,6 +4,8 @@ sources: Voiceflow: inputs: - location: ./openapi.stable.json + overlays: + - location: ./.speakeasy/overlays/optional-literal-flags.yaml transformations: - filterOperations: operations: StableEnvironmentController_export diff --git a/README.md b/README.md index adb765d8..031a7a7a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ The Voiceflow CLI. Build, test, and operate AI agents on [Voiceflow](https://www ## Summary -Realtime: Realtime gateway API service +Build, test, and operate Voiceflow AI agents from your terminal, your CI, or your coding agent. diff --git a/docs/vf.md b/docs/vf.md index 6789184d..b6ead473 100644 --- a/docs/vf.md +++ b/docs/vf.md @@ -1,10 +1,10 @@ ## vf -Realtime: Realtime gateway API service +Build, test, and operate Voiceflow AI agents from your terminal ### Synopsis -Realtime: Realtime gateway API service +vf is the Voiceflow CLI. Build, test, and operate AI agents on Voiceflow from your terminal, your CI, or your coding agent. ``` vf [flags] @@ -21,7 +21,7 @@ vf [flags] -h, --help help for vf --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -31,25 +31,25 @@ vf [flags] ### SEE ALSO -* [vf agent](vf_agent.md) - Operations for agent -* [vf analytics](vf_analytics.md) - Operations for analytics -* [vf api-tool](vf_api-tool.md) - Operations for api-tool +* [vf agent](vf_agent.md) - Configure the agent's instructions, prompt and voice +* [vf analytics](vf_analytics.md) - See how agents are used: calls, tokens, tools +* [vf api-tool](vf_api-tool.md) - Manage API tools: HTTP requests the agent can make * [vf auth](vf_auth.md) - Manage authentication credentials * [vf configure](vf_configure.md) - Configure authentication credentials and preferences -* [vf conversation](vf_conversation.md) - Operations for conversation -* [vf document](vf_document.md) - Operations for document -* [vf environment](vf_environment.md) - Operations for environment -* [vf evaluation](vf_evaluation.md) - Operations for evaluation +* [vf conversation](vf_conversation.md) - Talk to an agent: send messages, run scripts +* [vf document](vf_document.md) - Manage knowledge base documents and sitemaps +* [vf environment](vf_environment.md) - Publish, clone, merge and compare environments +* [vf evaluation](vf_evaluation.md) - Create and run evaluations that score transcripts * [vf explore](vf_explore.md) - Interactively browse and run commands -* [vf function](vf_function.md) - Operations for function -* [vf knowledge-base](vf_knowledge-base.md) - Operations for knowledge-base -* [vf mcp-server](vf_mcp-server.md) - Operations for mcp-server -* [vf mcp-tool](vf_mcp-tool.md) - Operations for mcp-tool -* [vf playbook](vf_playbook.md) - Operations for playbook -* [vf project](vf_project.md) - Operations for project -* [vf tool](vf_tool.md) - Operations for tool -* [vf transcript](vf_transcript.md) - Operations for transcript -* [vf variable](vf_variable.md) - Operations for variable +* [vf function](vf_function.md) - Write, run and manage functions +* [vf knowledge-base](vf_knowledge-base.md) - Query the knowledge base +* [vf mcp-server](vf_mcp-server.md) - Manage the MCP servers an agent connects to +* [vf mcp-tool](vf_mcp-tool.md) - List, inspect and run MCP server tools +* [vf playbook](vf_playbook.md) - Build playbooks: instructions, tools and exit paths +* [vf project](vf_project.md) - Create, list and manage projects +* [vf tool](vf_tool.md) - Manage the tools an agent and its playbooks use +* [vf transcript](vf_transcript.md) - Search and read conversation transcripts +* [vf variable](vf_variable.md) - Manage the variables an agent reads and sets * [vf version](vf_version.md) - Print the CLI version * [vf whoami](vf_whoami.md) - Display current authentication configuration -* [vf workspace](vf_workspace.md) - Operations for workspace +* [vf workspace](vf_workspace.md) - Create, list and manage workspaces diff --git a/docs/vf_agent.md b/docs/vf_agent.md index bf378ca7..62591903 100644 --- a/docs/vf_agent.md +++ b/docs/vf_agent.md @@ -1,10 +1,10 @@ ## vf agent -Operations for agent +Configure the agent's instructions, prompt and voice ### Synopsis -Operations for agent +Configure the agent's instructions, prompt and voice ``` vf agent [flags] @@ -26,7 +26,7 @@ vf agent [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,6 +36,6 @@ vf agent [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf agent get](vf_agent_get.md) - Get agent * [vf agent update](vf_agent_update.md) - Update agent diff --git a/docs/vf_agent_get.md b/docs/vf_agent_get.md index ee57d3e1..078f21cf 100644 --- a/docs/vf_agent_get.md +++ b/docs/vf_agent_get.md @@ -34,7 +34,7 @@ vf agent get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -44,4 +44,4 @@ vf agent get [flags] ### SEE ALSO -* [vf agent](vf_agent.md) - Operations for agent +* [vf agent](vf_agent.md) - Configure the agent's instructions, prompt and voice diff --git a/docs/vf_agent_update.md b/docs/vf_agent_update.md index dbc1d2d7..c51a7fd1 100644 --- a/docs/vf_agent_update.md +++ b/docs/vf_agent_update.md @@ -51,7 +51,7 @@ vf agent update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -61,4 +61,4 @@ vf agent update [flags] ### SEE ALSO -* [vf agent](vf_agent.md) - Operations for agent +* [vf agent](vf_agent.md) - Configure the agent's instructions, prompt and voice diff --git a/docs/vf_analytics.md b/docs/vf_analytics.md index 1eb3e283..956c91a3 100644 --- a/docs/vf_analytics.md +++ b/docs/vf_analytics.md @@ -1,10 +1,10 @@ ## vf analytics -Operations for analytics +See how agents are used: calls, tokens, tools ### Synopsis -Operations for analytics +See how agents are used: calls, tokens, tools ``` vf analytics [flags] @@ -26,7 +26,7 @@ vf analytics [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,5 +36,5 @@ vf analytics [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query.md b/docs/vf_analytics_query.md index 3a6c4d3f..26bc4d42 100644 --- a/docs/vf_analytics_query.md +++ b/docs/vf_analytics_query.md @@ -1,10 +1,10 @@ ## vf analytics query -Operations for query +Query calls, token use, and tool and document use ### Synopsis -Operations for query +Query calls, token use, and tool and document use ``` vf analytics query [flags] @@ -26,7 +26,7 @@ vf analytics query [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,7 +36,7 @@ vf analytics query [flags] ### SEE ALSO -* [vf analytics](vf_analytics.md) - Operations for analytics +* [vf analytics](vf_analytics.md) - See how agents are used: calls, tokens, tools * [vf analytics query api-tool-usage](vf_analytics_query_api-tool-usage.md) - Query API tool usage * [vf analytics query call-count](vf_analytics_query_call-count.md) - Query call count * [vf analytics query call-duration](vf_analytics_query_call-duration.md) - Query call duration diff --git a/docs/vf_analytics_query_api-tool-usage.md b/docs/vf_analytics_query_api-tool-usage.md index 60a1e033..def5a52b 100644 --- a/docs/vf_analytics_query_api-tool-usage.md +++ b/docs/vf_analytics_query_api-tool-usage.md @@ -43,7 +43,7 @@ vf analytics query api-tool-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -53,4 +53,4 @@ vf analytics query api-tool-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_call-count.md b/docs/vf_analytics_query_call-count.md index 537ed502..bab29c2d 100644 --- a/docs/vf_analytics_query_call-count.md +++ b/docs/vf_analytics_query_call-count.md @@ -40,7 +40,7 @@ vf analytics query call-count [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -50,4 +50,4 @@ vf analytics query call-count [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_call-duration.md b/docs/vf_analytics_query_call-duration.md index fb5345cb..3eb8e036 100644 --- a/docs/vf_analytics_query_call-duration.md +++ b/docs/vf_analytics_query_call-duration.md @@ -40,7 +40,7 @@ vf analytics query call-duration [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -50,4 +50,4 @@ vf analytics query call-duration [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_category-token-usage.md b/docs/vf_analytics_query_category-token-usage.md index 1665d9f1..7e872c07 100644 --- a/docs/vf_analytics_query_category-token-usage.md +++ b/docs/vf_analytics_query_category-token-usage.md @@ -41,7 +41,7 @@ vf analytics query category-token-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -51,4 +51,4 @@ vf analytics query category-token-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_daily-token-usage.md b/docs/vf_analytics_query_daily-token-usage.md index 97b6e700..a254b792 100644 --- a/docs/vf_analytics_query_daily-token-usage.md +++ b/docs/vf_analytics_query_daily-token-usage.md @@ -39,7 +39,7 @@ vf analytics query daily-token-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -49,4 +49,4 @@ vf analytics query daily-token-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_entity-token-usage.md b/docs/vf_analytics_query_entity-token-usage.md index 1b08b339..29344221 100644 --- a/docs/vf_analytics_query_entity-token-usage.md +++ b/docs/vf_analytics_query_entity-token-usage.md @@ -37,7 +37,7 @@ vf analytics query entity-token-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -47,4 +47,4 @@ vf analytics query entity-token-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_function-usage.md b/docs/vf_analytics_query_function-usage.md index 720aa2d1..fd3c044c 100644 --- a/docs/vf_analytics_query_function-usage.md +++ b/docs/vf_analytics_query_function-usage.md @@ -43,7 +43,7 @@ vf analytics query function-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -53,4 +53,4 @@ vf analytics query function-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_hourly-organization-token-usage.md b/docs/vf_analytics_query_hourly-organization-token-usage.md index d6657f0e..b1ef03a7 100644 --- a/docs/vf_analytics_query_hourly-organization-token-usage.md +++ b/docs/vf_analytics_query_hourly-organization-token-usage.md @@ -39,7 +39,7 @@ vf analytics query hourly-organization-token-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -49,4 +49,4 @@ vf analytics query hourly-organization-token-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_hourly-project-token-usage.md b/docs/vf_analytics_query_hourly-project-token-usage.md index f7a6ec37..8815361e 100644 --- a/docs/vf_analytics_query_hourly-project-token-usage.md +++ b/docs/vf_analytics_query_hourly-project-token-usage.md @@ -41,7 +41,7 @@ vf analytics query hourly-project-token-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -51,4 +51,4 @@ vf analytics query hourly-project-token-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_integration-usage.md b/docs/vf_analytics_query_integration-usage.md index 31187a23..fece5109 100644 --- a/docs/vf_analytics_query_integration-usage.md +++ b/docs/vf_analytics_query_integration-usage.md @@ -43,7 +43,7 @@ vf analytics query integration-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -53,4 +53,4 @@ vf analytics query integration-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_intent-usage.md b/docs/vf_analytics_query_intent-usage.md index 4b167c38..248fb447 100644 --- a/docs/vf_analytics_query_intent-usage.md +++ b/docs/vf_analytics_query_intent-usage.md @@ -42,7 +42,7 @@ vf analytics query intent-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -52,4 +52,4 @@ vf analytics query intent-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_knowledge-base-document-usage.md b/docs/vf_analytics_query_knowledge-base-document-usage.md index 87aba5c1..acf0c226 100644 --- a/docs/vf_analytics_query_knowledge-base-document-usage.md +++ b/docs/vf_analytics_query_knowledge-base-document-usage.md @@ -42,7 +42,7 @@ vf analytics query knowledge-base-document-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -52,4 +52,4 @@ vf analytics query knowledge-base-document-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_mcp-tool-usage.md b/docs/vf_analytics_query_mcp-tool-usage.md index 56b846f7..7128d37f 100644 --- a/docs/vf_analytics_query_mcp-tool-usage.md +++ b/docs/vf_analytics_query_mcp-tool-usage.md @@ -43,7 +43,7 @@ vf analytics query mcp-tool-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -53,4 +53,4 @@ vf analytics query mcp-tool-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_organization-token-usage.md b/docs/vf_analytics_query_organization-token-usage.md index 6f3d94dd..93d65a60 100644 --- a/docs/vf_analytics_query_organization-token-usage.md +++ b/docs/vf_analytics_query_organization-token-usage.md @@ -39,7 +39,7 @@ vf analytics query organization-token-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -49,4 +49,4 @@ vf analytics query organization-token-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_playbook-usage.md b/docs/vf_analytics_query_playbook-usage.md index e96f9155..8776d09e 100644 --- a/docs/vf_analytics_query_playbook-usage.md +++ b/docs/vf_analytics_query_playbook-usage.md @@ -43,7 +43,7 @@ vf analytics query playbook-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -53,4 +53,4 @@ vf analytics query playbook-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_project-interaction-count.md b/docs/vf_analytics_query_project-interaction-count.md index fe7aeb20..72c8b449 100644 --- a/docs/vf_analytics_query_project-interaction-count.md +++ b/docs/vf_analytics_query_project-interaction-count.md @@ -40,7 +40,7 @@ vf analytics query project-interaction-count [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -50,4 +50,4 @@ vf analytics query project-interaction-count [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_project-token-usage.md b/docs/vf_analytics_query_project-token-usage.md index f15393e6..d0f3e45f 100644 --- a/docs/vf_analytics_query_project-token-usage.md +++ b/docs/vf_analytics_query_project-token-usage.md @@ -40,7 +40,7 @@ vf analytics query project-token-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -50,4 +50,4 @@ vf analytics query project-token-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_project-transcript-cost.md b/docs/vf_analytics_query_project-transcript-cost.md index 41463dfa..6e7b1e6f 100644 --- a/docs/vf_analytics_query_project-transcript-cost.md +++ b/docs/vf_analytics_query_project-transcript-cost.md @@ -41,7 +41,7 @@ vf analytics query project-transcript-cost [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -51,4 +51,4 @@ vf analytics query project-transcript-cost [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_project-transcript-count.md b/docs/vf_analytics_query_project-transcript-count.md index 0f4eb9e8..09119e00 100644 --- a/docs/vf_analytics_query_project-transcript-count.md +++ b/docs/vf_analytics_query_project-transcript-count.md @@ -40,7 +40,7 @@ vf analytics query project-transcript-count [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -50,4 +50,4 @@ vf analytics query project-transcript-count [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_prompt-usage.md b/docs/vf_analytics_query_prompt-usage.md index ab03751b..ba01bf28 100644 --- a/docs/vf_analytics_query_prompt-usage.md +++ b/docs/vf_analytics_query_prompt-usage.md @@ -43,7 +43,7 @@ vf analytics query prompt-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -53,4 +53,4 @@ vf analytics query prompt-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_unique-user-count.md b/docs/vf_analytics_query_unique-user-count.md index 334604b0..82d22ce7 100644 --- a/docs/vf_analytics_query_unique-user-count.md +++ b/docs/vf_analytics_query_unique-user-count.md @@ -40,7 +40,7 @@ vf analytics query unique-user-count [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -50,4 +50,4 @@ vf analytics query unique-user-count [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_workflow-usage.md b/docs/vf_analytics_query_workflow-usage.md index 3b784bf1..8f53d02c 100644 --- a/docs/vf_analytics_query_workflow-usage.md +++ b/docs/vf_analytics_query_workflow-usage.md @@ -42,7 +42,7 @@ vf analytics query workflow-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -52,4 +52,4 @@ vf analytics query workflow-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_workspace-interaction-count.md b/docs/vf_analytics_query_workspace-interaction-count.md index 97575b11..78d34bb8 100644 --- a/docs/vf_analytics_query_workspace-interaction-count.md +++ b/docs/vf_analytics_query_workspace-interaction-count.md @@ -38,7 +38,7 @@ vf analytics query workspace-interaction-count [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -48,4 +48,4 @@ vf analytics query workspace-interaction-count [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_workspace-token-usage.md b/docs/vf_analytics_query_workspace-token-usage.md index 76077fd3..72841f88 100644 --- a/docs/vf_analytics_query_workspace-token-usage.md +++ b/docs/vf_analytics_query_workspace-token-usage.md @@ -38,7 +38,7 @@ vf analytics query workspace-token-usage [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -48,4 +48,4 @@ vf analytics query workspace-token-usage [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_analytics_query_workspace-transcript-count.md b/docs/vf_analytics_query_workspace-transcript-count.md index 9182c1fc..ebebd48f 100644 --- a/docs/vf_analytics_query_workspace-transcript-count.md +++ b/docs/vf_analytics_query_workspace-transcript-count.md @@ -38,7 +38,7 @@ vf analytics query workspace-transcript-count [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -48,4 +48,4 @@ vf analytics query workspace-transcript-count [flags] ### SEE ALSO -* [vf analytics query](vf_analytics_query.md) - Operations for query +* [vf analytics query](vf_analytics_query.md) - Query calls, token use, and tool and document use diff --git a/docs/vf_api-tool.md b/docs/vf_api-tool.md index ce62dc80..16d133ef 100644 --- a/docs/vf_api-tool.md +++ b/docs/vf_api-tool.md @@ -1,10 +1,10 @@ ## vf api-tool -Operations for api-tool +Manage API tools: HTTP requests the agent can make ### Synopsis -Operations for api-tool +Manage API tools: HTTP requests the agent can make ``` vf api-tool [flags] @@ -26,7 +26,7 @@ vf api-tool [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,10 +36,10 @@ vf api-tool [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf api-tool create](vf_api-tool_create.md) - Create API tool * [vf api-tool delete](vf_api-tool_delete.md) - Delete API tool * [vf api-tool get](vf_api-tool_get.md) - Get API tool * [vf api-tool list](vf_api-tool_list.md) - List API tools * [vf api-tool update](vf_api-tool_update.md) - Update API tool -* [vf api-tool variable](vf_api-tool_variable.md) - Operations for api-tool-variable +* [vf api-tool variable](vf_api-tool_variable.md) - Manage an API tool's variables diff --git a/docs/vf_api-tool_create.md b/docs/vf_api-tool_create.md index 35099b3b..1b0ee37a 100644 --- a/docs/vf_api-tool_create.md +++ b/docs/vf_api-tool_create.md @@ -46,7 +46,7 @@ vf api-tool create [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -56,4 +56,4 @@ vf api-tool create [flags] ### SEE ALSO -* [vf api-tool](vf_api-tool.md) - Operations for api-tool +* [vf api-tool](vf_api-tool.md) - Manage API tools: HTTP requests the agent can make diff --git a/docs/vf_api-tool_delete.md b/docs/vf_api-tool_delete.md index e8cbf0e8..6c412550 100644 --- a/docs/vf_api-tool_delete.md +++ b/docs/vf_api-tool_delete.md @@ -35,7 +35,7 @@ vf api-tool delete [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf api-tool delete [flags] ### SEE ALSO -* [vf api-tool](vf_api-tool.md) - Operations for api-tool +* [vf api-tool](vf_api-tool.md) - Manage API tools: HTTP requests the agent can make diff --git a/docs/vf_api-tool_get.md b/docs/vf_api-tool_get.md index 6e9e9913..916e69f6 100644 --- a/docs/vf_api-tool_get.md +++ b/docs/vf_api-tool_get.md @@ -35,7 +35,7 @@ vf api-tool get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf api-tool get [flags] ### SEE ALSO -* [vf api-tool](vf_api-tool.md) - Operations for api-tool +* [vf api-tool](vf_api-tool.md) - Manage API tools: HTTP requests the agent can make diff --git a/docs/vf_api-tool_list.md b/docs/vf_api-tool_list.md index f30c38e1..fe51e235 100644 --- a/docs/vf_api-tool_list.md +++ b/docs/vf_api-tool_list.md @@ -34,7 +34,7 @@ vf api-tool list [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -44,4 +44,4 @@ vf api-tool list [flags] ### SEE ALSO -* [vf api-tool](vf_api-tool.md) - Operations for api-tool +* [vf api-tool](vf_api-tool.md) - Manage API tools: HTTP requests the agent can make diff --git a/docs/vf_api-tool_update.md b/docs/vf_api-tool_update.md index 98cc4543..9dd12296 100644 --- a/docs/vf_api-tool_update.md +++ b/docs/vf_api-tool_update.md @@ -47,7 +47,7 @@ vf api-tool update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -57,4 +57,4 @@ vf api-tool update [flags] ### SEE ALSO -* [vf api-tool](vf_api-tool.md) - Operations for api-tool +* [vf api-tool](vf_api-tool.md) - Manage API tools: HTTP requests the agent can make diff --git a/docs/vf_api-tool_variable.md b/docs/vf_api-tool_variable.md index 4331cb1c..ca090d7f 100644 --- a/docs/vf_api-tool_variable.md +++ b/docs/vf_api-tool_variable.md @@ -1,10 +1,10 @@ ## vf api-tool variable -Operations for api-tool-variable +Manage an API tool's variables ### Synopsis -Operations for api-tool-variable +Manage an API tool's variables ``` vf api-tool variable [flags] @@ -26,7 +26,7 @@ vf api-tool variable [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,7 +36,7 @@ vf api-tool variable [flags] ### SEE ALSO -* [vf api-tool](vf_api-tool.md) - Operations for api-tool +* [vf api-tool](vf_api-tool.md) - Manage API tools: HTTP requests the agent can make * [vf api-tool variable create](vf_api-tool_variable_create.md) - Create variable * [vf api-tool variable delete](vf_api-tool_variable_delete.md) - Delete variable * [vf api-tool variable get](vf_api-tool_variable_get.md) - Get variable diff --git a/docs/vf_api-tool_variable_create.md b/docs/vf_api-tool_variable_create.md index 07c6871a..633bf28d 100644 --- a/docs/vf_api-tool_variable_create.md +++ b/docs/vf_api-tool_variable_create.md @@ -38,7 +38,7 @@ vf api-tool variable create [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -48,4 +48,4 @@ vf api-tool variable create [flags] ### SEE ALSO -* [vf api-tool variable](vf_api-tool_variable.md) - Operations for api-tool-variable +* [vf api-tool variable](vf_api-tool_variable.md) - Manage an API tool's variables diff --git a/docs/vf_api-tool_variable_delete.md b/docs/vf_api-tool_variable_delete.md index 478e385e..3d714450 100644 --- a/docs/vf_api-tool_variable_delete.md +++ b/docs/vf_api-tool_variable_delete.md @@ -35,7 +35,7 @@ vf api-tool variable delete [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf api-tool variable delete [flags] ### SEE ALSO -* [vf api-tool variable](vf_api-tool_variable.md) - Operations for api-tool-variable +* [vf api-tool variable](vf_api-tool_variable.md) - Manage an API tool's variables diff --git a/docs/vf_api-tool_variable_get.md b/docs/vf_api-tool_variable_get.md index feeba35a..a9b145d2 100644 --- a/docs/vf_api-tool_variable_get.md +++ b/docs/vf_api-tool_variable_get.md @@ -35,7 +35,7 @@ vf api-tool variable get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf api-tool variable get [flags] ### SEE ALSO -* [vf api-tool variable](vf_api-tool_variable.md) - Operations for api-tool-variable +* [vf api-tool variable](vf_api-tool_variable.md) - Manage an API tool's variables diff --git a/docs/vf_api-tool_variable_list.md b/docs/vf_api-tool_variable_list.md index e54125c3..89e40778 100644 --- a/docs/vf_api-tool_variable_list.md +++ b/docs/vf_api-tool_variable_list.md @@ -35,7 +35,7 @@ vf api-tool variable list [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf api-tool variable list [flags] ### SEE ALSO -* [vf api-tool variable](vf_api-tool_variable.md) - Operations for api-tool-variable +* [vf api-tool variable](vf_api-tool_variable.md) - Manage an API tool's variables diff --git a/docs/vf_api-tool_variable_update.md b/docs/vf_api-tool_variable_update.md index 62705b52..ff418d95 100644 --- a/docs/vf_api-tool_variable_update.md +++ b/docs/vf_api-tool_variable_update.md @@ -38,7 +38,7 @@ vf api-tool variable update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -48,4 +48,4 @@ vf api-tool variable update [flags] ### SEE ALSO -* [vf api-tool variable](vf_api-tool_variable.md) - Operations for api-tool-variable +* [vf api-tool variable](vf_api-tool_variable.md) - Manage an API tool's variables diff --git a/docs/vf_auth.md b/docs/vf_auth.md index 26e8a3c3..0b8df780 100644 --- a/docs/vf_auth.md +++ b/docs/vf_auth.md @@ -28,7 +28,7 @@ Subcommands: -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -38,7 +38,7 @@ Subcommands: ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf auth login](vf_auth_login.md) - Sign in through the browser or configure credentials * [vf auth logout](vf_auth_logout.md) - Clear all stored authentication credentials * [vf auth signup](vf_auth_signup.md) - Create a Voiceflow account in the browser and sign in diff --git a/docs/vf_auth_login.md b/docs/vf_auth_login.md index 31db44c7..d12906bb 100644 --- a/docs/vf_auth_login.md +++ b/docs/vf_auth_login.md @@ -50,7 +50,7 @@ vf auth login [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) diff --git a/docs/vf_auth_logout.md b/docs/vf_auth_logout.md index a022c6c5..e9f13c2b 100644 --- a/docs/vf_auth_logout.md +++ b/docs/vf_auth_logout.md @@ -28,7 +28,7 @@ vf auth logout [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) diff --git a/docs/vf_auth_signup.md b/docs/vf_auth_signup.md index 85e40bac..89c7f618 100644 --- a/docs/vf_auth_signup.md +++ b/docs/vf_auth_signup.md @@ -50,7 +50,7 @@ vf auth signup [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) diff --git a/docs/vf_auth_whoami.md b/docs/vf_auth_whoami.md index ec919726..dd6185f0 100644 --- a/docs/vf_auth_whoami.md +++ b/docs/vf_auth_whoami.md @@ -35,7 +35,7 @@ vf auth whoami [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) diff --git a/docs/vf_configure.md b/docs/vf_configure.md index ba9dd637..2df677cd 100644 --- a/docs/vf_configure.md +++ b/docs/vf_configure.md @@ -33,7 +33,7 @@ vf configure [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -43,4 +43,4 @@ vf configure [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal diff --git a/docs/vf_conversation.md b/docs/vf_conversation.md index 032263bf..e3642dca 100644 --- a/docs/vf_conversation.md +++ b/docs/vf_conversation.md @@ -1,10 +1,10 @@ ## vf conversation -Operations for conversation +Talk to an agent: send messages, run scripts ### Synopsis -Operations for conversation +Talk to an agent: send messages, run scripts ``` vf conversation [flags] @@ -26,7 +26,7 @@ vf conversation [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,6 +36,6 @@ vf conversation [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf conversation send](vf_conversation_send.md) - Send -* [vf conversation state](vf_conversation_state.md) - Operations for state +* [vf conversation state](vf_conversation_state.md) - Read and change a user's conversation state diff --git a/docs/vf_conversation_send.md b/docs/vf_conversation_send.md index f3b6bcef..20de3670 100644 --- a/docs/vf_conversation_send.md +++ b/docs/vf_conversation_send.md @@ -39,7 +39,7 @@ vf conversation send [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -49,4 +49,4 @@ vf conversation send [flags] ### SEE ALSO -* [vf conversation](vf_conversation.md) - Operations for conversation +* [vf conversation](vf_conversation.md) - Talk to an agent: send messages, run scripts diff --git a/docs/vf_conversation_state.md b/docs/vf_conversation_state.md index 1a3152e6..4c962229 100644 --- a/docs/vf_conversation_state.md +++ b/docs/vf_conversation_state.md @@ -1,10 +1,10 @@ ## vf conversation state -Operations for state +Read and change a user's conversation state ### Synopsis -Operations for state +Read and change a user's conversation state ``` vf conversation state [flags] @@ -26,7 +26,7 @@ vf conversation state [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,7 +36,7 @@ vf conversation state [flags] ### SEE ALSO -* [vf conversation](vf_conversation.md) - Operations for conversation +* [vf conversation](vf_conversation.md) - Talk to an agent: send messages, run scripts * [vf conversation state delete](vf_conversation_state_delete.md) - Delete state * [vf conversation state get](vf_conversation_state_get.md) - Get state * [vf conversation state update](vf_conversation_state_update.md) - Update state diff --git a/docs/vf_conversation_state_delete.md b/docs/vf_conversation_state_delete.md index c2166dcd..0c1e6192 100644 --- a/docs/vf_conversation_state_delete.md +++ b/docs/vf_conversation_state_delete.md @@ -36,7 +36,7 @@ vf conversation state delete [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -46,4 +46,4 @@ vf conversation state delete [flags] ### SEE ALSO -* [vf conversation state](vf_conversation_state.md) - Operations for state +* [vf conversation state](vf_conversation_state.md) - Read and change a user's conversation state diff --git a/docs/vf_conversation_state_get.md b/docs/vf_conversation_state_get.md index 2750dba4..a8492fbf 100644 --- a/docs/vf_conversation_state_get.md +++ b/docs/vf_conversation_state_get.md @@ -36,7 +36,7 @@ vf conversation state get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -46,4 +46,4 @@ vf conversation state get [flags] ### SEE ALSO -* [vf conversation state](vf_conversation_state.md) - Operations for state +* [vf conversation state](vf_conversation_state.md) - Read and change a user's conversation state diff --git a/docs/vf_conversation_state_update-variables.md b/docs/vf_conversation_state_update-variables.md index d57d71c9..28b153e6 100644 --- a/docs/vf_conversation_state_update-variables.md +++ b/docs/vf_conversation_state_update-variables.md @@ -38,7 +38,7 @@ vf conversation state update-variables [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -48,4 +48,4 @@ vf conversation state update-variables [flags] ### SEE ALSO -* [vf conversation state](vf_conversation_state.md) - Operations for state +* [vf conversation state](vf_conversation_state.md) - Read and change a user's conversation state diff --git a/docs/vf_conversation_state_update.md b/docs/vf_conversation_state_update.md index ed04aa32..bb74065a 100644 --- a/docs/vf_conversation_state_update.md +++ b/docs/vf_conversation_state_update.md @@ -40,7 +40,7 @@ vf conversation state update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -50,4 +50,4 @@ vf conversation state update [flags] ### SEE ALSO -* [vf conversation state](vf_conversation_state.md) - Operations for state +* [vf conversation state](vf_conversation_state.md) - Read and change a user's conversation state diff --git a/docs/vf_document.md b/docs/vf_document.md index bcfb5b5a..e8665c8b 100644 --- a/docs/vf_document.md +++ b/docs/vf_document.md @@ -1,10 +1,10 @@ ## vf document -Operations for document +Manage knowledge base documents and sitemaps ### Synopsis -Operations for document +Manage knowledge base documents and sitemaps ``` vf document [flags] @@ -26,7 +26,7 @@ vf document [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,7 +36,7 @@ vf document [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf document create-table](vf_document_create-table.md) - Create table document * [vf document create-text](vf_document_create-text.md) - Create text document * [vf document create-url](vf_document_create-url.md) - Create URL document diff --git a/docs/vf_document_create-table.md b/docs/vf_document_create-table.md index 4b9e0e33..0bc6a510 100644 --- a/docs/vf_document_create-table.md +++ b/docs/vf_document_create-table.md @@ -47,7 +47,7 @@ vf document create-table [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -57,4 +57,4 @@ vf document create-table [flags] ### SEE ALSO -* [vf document](vf_document.md) - Operations for document +* [vf document](vf_document.md) - Manage knowledge base documents and sitemaps diff --git a/docs/vf_document_create-text.md b/docs/vf_document_create-text.md index ebf67370..6547698e 100644 --- a/docs/vf_document_create-text.md +++ b/docs/vf_document_create-text.md @@ -45,7 +45,7 @@ vf document create-text [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -55,4 +55,4 @@ vf document create-text [flags] ### SEE ALSO -* [vf document](vf_document.md) - Operations for document +* [vf document](vf_document.md) - Manage knowledge base documents and sitemaps diff --git a/docs/vf_document_create-url.md b/docs/vf_document_create-url.md index 011b90ab..f9278a0a 100644 --- a/docs/vf_document_create-url.md +++ b/docs/vf_document_create-url.md @@ -45,7 +45,7 @@ vf document create-url [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -55,4 +55,4 @@ vf document create-url [flags] ### SEE ALSO -* [vf document](vf_document.md) - Operations for document +* [vf document](vf_document.md) - Manage knowledge base documents and sitemaps diff --git a/docs/vf_document_delete.md b/docs/vf_document_delete.md index 14f1aa9e..3a1b9f38 100644 --- a/docs/vf_document_delete.md +++ b/docs/vf_document_delete.md @@ -35,7 +35,7 @@ vf document delete [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf document delete [flags] ### SEE ALSO -* [vf document](vf_document.md) - Operations for document +* [vf document](vf_document.md) - Manage knowledge base documents and sitemaps diff --git a/docs/vf_document_get.md b/docs/vf_document_get.md index a7475176..248e193e 100644 --- a/docs/vf_document_get.md +++ b/docs/vf_document_get.md @@ -35,7 +35,7 @@ vf document get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf document get [flags] ### SEE ALSO -* [vf document](vf_document.md) - Operations for document +* [vf document](vf_document.md) - Manage knowledge base documents and sitemaps diff --git a/docs/vf_document_list.md b/docs/vf_document_list.md index 7446b872..c3995400 100644 --- a/docs/vf_document_list.md +++ b/docs/vf_document_list.md @@ -34,7 +34,7 @@ vf document list [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -44,4 +44,4 @@ vf document list [flags] ### SEE ALSO -* [vf document](vf_document.md) - Operations for document +* [vf document](vf_document.md) - Manage knowledge base documents and sitemaps diff --git a/docs/vf_document_update.md b/docs/vf_document_update.md index 47929315..077ea651 100644 --- a/docs/vf_document_update.md +++ b/docs/vf_document_update.md @@ -37,7 +37,7 @@ vf document update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -47,4 +47,4 @@ vf document update [flags] ### SEE ALSO -* [vf document](vf_document.md) - Operations for document +* [vf document](vf_document.md) - Manage knowledge base documents and sitemaps diff --git a/docs/vf_environment.md b/docs/vf_environment.md index 22e48818..a159d159 100644 --- a/docs/vf_environment.md +++ b/docs/vf_environment.md @@ -1,10 +1,10 @@ ## vf environment -Operations for environment +Publish, clone, merge and compare environments ### Synopsis -Operations for environment +Publish, clone, merge and compare environments ``` vf environment [flags] @@ -26,7 +26,7 @@ vf environment [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,7 +36,7 @@ vf environment [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf environment clone](vf_environment_clone.md) - Clone environment * [vf environment compile](vf_environment_compile.md) - Compile environment * [vf environment delete](vf_environment_delete.md) - Delete environment diff --git a/docs/vf_environment_clone.md b/docs/vf_environment_clone.md index c319c58f..d819e8e0 100644 --- a/docs/vf_environment_clone.md +++ b/docs/vf_environment_clone.md @@ -37,7 +37,7 @@ vf environment clone [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -47,4 +47,4 @@ vf environment clone [flags] ### SEE ALSO -* [vf environment](vf_environment.md) - Operations for environment +* [vf environment](vf_environment.md) - Publish, clone, merge and compare environments diff --git a/docs/vf_environment_compile.md b/docs/vf_environment_compile.md index 62033d09..93961836 100644 --- a/docs/vf_environment_compile.md +++ b/docs/vf_environment_compile.md @@ -34,7 +34,7 @@ vf environment compile [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -44,4 +44,4 @@ vf environment compile [flags] ### SEE ALSO -* [vf environment](vf_environment.md) - Operations for environment +* [vf environment](vf_environment.md) - Publish, clone, merge and compare environments diff --git a/docs/vf_environment_delete.md b/docs/vf_environment_delete.md index 81621a5c..6b0c0099 100644 --- a/docs/vf_environment_delete.md +++ b/docs/vf_environment_delete.md @@ -34,7 +34,7 @@ vf environment delete [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -44,4 +44,4 @@ vf environment delete [flags] ### SEE ALSO -* [vf environment](vf_environment.md) - Operations for environment +* [vf environment](vf_environment.md) - Publish, clone, merge and compare environments diff --git a/docs/vf_environment_get.md b/docs/vf_environment_get.md index a7d7b8e6..6841a41f 100644 --- a/docs/vf_environment_get.md +++ b/docs/vf_environment_get.md @@ -34,7 +34,7 @@ vf environment get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -44,4 +44,4 @@ vf environment get [flags] ### SEE ALSO -* [vf environment](vf_environment.md) - Operations for environment +* [vf environment](vf_environment.md) - Publish, clone, merge and compare environments diff --git a/docs/vf_environment_list.md b/docs/vf_environment_list.md index 9ce527cd..130233d1 100644 --- a/docs/vf_environment_list.md +++ b/docs/vf_environment_list.md @@ -33,7 +33,7 @@ vf environment list [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -43,4 +43,4 @@ vf environment list [flags] ### SEE ALSO -* [vf environment](vf_environment.md) - Operations for environment +* [vf environment](vf_environment.md) - Publish, clone, merge and compare environments diff --git a/docs/vf_environment_merge.md b/docs/vf_environment_merge.md index 0ed33f65..aa65db93 100644 --- a/docs/vf_environment_merge.md +++ b/docs/vf_environment_merge.md @@ -37,7 +37,7 @@ vf environment merge [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -47,4 +47,4 @@ vf environment merge [flags] ### SEE ALSO -* [vf environment](vf_environment.md) - Operations for environment +* [vf environment](vf_environment.md) - Publish, clone, merge and compare environments diff --git a/docs/vf_environment_publish.md b/docs/vf_environment_publish.md index 55a56d3b..183337e7 100644 --- a/docs/vf_environment_publish.md +++ b/docs/vf_environment_publish.md @@ -37,7 +37,7 @@ vf environment publish [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -47,4 +47,4 @@ vf environment publish [flags] ### SEE ALSO -* [vf environment](vf_environment.md) - Operations for environment +* [vf environment](vf_environment.md) - Publish, clone, merge and compare environments diff --git a/docs/vf_environment_update-traffic-split.md b/docs/vf_environment_update-traffic-split.md index 9cb7f049..b9a1b469 100644 --- a/docs/vf_environment_update-traffic-split.md +++ b/docs/vf_environment_update-traffic-split.md @@ -35,7 +35,7 @@ vf environment update-traffic-split [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf environment update-traffic-split [flags] ### SEE ALSO -* [vf environment](vf_environment.md) - Operations for environment +* [vf environment](vf_environment.md) - Publish, clone, merge and compare environments diff --git a/docs/vf_environment_update.md b/docs/vf_environment_update.md index ccba13ed..f34db2d3 100644 --- a/docs/vf_environment_update.md +++ b/docs/vf_environment_update.md @@ -36,7 +36,7 @@ vf environment update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -46,4 +46,4 @@ vf environment update [flags] ### SEE ALSO -* [vf environment](vf_environment.md) - Operations for environment +* [vf environment](vf_environment.md) - Publish, clone, merge and compare environments diff --git a/docs/vf_evaluation.md b/docs/vf_evaluation.md index 00873eb3..af87a2e2 100644 --- a/docs/vf_evaluation.md +++ b/docs/vf_evaluation.md @@ -1,10 +1,10 @@ ## vf evaluation -Operations for evaluation +Create and run evaluations that score transcripts ### Synopsis -Operations for evaluation +Create and run evaluations that score transcripts ``` vf evaluation [flags] @@ -26,7 +26,7 @@ vf evaluation [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,7 +36,7 @@ vf evaluation [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf evaluation create](vf_evaluation_create.md) - Create evaluation * [vf evaluation delete](vf_evaluation_delete.md) - Delete evaluation * [vf evaluation get](vf_evaluation_get.md) - Get evaluation diff --git a/docs/vf_evaluation_create.md b/docs/vf_evaluation_create.md index 19167be8..5d3922e4 100644 --- a/docs/vf_evaluation_create.md +++ b/docs/vf_evaluation_create.md @@ -57,7 +57,7 @@ vf evaluation create [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -67,4 +67,4 @@ vf evaluation create [flags] ### SEE ALSO -* [vf evaluation](vf_evaluation.md) - Operations for evaluation +* [vf evaluation](vf_evaluation.md) - Create and run evaluations that score transcripts diff --git a/docs/vf_evaluation_delete.md b/docs/vf_evaluation_delete.md index 0e54e7ee..ab6a25ff 100644 --- a/docs/vf_evaluation_delete.md +++ b/docs/vf_evaluation_delete.md @@ -34,7 +34,7 @@ vf evaluation delete [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -44,4 +44,4 @@ vf evaluation delete [flags] ### SEE ALSO -* [vf evaluation](vf_evaluation.md) - Operations for evaluation +* [vf evaluation](vf_evaluation.md) - Create and run evaluations that score transcripts diff --git a/docs/vf_evaluation_get.md b/docs/vf_evaluation_get.md index 96acc32d..0aadfc83 100644 --- a/docs/vf_evaluation_get.md +++ b/docs/vf_evaluation_get.md @@ -34,7 +34,7 @@ vf evaluation get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -44,4 +44,4 @@ vf evaluation get [flags] ### SEE ALSO -* [vf evaluation](vf_evaluation.md) - Operations for evaluation +* [vf evaluation](vf_evaluation.md) - Create and run evaluations that score transcripts diff --git a/docs/vf_evaluation_list.md b/docs/vf_evaluation_list.md index cdd534af..ef5fd98d 100644 --- a/docs/vf_evaluation_list.md +++ b/docs/vf_evaluation_list.md @@ -33,7 +33,7 @@ vf evaluation list [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -43,4 +43,4 @@ vf evaluation list [flags] ### SEE ALSO -* [vf evaluation](vf_evaluation.md) - Operations for evaluation +* [vf evaluation](vf_evaluation.md) - Create and run evaluations that score transcripts diff --git a/docs/vf_evaluation_run.md b/docs/vf_evaluation_run.md index 0aa4bf70..9116b369 100644 --- a/docs/vf_evaluation_run.md +++ b/docs/vf_evaluation_run.md @@ -36,7 +36,7 @@ vf evaluation run [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -46,4 +46,4 @@ vf evaluation run [flags] ### SEE ALSO -* [vf evaluation](vf_evaluation.md) - Operations for evaluation +* [vf evaluation](vf_evaluation.md) - Create and run evaluations that score transcripts diff --git a/docs/vf_evaluation_update.md b/docs/vf_evaluation_update.md index c11e08b8..a4acf2cb 100644 --- a/docs/vf_evaluation_update.md +++ b/docs/vf_evaluation_update.md @@ -40,7 +40,7 @@ vf evaluation update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -50,4 +50,4 @@ vf evaluation update [flags] ### SEE ALSO -* [vf evaluation](vf_evaluation.md) - Operations for evaluation +* [vf evaluation](vf_evaluation.md) - Create and run evaluations that score transcripts diff --git a/docs/vf_explore.md b/docs/vf_explore.md index 3941d57e..f46d18a8 100644 --- a/docs/vf_explore.md +++ b/docs/vf_explore.md @@ -26,7 +26,7 @@ vf explore [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,4 +36,4 @@ vf explore [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal diff --git a/docs/vf_function.md b/docs/vf_function.md index cba04492..22fb542c 100644 --- a/docs/vf_function.md +++ b/docs/vf_function.md @@ -1,10 +1,10 @@ ## vf function -Operations for function +Write, run and manage functions ### Synopsis -Operations for function +Write, run and manage functions ``` vf function [flags] @@ -26,7 +26,7 @@ vf function [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,11 +36,11 @@ vf function [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf function create](vf_function_create.md) - Create function * [vf function delete](vf_function_delete.md) - Delete function * [vf function get](vf_function_get.md) - Get function * [vf function list](vf_function_list.md) - List functions -* [vf function path](vf_function_path.md) - Operations for path +* [vf function path](vf_function_path.md) - Manage a function's paths * [vf function update](vf_function_update.md) - Update function -* [vf function variable](vf_function_variable.md) - Operations for function-variable +* [vf function variable](vf_function_variable.md) - Manage a function's variables diff --git a/docs/vf_function_create.md b/docs/vf_function_create.md index 8f5b1be6..7f3db9eb 100644 --- a/docs/vf_function_create.md +++ b/docs/vf_function_create.md @@ -39,7 +39,7 @@ vf function create [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -49,4 +49,4 @@ vf function create [flags] ### SEE ALSO -* [vf function](vf_function.md) - Operations for function +* [vf function](vf_function.md) - Write, run and manage functions diff --git a/docs/vf_function_delete.md b/docs/vf_function_delete.md index 443d8017..838e8491 100644 --- a/docs/vf_function_delete.md +++ b/docs/vf_function_delete.md @@ -35,7 +35,7 @@ vf function delete [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf function delete [flags] ### SEE ALSO -* [vf function](vf_function.md) - Operations for function +* [vf function](vf_function.md) - Write, run and manage functions diff --git a/docs/vf_function_get.md b/docs/vf_function_get.md index f88d6162..16abe603 100644 --- a/docs/vf_function_get.md +++ b/docs/vf_function_get.md @@ -35,7 +35,7 @@ vf function get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf function get [flags] ### SEE ALSO -* [vf function](vf_function.md) - Operations for function +* [vf function](vf_function.md) - Write, run and manage functions diff --git a/docs/vf_function_list.md b/docs/vf_function_list.md index 0683edc7..1e579a9b 100644 --- a/docs/vf_function_list.md +++ b/docs/vf_function_list.md @@ -34,7 +34,7 @@ vf function list [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -44,4 +44,4 @@ vf function list [flags] ### SEE ALSO -* [vf function](vf_function.md) - Operations for function +* [vf function](vf_function.md) - Write, run and manage functions diff --git a/docs/vf_function_path.md b/docs/vf_function_path.md index f015dfa0..834d5e92 100644 --- a/docs/vf_function_path.md +++ b/docs/vf_function_path.md @@ -1,10 +1,10 @@ ## vf function path -Operations for path +Manage a function's paths ### Synopsis -Operations for path +Manage a function's paths ``` vf function path [flags] @@ -26,7 +26,7 @@ vf function path [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,7 +36,7 @@ vf function path [flags] ### SEE ALSO -* [vf function](vf_function.md) - Operations for function +* [vf function](vf_function.md) - Write, run and manage functions * [vf function path create](vf_function_path_create.md) - Create path * [vf function path delete](vf_function_path_delete.md) - Delete path * [vf function path get](vf_function_path_get.md) - Get path diff --git a/docs/vf_function_path_create.md b/docs/vf_function_path_create.md index 217901c7..80fd34a4 100644 --- a/docs/vf_function_path_create.md +++ b/docs/vf_function_path_create.md @@ -38,7 +38,7 @@ vf function path create [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -48,4 +48,4 @@ vf function path create [flags] ### SEE ALSO -* [vf function path](vf_function_path.md) - Operations for path +* [vf function path](vf_function_path.md) - Manage a function's paths diff --git a/docs/vf_function_path_delete.md b/docs/vf_function_path_delete.md index d2cee23d..37f7024e 100644 --- a/docs/vf_function_path_delete.md +++ b/docs/vf_function_path_delete.md @@ -35,7 +35,7 @@ vf function path delete [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf function path delete [flags] ### SEE ALSO -* [vf function path](vf_function_path.md) - Operations for path +* [vf function path](vf_function_path.md) - Manage a function's paths diff --git a/docs/vf_function_path_get.md b/docs/vf_function_path_get.md index 6a720b84..a1d9a24d 100644 --- a/docs/vf_function_path_get.md +++ b/docs/vf_function_path_get.md @@ -35,7 +35,7 @@ vf function path get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf function path get [flags] ### SEE ALSO -* [vf function path](vf_function_path.md) - Operations for path +* [vf function path](vf_function_path.md) - Manage a function's paths diff --git a/docs/vf_function_path_list.md b/docs/vf_function_path_list.md index 8ec5b57d..4c5f5193 100644 --- a/docs/vf_function_path_list.md +++ b/docs/vf_function_path_list.md @@ -35,7 +35,7 @@ vf function path list [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf function path list [flags] ### SEE ALSO -* [vf function path](vf_function_path.md) - Operations for path +* [vf function path](vf_function_path.md) - Manage a function's paths diff --git a/docs/vf_function_path_update.md b/docs/vf_function_path_update.md index ee473a2e..623dd9f1 100644 --- a/docs/vf_function_path_update.md +++ b/docs/vf_function_path_update.md @@ -38,7 +38,7 @@ vf function path update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -48,4 +48,4 @@ vf function path update [flags] ### SEE ALSO -* [vf function path](vf_function_path.md) - Operations for path +* [vf function path](vf_function_path.md) - Manage a function's paths diff --git a/docs/vf_function_update.md b/docs/vf_function_update.md index 65b19d2a..3b9d82ff 100644 --- a/docs/vf_function_update.md +++ b/docs/vf_function_update.md @@ -41,7 +41,7 @@ vf function update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -51,4 +51,4 @@ vf function update [flags] ### SEE ALSO -* [vf function](vf_function.md) - Operations for function +* [vf function](vf_function.md) - Write, run and manage functions diff --git a/docs/vf_function_variable.md b/docs/vf_function_variable.md index 8b1971b8..125c7568 100644 --- a/docs/vf_function_variable.md +++ b/docs/vf_function_variable.md @@ -1,10 +1,10 @@ ## vf function variable -Operations for function-variable +Manage a function's variables ### Synopsis -Operations for function-variable +Manage a function's variables ``` vf function variable [flags] @@ -26,7 +26,7 @@ vf function variable [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,7 +36,7 @@ vf function variable [flags] ### SEE ALSO -* [vf function](vf_function.md) - Operations for function +* [vf function](vf_function.md) - Write, run and manage functions * [vf function variable create](vf_function_variable_create.md) - Create variable * [vf function variable delete](vf_function_variable_delete.md) - Delete variable * [vf function variable get](vf_function_variable_get.md) - Get variable diff --git a/docs/vf_function_variable_create.md b/docs/vf_function_variable_create.md index 64c60f91..f0447668 100644 --- a/docs/vf_function_variable_create.md +++ b/docs/vf_function_variable_create.md @@ -39,7 +39,7 @@ vf function variable create [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -49,4 +49,4 @@ vf function variable create [flags] ### SEE ALSO -* [vf function variable](vf_function_variable.md) - Operations for function-variable +* [vf function variable](vf_function_variable.md) - Manage a function's variables diff --git a/docs/vf_function_variable_delete.md b/docs/vf_function_variable_delete.md index fb2ca9a7..a4e52b10 100644 --- a/docs/vf_function_variable_delete.md +++ b/docs/vf_function_variable_delete.md @@ -35,7 +35,7 @@ vf function variable delete [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf function variable delete [flags] ### SEE ALSO -* [vf function variable](vf_function_variable.md) - Operations for function-variable +* [vf function variable](vf_function_variable.md) - Manage a function's variables diff --git a/docs/vf_function_variable_get.md b/docs/vf_function_variable_get.md index 3a93bdd9..315d2b7b 100644 --- a/docs/vf_function_variable_get.md +++ b/docs/vf_function_variable_get.md @@ -35,7 +35,7 @@ vf function variable get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf function variable get [flags] ### SEE ALSO -* [vf function variable](vf_function_variable.md) - Operations for function-variable +* [vf function variable](vf_function_variable.md) - Manage a function's variables diff --git a/docs/vf_function_variable_list.md b/docs/vf_function_variable_list.md index f771566a..bfbb1f29 100644 --- a/docs/vf_function_variable_list.md +++ b/docs/vf_function_variable_list.md @@ -35,7 +35,7 @@ vf function variable list [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf function variable list [flags] ### SEE ALSO -* [vf function variable](vf_function_variable.md) - Operations for function-variable +* [vf function variable](vf_function_variable.md) - Manage a function's variables diff --git a/docs/vf_function_variable_update.md b/docs/vf_function_variable_update.md index 1bcb36eb..dd08f3c7 100644 --- a/docs/vf_function_variable_update.md +++ b/docs/vf_function_variable_update.md @@ -38,7 +38,7 @@ vf function variable update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -48,4 +48,4 @@ vf function variable update [flags] ### SEE ALSO -* [vf function variable](vf_function_variable.md) - Operations for function-variable +* [vf function variable](vf_function_variable.md) - Manage a function's variables diff --git a/docs/vf_knowledge-base.md b/docs/vf_knowledge-base.md index daa9e81f..432dd0f4 100644 --- a/docs/vf_knowledge-base.md +++ b/docs/vf_knowledge-base.md @@ -1,10 +1,10 @@ ## vf knowledge-base -Operations for knowledge-base +Query the knowledge base ### Synopsis -Operations for knowledge-base +Query the knowledge base ``` vf knowledge-base [flags] @@ -26,7 +26,7 @@ vf knowledge-base [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,5 +36,5 @@ vf knowledge-base [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf knowledge-base query](vf_knowledge-base_query.md) - Query knowledge base diff --git a/docs/vf_knowledge-base_query.md b/docs/vf_knowledge-base_query.md index fd2ca84d..19eeff2d 100644 --- a/docs/vf_knowledge-base_query.md +++ b/docs/vf_knowledge-base_query.md @@ -42,7 +42,7 @@ vf knowledge-base query [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -52,4 +52,4 @@ vf knowledge-base query [flags] ### SEE ALSO -* [vf knowledge-base](vf_knowledge-base.md) - Operations for knowledge-base +* [vf knowledge-base](vf_knowledge-base.md) - Query the knowledge base diff --git a/docs/vf_mcp-server.md b/docs/vf_mcp-server.md index af7f697c..f48db7cd 100644 --- a/docs/vf_mcp-server.md +++ b/docs/vf_mcp-server.md @@ -1,10 +1,10 @@ ## vf mcp-server -Operations for mcp-server +Manage the MCP servers an agent connects to ### Synopsis -Operations for mcp-server +Manage the MCP servers an agent connects to ``` vf mcp-server [flags] @@ -26,7 +26,7 @@ vf mcp-server [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,7 +36,7 @@ vf mcp-server [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf mcp-server create](vf_mcp-server_create.md) - Create MCP server * [vf mcp-server delete](vf_mcp-server_delete.md) - Delete MCP server * [vf mcp-server get](vf_mcp-server_get.md) - Get MCP server diff --git a/docs/vf_mcp-server_create.md b/docs/vf_mcp-server_create.md index 78d62e20..aafa2310 100644 --- a/docs/vf_mcp-server_create.md +++ b/docs/vf_mcp-server_create.md @@ -40,7 +40,7 @@ vf mcp-server create [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -50,4 +50,4 @@ vf mcp-server create [flags] ### SEE ALSO -* [vf mcp-server](vf_mcp-server.md) - Operations for mcp-server +* [vf mcp-server](vf_mcp-server.md) - Manage the MCP servers an agent connects to diff --git a/docs/vf_mcp-server_delete.md b/docs/vf_mcp-server_delete.md index dcaa2883..4110555c 100644 --- a/docs/vf_mcp-server_delete.md +++ b/docs/vf_mcp-server_delete.md @@ -35,7 +35,7 @@ vf mcp-server delete [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf mcp-server delete [flags] ### SEE ALSO -* [vf mcp-server](vf_mcp-server.md) - Operations for mcp-server +* [vf mcp-server](vf_mcp-server.md) - Manage the MCP servers an agent connects to diff --git a/docs/vf_mcp-server_get.md b/docs/vf_mcp-server_get.md index fe1a5860..d212e9ff 100644 --- a/docs/vf_mcp-server_get.md +++ b/docs/vf_mcp-server_get.md @@ -35,7 +35,7 @@ vf mcp-server get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf mcp-server get [flags] ### SEE ALSO -* [vf mcp-server](vf_mcp-server.md) - Operations for mcp-server +* [vf mcp-server](vf_mcp-server.md) - Manage the MCP servers an agent connects to diff --git a/docs/vf_mcp-server_list.md b/docs/vf_mcp-server_list.md index 5ca3c000..9da1992a 100644 --- a/docs/vf_mcp-server_list.md +++ b/docs/vf_mcp-server_list.md @@ -34,7 +34,7 @@ vf mcp-server list [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -44,4 +44,4 @@ vf mcp-server list [flags] ### SEE ALSO -* [vf mcp-server](vf_mcp-server.md) - Operations for mcp-server +* [vf mcp-server](vf_mcp-server.md) - Manage the MCP servers an agent connects to diff --git a/docs/vf_mcp-server_sync.md b/docs/vf_mcp-server_sync.md index df6f0926..75d7b515 100644 --- a/docs/vf_mcp-server_sync.md +++ b/docs/vf_mcp-server_sync.md @@ -35,7 +35,7 @@ vf mcp-server sync [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf mcp-server sync [flags] ### SEE ALSO -* [vf mcp-server](vf_mcp-server.md) - Operations for mcp-server +* [vf mcp-server](vf_mcp-server.md) - Manage the MCP servers an agent connects to diff --git a/docs/vf_mcp-server_update.md b/docs/vf_mcp-server_update.md index 51d6f80f..2d064b20 100644 --- a/docs/vf_mcp-server_update.md +++ b/docs/vf_mcp-server_update.md @@ -41,7 +41,7 @@ vf mcp-server update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -51,4 +51,4 @@ vf mcp-server update [flags] ### SEE ALSO -* [vf mcp-server](vf_mcp-server.md) - Operations for mcp-server +* [vf mcp-server](vf_mcp-server.md) - Manage the MCP servers an agent connects to diff --git a/docs/vf_mcp-tool.md b/docs/vf_mcp-tool.md index 4ee740f6..899208e5 100644 --- a/docs/vf_mcp-tool.md +++ b/docs/vf_mcp-tool.md @@ -1,10 +1,10 @@ ## vf mcp-tool -Operations for mcp-tool +List, inspect and run MCP server tools ### Synopsis -Operations for mcp-tool +List, inspect and run MCP server tools ``` vf mcp-tool [flags] @@ -26,7 +26,7 @@ vf mcp-tool [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,6 +36,6 @@ vf mcp-tool [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf mcp-tool get](vf_mcp-tool_get.md) - Get MCP tool * [vf mcp-tool list](vf_mcp-tool_list.md) - List MCP tools diff --git a/docs/vf_mcp-tool_get.md b/docs/vf_mcp-tool_get.md index 1bb722f9..cb3869a5 100644 --- a/docs/vf_mcp-tool_get.md +++ b/docs/vf_mcp-tool_get.md @@ -35,7 +35,7 @@ vf mcp-tool get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf mcp-tool get [flags] ### SEE ALSO -* [vf mcp-tool](vf_mcp-tool.md) - Operations for mcp-tool +* [vf mcp-tool](vf_mcp-tool.md) - List, inspect and run MCP server tools diff --git a/docs/vf_mcp-tool_list.md b/docs/vf_mcp-tool_list.md index 318e7320..05b8a006 100644 --- a/docs/vf_mcp-tool_list.md +++ b/docs/vf_mcp-tool_list.md @@ -35,7 +35,7 @@ vf mcp-tool list [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf mcp-tool list [flags] ### SEE ALSO -* [vf mcp-tool](vf_mcp-tool.md) - Operations for mcp-tool +* [vf mcp-tool](vf_mcp-tool.md) - List, inspect and run MCP server tools diff --git a/docs/vf_playbook.md b/docs/vf_playbook.md index 1b4feacc..43102cd5 100644 --- a/docs/vf_playbook.md +++ b/docs/vf_playbook.md @@ -1,10 +1,10 @@ ## vf playbook -Operations for playbook +Build playbooks: instructions, tools and exit paths ### Synopsis -Operations for playbook +Build playbooks: instructions, tools and exit paths ``` vf playbook [flags] @@ -26,7 +26,7 @@ vf playbook [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,7 +36,7 @@ vf playbook [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf playbook create](vf_playbook_create.md) - Create playbook * [vf playbook delete](vf_playbook_delete.md) - Delete playbook * [vf playbook get](vf_playbook_get.md) - Get playbook diff --git a/docs/vf_playbook_create.md b/docs/vf_playbook_create.md index 8d1e12af..bd4782ed 100644 --- a/docs/vf_playbook_create.md +++ b/docs/vf_playbook_create.md @@ -47,7 +47,7 @@ vf playbook create [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -57,4 +57,4 @@ vf playbook create [flags] ### SEE ALSO -* [vf playbook](vf_playbook.md) - Operations for playbook +* [vf playbook](vf_playbook.md) - Build playbooks: instructions, tools and exit paths diff --git a/docs/vf_playbook_delete.md b/docs/vf_playbook_delete.md index 8290900c..00c8bd45 100644 --- a/docs/vf_playbook_delete.md +++ b/docs/vf_playbook_delete.md @@ -35,7 +35,7 @@ vf playbook delete [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf playbook delete [flags] ### SEE ALSO -* [vf playbook](vf_playbook.md) - Operations for playbook +* [vf playbook](vf_playbook.md) - Build playbooks: instructions, tools and exit paths diff --git a/docs/vf_playbook_get.md b/docs/vf_playbook_get.md index 7023a9dd..7d80d829 100644 --- a/docs/vf_playbook_get.md +++ b/docs/vf_playbook_get.md @@ -35,7 +35,7 @@ vf playbook get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf playbook get [flags] ### SEE ALSO -* [vf playbook](vf_playbook.md) - Operations for playbook +* [vf playbook](vf_playbook.md) - Build playbooks: instructions, tools and exit paths diff --git a/docs/vf_playbook_list.md b/docs/vf_playbook_list.md index 0be98a08..77bcc671 100644 --- a/docs/vf_playbook_list.md +++ b/docs/vf_playbook_list.md @@ -34,7 +34,7 @@ vf playbook list [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -44,4 +44,4 @@ vf playbook list [flags] ### SEE ALSO -* [vf playbook](vf_playbook.md) - Operations for playbook +* [vf playbook](vf_playbook.md) - Build playbooks: instructions, tools and exit paths diff --git a/docs/vf_playbook_update.md b/docs/vf_playbook_update.md index c50a3299..aaac1eaa 100644 --- a/docs/vf_playbook_update.md +++ b/docs/vf_playbook_update.md @@ -48,7 +48,7 @@ vf playbook update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -58,4 +58,4 @@ vf playbook update [flags] ### SEE ALSO -* [vf playbook](vf_playbook.md) - Operations for playbook +* [vf playbook](vf_playbook.md) - Build playbooks: instructions, tools and exit paths diff --git a/docs/vf_project.md b/docs/vf_project.md index e1cbeb19..32949389 100644 --- a/docs/vf_project.md +++ b/docs/vf_project.md @@ -1,10 +1,10 @@ ## vf project -Operations for project +Create, list and manage projects ### Synopsis -Operations for project +Create, list and manage projects ``` vf project [flags] @@ -26,7 +26,7 @@ vf project [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,7 +36,7 @@ vf project [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf project create](vf_project_create.md) - Create project * [vf project delete](vf_project_delete.md) - Delete project * [vf project get](vf_project_get.md) - Get project diff --git a/docs/vf_project_create.md b/docs/vf_project_create.md index 314bd990..7f4c4957 100644 --- a/docs/vf_project_create.md +++ b/docs/vf_project_create.md @@ -36,7 +36,7 @@ vf project create [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -46,4 +46,4 @@ vf project create [flags] ### SEE ALSO -* [vf project](vf_project.md) - Operations for project +* [vf project](vf_project.md) - Create, list and manage projects diff --git a/docs/vf_project_delete.md b/docs/vf_project_delete.md index 84f7b1e0..26c5264e 100644 --- a/docs/vf_project_delete.md +++ b/docs/vf_project_delete.md @@ -33,7 +33,7 @@ vf project delete [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -43,4 +43,4 @@ vf project delete [flags] ### SEE ALSO -* [vf project](vf_project.md) - Operations for project +* [vf project](vf_project.md) - Create, list and manage projects diff --git a/docs/vf_project_get.md b/docs/vf_project_get.md index 0a187262..7360ce13 100644 --- a/docs/vf_project_get.md +++ b/docs/vf_project_get.md @@ -33,7 +33,7 @@ vf project get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -43,4 +43,4 @@ vf project get [flags] ### SEE ALSO -* [vf project](vf_project.md) - Operations for project +* [vf project](vf_project.md) - Create, list and manage projects diff --git a/docs/vf_project_list.md b/docs/vf_project_list.md index 33c75cb0..c0e302c2 100644 --- a/docs/vf_project_list.md +++ b/docs/vf_project_list.md @@ -33,7 +33,7 @@ vf project list [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -43,4 +43,4 @@ vf project list [flags] ### SEE ALSO -* [vf project](vf_project.md) - Operations for project +* [vf project](vf_project.md) - Create, list and manage projects diff --git a/docs/vf_project_update.md b/docs/vf_project_update.md index 35c27d08..c29f26a9 100644 --- a/docs/vf_project_update.md +++ b/docs/vf_project_update.md @@ -35,7 +35,7 @@ vf project update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf project update [flags] ### SEE ALSO -* [vf project](vf_project.md) - Operations for project +* [vf project](vf_project.md) - Create, list and manage projects diff --git a/docs/vf_tool.md b/docs/vf_tool.md index fcc91e2f..7dc8b3c5 100644 --- a/docs/vf_tool.md +++ b/docs/vf_tool.md @@ -1,10 +1,10 @@ ## vf tool -Operations for tool +Manage the tools an agent and its playbooks use ### Synopsis -Operations for tool +Manage the tools an agent and its playbooks use ``` vf tool [flags] @@ -26,7 +26,7 @@ vf tool [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,7 +36,7 @@ vf tool [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf tool create](vf_tool_create.md) - Create tool * [vf tool delete](vf_tool_delete.md) - Delete tool * [vf tool get](vf_tool_get.md) - Get tool diff --git a/docs/vf_tool_create.md b/docs/vf_tool_create.md index 6d110def..451a19b9 100644 --- a/docs/vf_tool_create.md +++ b/docs/vf_tool_create.md @@ -39,7 +39,7 @@ vf tool create [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -49,4 +49,4 @@ vf tool create [flags] ### SEE ALSO -* [vf tool](vf_tool.md) - Operations for tool +* [vf tool](vf_tool.md) - Manage the tools an agent and its playbooks use diff --git a/docs/vf_tool_delete.md b/docs/vf_tool_delete.md index 348afd8a..9ad7c6a8 100644 --- a/docs/vf_tool_delete.md +++ b/docs/vf_tool_delete.md @@ -36,7 +36,7 @@ vf tool delete [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -46,4 +46,4 @@ vf tool delete [flags] ### SEE ALSO -* [vf tool](vf_tool.md) - Operations for tool +* [vf tool](vf_tool.md) - Manage the tools an agent and its playbooks use diff --git a/docs/vf_tool_get.md b/docs/vf_tool_get.md index df476197..5b63a136 100644 --- a/docs/vf_tool_get.md +++ b/docs/vf_tool_get.md @@ -36,7 +36,7 @@ vf tool get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -46,4 +46,4 @@ vf tool get [flags] ### SEE ALSO -* [vf tool](vf_tool.md) - Operations for tool +* [vf tool](vf_tool.md) - Manage the tools an agent and its playbooks use diff --git a/docs/vf_tool_list.md b/docs/vf_tool_list.md index 3ad0be8e..33d9cb1d 100644 --- a/docs/vf_tool_list.md +++ b/docs/vf_tool_list.md @@ -37,7 +37,7 @@ vf tool list [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -47,4 +47,4 @@ vf tool list [flags] ### SEE ALSO -* [vf tool](vf_tool.md) - Operations for tool +* [vf tool](vf_tool.md) - Manage the tools an agent and its playbooks use diff --git a/docs/vf_tool_update.md b/docs/vf_tool_update.md index 25d9b5d6..f2bd552c 100644 --- a/docs/vf_tool_update.md +++ b/docs/vf_tool_update.md @@ -40,7 +40,7 @@ vf tool update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -50,4 +50,4 @@ vf tool update [flags] ### SEE ALSO -* [vf tool](vf_tool.md) - Operations for tool +* [vf tool](vf_tool.md) - Manage the tools an agent and its playbooks use diff --git a/docs/vf_transcript.md b/docs/vf_transcript.md index 72358d96..39dd43c8 100644 --- a/docs/vf_transcript.md +++ b/docs/vf_transcript.md @@ -1,10 +1,10 @@ ## vf transcript -Operations for transcript +Search and read conversation transcripts ### Synopsis -Operations for transcript +Search and read conversation transcripts ``` vf transcript [flags] @@ -26,7 +26,7 @@ vf transcript [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,7 +36,7 @@ vf transcript [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf transcript get](vf_transcript_get.md) - Get transcript -* [vf transcript property](vf_transcript_property.md) - Operations for property +* [vf transcript property](vf_transcript_property.md) - Manage the properties that tag transcripts * [vf transcript search](vf_transcript_search.md) - Search transcripts diff --git a/docs/vf_transcript_get.md b/docs/vf_transcript_get.md index e2e381d3..c4b2983f 100644 --- a/docs/vf_transcript_get.md +++ b/docs/vf_transcript_get.md @@ -34,7 +34,7 @@ vf transcript get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -44,4 +44,4 @@ vf transcript get [flags] ### SEE ALSO -* [vf transcript](vf_transcript.md) - Operations for transcript +* [vf transcript](vf_transcript.md) - Search and read conversation transcripts diff --git a/docs/vf_transcript_property.md b/docs/vf_transcript_property.md index 11ae484c..1af6ab85 100644 --- a/docs/vf_transcript_property.md +++ b/docs/vf_transcript_property.md @@ -1,10 +1,10 @@ ## vf transcript property -Operations for property +Manage the properties that tag transcripts ### Synopsis -Operations for property +Manage the properties that tag transcripts ``` vf transcript property [flags] @@ -26,7 +26,7 @@ vf transcript property [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,7 +36,7 @@ vf transcript property [flags] ### SEE ALSO -* [vf transcript](vf_transcript.md) - Operations for transcript +* [vf transcript](vf_transcript.md) - Search and read conversation transcripts * [vf transcript property create](vf_transcript_property_create.md) - Create property * [vf transcript property delete](vf_transcript_property_delete.md) - Delete property * [vf transcript property get](vf_transcript_property_get.md) - Get property diff --git a/docs/vf_transcript_property_create.md b/docs/vf_transcript_property_create.md index 91907281..98038456 100644 --- a/docs/vf_transcript_property_create.md +++ b/docs/vf_transcript_property_create.md @@ -36,7 +36,7 @@ vf transcript property create [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -46,4 +46,4 @@ vf transcript property create [flags] ### SEE ALSO -* [vf transcript property](vf_transcript_property.md) - Operations for property +* [vf transcript property](vf_transcript_property.md) - Manage the properties that tag transcripts diff --git a/docs/vf_transcript_property_delete.md b/docs/vf_transcript_property_delete.md index f89dff89..6dc45f8c 100644 --- a/docs/vf_transcript_property_delete.md +++ b/docs/vf_transcript_property_delete.md @@ -34,7 +34,7 @@ vf transcript property delete [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -44,4 +44,4 @@ vf transcript property delete [flags] ### SEE ALSO -* [vf transcript property](vf_transcript_property.md) - Operations for property +* [vf transcript property](vf_transcript_property.md) - Manage the properties that tag transcripts diff --git a/docs/vf_transcript_property_get.md b/docs/vf_transcript_property_get.md index c0f4432e..4a4ba3d7 100644 --- a/docs/vf_transcript_property_get.md +++ b/docs/vf_transcript_property_get.md @@ -34,7 +34,7 @@ vf transcript property get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -44,4 +44,4 @@ vf transcript property get [flags] ### SEE ALSO -* [vf transcript property](vf_transcript_property.md) - Operations for property +* [vf transcript property](vf_transcript_property.md) - Manage the properties that tag transcripts diff --git a/docs/vf_transcript_property_list.md b/docs/vf_transcript_property_list.md index eede89f2..5b690f58 100644 --- a/docs/vf_transcript_property_list.md +++ b/docs/vf_transcript_property_list.md @@ -33,7 +33,7 @@ vf transcript property list [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -43,4 +43,4 @@ vf transcript property list [flags] ### SEE ALSO -* [vf transcript property](vf_transcript_property.md) - Operations for property +* [vf transcript property](vf_transcript_property.md) - Manage the properties that tag transcripts diff --git a/docs/vf_transcript_property_set-value.md b/docs/vf_transcript_property_set-value.md index 67f7bf4b..55adf374 100644 --- a/docs/vf_transcript_property_set-value.md +++ b/docs/vf_transcript_property_set-value.md @@ -37,7 +37,7 @@ vf transcript property set-value [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -47,4 +47,4 @@ vf transcript property set-value [flags] ### SEE ALSO -* [vf transcript property](vf_transcript_property.md) - Operations for property +* [vf transcript property](vf_transcript_property.md) - Manage the properties that tag transcripts diff --git a/docs/vf_transcript_property_update.md b/docs/vf_transcript_property_update.md index 653f29e9..142dc3d2 100644 --- a/docs/vf_transcript_property_update.md +++ b/docs/vf_transcript_property_update.md @@ -36,7 +36,7 @@ vf transcript property update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -46,4 +46,4 @@ vf transcript property update [flags] ### SEE ALSO -* [vf transcript property](vf_transcript_property.md) - Operations for property +* [vf transcript property](vf_transcript_property.md) - Manage the properties that tag transcripts diff --git a/docs/vf_transcript_search.md b/docs/vf_transcript_search.md index fcfd19a6..98a5b7c8 100644 --- a/docs/vf_transcript_search.md +++ b/docs/vf_transcript_search.md @@ -42,7 +42,7 @@ vf transcript search [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -52,4 +52,4 @@ vf transcript search [flags] ### SEE ALSO -* [vf transcript](vf_transcript.md) - Operations for transcript +* [vf transcript](vf_transcript.md) - Search and read conversation transcripts diff --git a/docs/vf_variable.md b/docs/vf_variable.md index 7a59e855..d283c43a 100644 --- a/docs/vf_variable.md +++ b/docs/vf_variable.md @@ -1,10 +1,10 @@ ## vf variable -Operations for variable +Manage the variables an agent reads and sets ### Synopsis -Operations for variable +Manage the variables an agent reads and sets ``` vf variable [flags] @@ -26,7 +26,7 @@ vf variable [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,7 +36,7 @@ vf variable [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf variable create](vf_variable_create.md) - Create variable * [vf variable delete](vf_variable_delete.md) - Delete variable * [vf variable get](vf_variable_get.md) - Get variable diff --git a/docs/vf_variable_create.md b/docs/vf_variable_create.md index ee7bf1c6..4d1aed33 100644 --- a/docs/vf_variable_create.md +++ b/docs/vf_variable_create.md @@ -39,7 +39,7 @@ vf variable create [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -49,4 +49,4 @@ vf variable create [flags] ### SEE ALSO -* [vf variable](vf_variable.md) - Operations for variable +* [vf variable](vf_variable.md) - Manage the variables an agent reads and sets diff --git a/docs/vf_variable_delete.md b/docs/vf_variable_delete.md index e3a0cda4..03e7899c 100644 --- a/docs/vf_variable_delete.md +++ b/docs/vf_variable_delete.md @@ -35,7 +35,7 @@ vf variable delete [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf variable delete [flags] ### SEE ALSO -* [vf variable](vf_variable.md) - Operations for variable +* [vf variable](vf_variable.md) - Manage the variables an agent reads and sets diff --git a/docs/vf_variable_get.md b/docs/vf_variable_get.md index ef829f2c..58dc8f0b 100644 --- a/docs/vf_variable_get.md +++ b/docs/vf_variable_get.md @@ -35,7 +35,7 @@ vf variable get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf variable get [flags] ### SEE ALSO -* [vf variable](vf_variable.md) - Operations for variable +* [vf variable](vf_variable.md) - Manage the variables an agent reads and sets diff --git a/docs/vf_variable_list.md b/docs/vf_variable_list.md index 5e3d0ce8..91ea20ea 100644 --- a/docs/vf_variable_list.md +++ b/docs/vf_variable_list.md @@ -34,7 +34,7 @@ vf variable list [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -44,4 +44,4 @@ vf variable list [flags] ### SEE ALSO -* [vf variable](vf_variable.md) - Operations for variable +* [vf variable](vf_variable.md) - Manage the variables an agent reads and sets diff --git a/docs/vf_variable_update.md b/docs/vf_variable_update.md index 74313755..e9b12499 100644 --- a/docs/vf_variable_update.md +++ b/docs/vf_variable_update.md @@ -40,7 +40,7 @@ vf variable update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -50,4 +50,4 @@ vf variable update [flags] ### SEE ALSO -* [vf variable](vf_variable.md) - Operations for variable +* [vf variable](vf_variable.md) - Manage the variables an agent reads and sets diff --git a/docs/vf_version.md b/docs/vf_version.md index c8ec6333..40b39180 100644 --- a/docs/vf_version.md +++ b/docs/vf_version.md @@ -31,7 +31,7 @@ vf version [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -41,4 +41,4 @@ vf version [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal diff --git a/docs/vf_whoami.md b/docs/vf_whoami.md index e01be9b9..ac7d694c 100644 --- a/docs/vf_whoami.md +++ b/docs/vf_whoami.md @@ -35,7 +35,7 @@ vf whoami [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf whoami [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal diff --git a/docs/vf_workspace.md b/docs/vf_workspace.md index a25276a7..fedbe7c6 100644 --- a/docs/vf_workspace.md +++ b/docs/vf_workspace.md @@ -1,10 +1,10 @@ ## vf workspace -Operations for workspace +Create, list and manage workspaces ### Synopsis -Operations for workspace +Create, list and manage workspaces ``` vf workspace [flags] @@ -26,7 +26,7 @@ vf workspace [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -36,7 +36,7 @@ vf workspace [flags] ### SEE ALSO -* [vf](vf.md) - Realtime: Realtime gateway API service +* [vf](vf.md) - Build, test, and operate Voiceflow AI agents from your terminal * [vf workspace create](vf_workspace_create.md) - Create workspace * [vf workspace delete](vf_workspace_delete.md) - Delete workspace * [vf workspace get](vf_workspace_get.md) - Get workspace diff --git a/docs/vf_workspace_create.md b/docs/vf_workspace_create.md index f9928502..773027b3 100644 --- a/docs/vf_workspace_create.md +++ b/docs/vf_workspace_create.md @@ -35,7 +35,7 @@ vf workspace create [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf workspace create [flags] ### SEE ALSO -* [vf workspace](vf_workspace.md) - Operations for workspace +* [vf workspace](vf_workspace.md) - Create, list and manage workspaces diff --git a/docs/vf_workspace_delete.md b/docs/vf_workspace_delete.md index 48096a04..7de829b9 100644 --- a/docs/vf_workspace_delete.md +++ b/docs/vf_workspace_delete.md @@ -33,7 +33,7 @@ vf workspace delete [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -43,4 +43,4 @@ vf workspace delete [flags] ### SEE ALSO -* [vf workspace](vf_workspace.md) - Operations for workspace +* [vf workspace](vf_workspace.md) - Create, list and manage workspaces diff --git a/docs/vf_workspace_get.md b/docs/vf_workspace_get.md index bd5eba10..5a9074bd 100644 --- a/docs/vf_workspace_get.md +++ b/docs/vf_workspace_get.md @@ -33,7 +33,7 @@ vf workspace get [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -43,4 +43,4 @@ vf workspace get [flags] ### SEE ALSO -* [vf workspace](vf_workspace.md) - Operations for workspace +* [vf workspace](vf_workspace.md) - Create, list and manage workspaces diff --git a/docs/vf_workspace_list.md b/docs/vf_workspace_list.md index 2741755d..95f9037c 100644 --- a/docs/vf_workspace_list.md +++ b/docs/vf_workspace_list.md @@ -32,7 +32,7 @@ vf workspace list [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -42,4 +42,4 @@ vf workspace list [flags] ### SEE ALSO -* [vf workspace](vf_workspace.md) - Operations for workspace +* [vf workspace](vf_workspace.md) - Create, list and manage workspaces diff --git a/docs/vf_workspace_update.md b/docs/vf_workspace_update.md index e278ce2c..cf8e7dcd 100644 --- a/docs/vf_workspace_update.md +++ b/docs/vf_workspace_update.md @@ -35,7 +35,7 @@ vf workspace update [flags] -H, --header stringArray Set a custom HTTP request header (format: "Key: Value"). Can be specified multiple times. --include-headers Include HTTP response headers in the output -q, --jq string Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id') - --no-interactive Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms) + --no-interactive Disable all interactive features (auto-prompting, the home prompt, TUI forms) -o, --output-format string Specify the output format. Options: pretty, json, yaml, table, toon. (default "pretty") --server-url string Override the default server URL --timeout string HTTP request timeout (e.g., 30s, 5m, 100ms) @@ -45,4 +45,4 @@ vf workspace update [flags] ### SEE ALSO -* [vf workspace](vf_workspace.md) - Operations for workspace +* [vf workspace](vf_workspace.md) - Create, list and manage workspaces diff --git a/go.mod b/go.mod index d856d22a..b661511c 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,9 @@ require ( github.com/charmbracelet/bubbletea v1.3.4 github.com/charmbracelet/huh v0.6.0 github.com/charmbracelet/lipgloss v1.1.0 + github.com/charmbracelet/x/ansi v0.8.0 github.com/itchyny/gojq v0.12.18 + github.com/muesli/termenv v0.16.0 github.com/spf13/cobra v1.10.2 github.com/spf13/pflag v1.0.9 github.com/stretchr/testify v1.9.0 @@ -24,7 +26,6 @@ require ( github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/catppuccin/go v0.2.0 // indirect github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect - github.com/charmbracelet/x/ansi v0.8.0 // indirect github.com/charmbracelet/x/cellbuf v0.0.13-0.20250311204145-2c3ea96c31dd // indirect github.com/charmbracelet/x/exp/strings v0.0.0-20240722160745-212f7b056ed0 // indirect github.com/charmbracelet/x/term v0.2.1 // indirect @@ -45,7 +46,6 @@ require ( github.com/mitchellh/hashstructure/v2 v2.0.2 // indirect github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect github.com/muesli/cancelreader v0.2.2 // indirect - github.com/muesli/termenv v0.16.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect diff --git a/internal/cli/agent/root.go b/internal/cli/agent/root.go index ed7022b8..527dc33a 100644 --- a/internal/cli/agent/root.go +++ b/internal/cli/agent/root.go @@ -11,8 +11,8 @@ import ( func InitAgentRoot(parent *cobra.Command) error { var AgentCmd = &cobra.Command{ Use: "agent", - Short: "Operations for agent", - Long: "Operations for agent", + Short: "Configure the agent's instructions, prompt and voice", + Long: "Configure the agent's instructions, prompt and voice", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/analytics/query/root.go b/internal/cli/analytics/query/root.go index 4f74614b..fa2f9823 100644 --- a/internal/cli/analytics/query/root.go +++ b/internal/cli/analytics/query/root.go @@ -11,8 +11,8 @@ import ( func InitQueryRoot(parent *cobra.Command) error { var QueryCmd = &cobra.Command{ Use: "query", - Short: "Operations for query", - Long: "Operations for query", + Short: "Query calls, token use, and tool and document use", + Long: "Query calls, token use, and tool and document use", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/analytics/root.go b/internal/cli/analytics/root.go index 1f2ae914..73405be1 100644 --- a/internal/cli/analytics/root.go +++ b/internal/cli/analytics/root.go @@ -12,8 +12,8 @@ import ( func InitAnalyticsRoot(parent *cobra.Command) error { var AnalyticsCmd = &cobra.Command{ Use: "analytics", - Short: "Operations for analytics", - Long: "Operations for analytics", + Short: "See how agents are used: calls, tokens, tools", + Long: "See how agents are used: calls, tokens, tools", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/apitool/apitoolvariable/root.go b/internal/cli/apitool/apitoolvariable/root.go index 98cfd3ff..1da038a6 100644 --- a/internal/cli/apitool/apitoolvariable/root.go +++ b/internal/cli/apitool/apitoolvariable/root.go @@ -11,8 +11,8 @@ import ( func InitApiToolVariableRoot(parent *cobra.Command) error { var ApiToolVariableCmd = &cobra.Command{ Use: "variable", - Short: "Operations for api-tool-variable", - Long: "Operations for api-tool-variable", + Short: "Manage an API tool's variables", + Long: "Manage an API tool's variables", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/apitool/root.go b/internal/cli/apitool/root.go index 6d60ba3b..f9301810 100644 --- a/internal/cli/apitool/root.go +++ b/internal/cli/apitool/root.go @@ -12,8 +12,8 @@ import ( func InitApiToolRoot(parent *cobra.Command) error { var ApiToolCmd = &cobra.Command{ Use: "api-tool", - Short: "Operations for api-tool", - Long: "Operations for api-tool", + Short: "Manage API tools: HTTP requests the agent can make", + Long: "Manage API tools: HTTP requests the agent can make", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/auth.go b/internal/cli/auth.go index 913c42a8..7c5ceedd 100644 --- a/internal/cli/auth.go +++ b/internal/cli/auth.go @@ -102,6 +102,7 @@ func runAuthLoginCmd(cmd *cobra.Command, args []string) error { } keychainStored := false + tokenEntered := false // for the styled report (auth_present.go) noInteractive, _ := cmd.Flags().GetBool("no-interactive") @@ -133,6 +134,7 @@ func runAuthLoginCmd(cmd *cobra.Command, args []string) error { keychainStored = true } changed = true + tokenEntered = v != "" } if !changed { @@ -164,6 +166,7 @@ func runAuthLoginCmd(cmd *cobra.Command, args []string) error { } if authToken != "" { + tokenEntered = true if config.StoreSecret("token", authToken, &cfg.Security.Token) == nil { keychainStored = true } @@ -176,6 +179,10 @@ func runAuthLoginCmd(cmd *cobra.Command, args []string) error { } out := cmd.OutOrStderr() + if u := output.UI(cmd, out); u.Decorated() { + writeTokenSaved(u, out, tokenEntered, keychainStored) + return nil + } if keychainStored { fmt.Fprintln(out, "Secret credentials stored in OS keychain") } @@ -190,7 +197,10 @@ func runAuthLogoutCmd(cmd *cobra.Command, args []string) error { cfg = &config.Config{} } + // Noted before clearing, for the styled report (auth_present.go). + hadToken := cfg.Security.Token != "" if config.KeyringAvailable() { + hadToken = hadToken || config.GetKeyringValue("token") != "" _ = config.DeleteKeyringValue("token") } cfg.Security.Token = "" @@ -206,6 +216,10 @@ func runAuthLogoutCmd(cmd *cobra.Command, args []string) error { } out := cmd.OutOrStdout() + if u := output.UI(cmd, out); u.Decorated() { + writeLogout(u, out, hadSession, hadToken) + return nil + } if hadSession { fmt.Fprintln(out, "Signed out of the OAuth session.") } @@ -231,7 +245,7 @@ func authIsInteractive(cmd *cobra.Command) bool { func authFormTheme() *huh.Theme { t := *huh.ThemeBase() - accent := lipgloss.Color("#38BDF8") + accent := lipgloss.Color("#397DFF") dimmed := lipgloss.Color("#64748B") subtle := lipgloss.Color("#475569") errColor := lipgloss.Color("#F87171") diff --git a/internal/cli/auth_present.go b/internal/cli/auth_present.go new file mode 100644 index 00000000..4dafa570 --- /dev/null +++ b/internal/cli/auth_present.go @@ -0,0 +1,130 @@ +// This file is not generated by Speakeasy. It is how 'vf whoami', +// 'vf auth whoami', 'vf auth logout' and token entry in 'vf auth login' look to +// a person at a terminal, per internal/ui/DESIGN.md. Off a terminal and in +// agent mode those commands print their plain text, unchanged. + +package cli + +import ( + "fmt" + "io" + "strings" + "time" + + "github.com/spf13/cobra" + "github.com/voiceflow/cli/internal/config" + "github.com/voiceflow/cli/internal/oauth" + "github.com/voiceflow/cli/internal/ui" +) + +// writeWhoami answers "which credential will my next command send?" first, +// then lists everything stored, so a shadowed credential is visible too. +func writeWhoami(cmd *cobra.Command, u *ui.UI, out io.Writer) { + state := signInState(cmd) // home.go; the client's own order + session := oauth.CurrentStatus() + token, source := config.ResolveSecurityCredential(cmd, "token") + + fmt.Fprintln(out, u.Status(state.kind, state.text)) + switch { + case !state.signed: + fmt.Fprintln(out, u.Under("Sign in with "+u.Accent("vf auth login")+", or create an account with "+u.Accent("vf auth signup"))) + case source == "env" && session.LoggedIn: + fmt.Fprintln(out, u.Under("It outranks your browser session. To use the session: "+u.Accent("unset VF_TOKEN"))) + case source == "flag" && session.LoggedIn: + fmt.Fprintln(out, u.Under("--token outranks your browser session for this command")) + } + + empty := u.Muted(ui.Empty.Symbol()) + sessionValue := empty + if session.LoggedIn { + parts := []string{"signed in"} + switch { + case session.Renews: + parts = append(parts, "renews automatically") + case !session.Expiry.IsZero(): + parts = append(parts, "ends "+ui.Until(session.Expiry, time.Now())) + } + parts = append(parts, storageName(session.Storage)) + sessionValue = strings.Join(parts, u.Muted(" "+ui.Separator.Symbol()+" ")) + } + tokenValue := empty + if token != "" { + tokenValue = maskSecret(token) + " " + u.Muted(tokenSourceName(source)) + if session.LoggedIn && (source == "keyring" || source == "config") { + tokenValue += u.Muted(" " + ui.Separator.Symbol() + " unused while you're signed in") + } + } + + rows := [][2]string{ + {"Browser session", sessionValue}, + {"Access token", tokenValue}, + } + if session.LoggedIn && session.Scope != "" { + rows = append(rows, [2]string{"Scopes", u.Muted(session.Scope)}) + } + rows = append(rows, [2]string{"Config file", ui.ShortPath(config.GetConfigPath())}) + + fmt.Fprintln(out) + for _, r := range rows { + fmt.Fprintf(out, " %s %s\n", u.Bold(fmt.Sprintf("%-15s", r[0])), r[1]) + } +} + +// writeLogout reports what 'vf auth logout' cleared. +func writeLogout(u *ui.UI, out io.Writer, hadSession, hadToken bool) { + var cleared []string + if hadSession { + cleared = append(cleared, "your browser session") + } + if hadToken { + cleared = append(cleared, "your saved access token") + } + if len(cleared) == 0 { + fmt.Fprintln(out, u.Status(ui.StatusDone, "Already signed out")) + fmt.Fprintln(out, u.Under(u.Muted("No browser session or saved access token here"))) + } else { + fmt.Fprintln(out, u.Status(ui.StatusDone, "Signed out")) + fmt.Fprintln(out, u.Under("Cleared "+strings.Join(cleared, " and "))) + } + if config.GetEnvValue("token") != "" { + fmt.Fprintln(out, u.Status(ui.StatusWarn, "VF_TOKEN is still set in this shell")) + fmt.Fprintln(out, u.Under("Commands keep using it until you run "+u.Accent("unset VF_TOKEN"))) + } +} + +// writeTokenSaved reports a token stored by 'vf auth login --token' or +// --manual. +func writeTokenSaved(u *ui.UI, out io.Writer, entered, inKeychain bool) { + switch { + case !entered: + fmt.Fprintln(out, u.Status(ui.StatusWarn, "No token entered")) + fmt.Fprintln(out, u.Under("Nothing changed")) + case inKeychain: + fmt.Fprintln(out, u.Status(ui.StatusDone, "Saved your access token")) + fmt.Fprintln(out, u.Under(u.Muted("In the keychain"))) + default: + fmt.Fprintln(out, u.Status(ui.StatusDone, "Saved your access token")) + fmt.Fprintln(out, u.Under(u.Muted("In "+ui.ShortPath(config.GetConfigPath())))) + } +} + +func storageName(storage string) string { + if storage == "OS keychain" { + return "keychain" + } + return ui.ShortPath(storage) +} + +func tokenSourceName(source string) string { + switch source { + case "flag": + return "from --token" + case "env": + return "from VF_TOKEN" + case "keyring": + return "in the keychain" + case "config": + return "in the config file" + } + return "" +} diff --git a/internal/cli/auth_present_test.go b/internal/cli/auth_present_test.go new file mode 100644 index 00000000..9db51f2b --- /dev/null +++ b/internal/cli/auth_present_test.go @@ -0,0 +1,150 @@ +// This file is not generated by Speakeasy. It covers auth_present.go. + +package cli + +import ( + "bytes" + "path/filepath" + "strings" + "testing" + + "github.com/voiceflow/cli/internal/ui" +) + +const testSession = `{"version":1,"issuer":"https://auth.example","client_id":"c","scope":"universal.workspace.read","access_token":"a","refresh_token":"r"}` + +func terminalUI(out *bytes.Buffer) *ui.UI { return ui.New(out, ui.Options{Decorate: true}) } + +func checkOutput(t *testing.T, got string, want, unwanted []string) { + t.Helper() + for _, w := range want { + if !strings.Contains(got, w) { + t.Errorf("missing %q in:\n%s", w, got) + } + } + for _, w := range unwanted { + if strings.Contains(got, w) { + t.Errorf("unexpected %q in:\n%s", w, got) + } + } +} + +func TestWriteWhoami(t *testing.T) { + cases := []struct { + name string + setup func(t *testing.T, home string, kr memKeyring) + want, unwanted []string + }{ + { + name: "nothing stored", + setup: func(*testing.T, string, memKeyring) {}, + want: []string{ + "⚠ Not signed in\n", + " ⎿ Sign in with vf auth login, or create an account with vf auth signup\n", + "Browser session —\n", + "Access token —\n", + "Config file ~/.config/vf/config.yaml\n", + }, + unwanted: []string{"Scopes"}, + }, + { + name: "VF_TOKEN shadows a browser session", + setup: func(t *testing.T, home string, _ memKeyring) { + writeFile(t, filepath.Join(home, ".config", "vf", "oauth.json"), testSession) + t.Setenv("VF_TOKEN", "vfp_from_env") + }, + want: []string{ + "✓ Using the access token from VF_TOKEN\n", + " ⎿ It outranks your browser session. To use the session: unset VF_TOKEN\n", + "Browser session signed in · renews automatically · ~/.config/vf/oauth.json\n", + "Access token vf******nv from VF_TOKEN\n", + "Scopes universal.workspace.read\n", + }, + unwanted: []string{"vfp_from_env"}, + }, + { + name: "a browser session shadows a saved token", + setup: func(t *testing.T, home string, kr memKeyring) { + writeFile(t, filepath.Join(home, ".config", "vf", "oauth.json"), testSession) + kr["vf/token"] = "vfp_saved_token" + }, + want: []string{ + "✓ Signed in with your browser\n", + "Access token vf******en in the keychain · unused while you're signed in\n", + }, + unwanted: []string{"⎿", "vfp_saved_token"}, + }, + } + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + home, kr := isolate(t) + c.setup(t, home, kr) + loadConfig(t) + root, err := NewRootCommand() + if err != nil { + t.Fatal(err) + } + var out bytes.Buffer + writeWhoami(root, terminalUI(&out), &out) + checkOutput(t, out.String(), c.want, c.unwanted) + }) + } +} + +// Off a terminal whoami prints what it always has; test/isolation.test.ts +// and scripts read it. +func TestWhoamiOffATerminalIsUnchanged(t *testing.T) { + isolate(t) + root, err := NewRootCommand() + if err != nil { + t.Fatal(err) + } + var out bytes.Buffer + root.SetOut(&out) + root.SetArgs([]string{"whoami"}) + if err := root.Execute(); err != nil { + t.Fatal(err) + } + checkOutput(t, out.String(), []string{"Configuration\n=============\n", "Credentials:\n", "OAuth session:\n not signed in"}, []string{"✓", "⚠"}) +} + +func TestWriteLogout(t *testing.T) { + cases := []struct { + name string + hadSession, hadToken bool + vfToken string + want, unwanted []string + }{ + {"both", true, true, "", []string{"✓ Signed out\n", " ⎿ Cleared your browser session and your saved access token\n"}, []string{"VF_TOKEN"}}, + {"token only", false, true, "", []string{"✓ Signed out\n", " ⎿ Cleared your saved access token\n"}, nil}, + {"nothing", false, false, "", []string{"✓ Already signed out\n"}, []string{"Cleared"}}, + {"VF_TOKEN left", true, false, "vfp_env", []string{"⚠ VF_TOKEN is still set in this shell\n", "unset VF_TOKEN"}, nil}, + } + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + isolate(t) + t.Setenv("VF_TOKEN", c.vfToken) + var out bytes.Buffer + writeLogout(terminalUI(&out), &out, c.hadSession, c.hadToken) + checkOutput(t, out.String(), c.want, c.unwanted) + }) + } +} + +func TestWriteTokenSaved(t *testing.T) { + isolate(t) + for _, c := range []struct { + entered, keychain bool + want string + }{ + {true, true, "✓ Saved your access token\n ⎿ In the keychain\n"}, + {true, false, "✓ Saved your access token\n ⎿ In ~/.config/vf/config.yaml\n"}, + {false, false, "⚠ No token entered\n ⎿ Nothing changed\n"}, + } { + var out bytes.Buffer + writeTokenSaved(terminalUI(&out), &out, c.entered, c.keychain) + if out.String() != c.want { + t.Errorf("entered=%v keychain=%v:\ngot %q\nwant %q", c.entered, c.keychain, out.String(), c.want) + } + } +} diff --git a/internal/cli/billing/billingcredits/root.go b/internal/cli/billing/billingcredits/root.go index 887b99f8..ff3d769f 100644 --- a/internal/cli/billing/billingcredits/root.go +++ b/internal/cli/billing/billingcredits/root.go @@ -11,8 +11,8 @@ import ( func InitBillingCreditsRoot(parent *cobra.Command) error { var BillingCreditsCmd = &cobra.Command{ Use: "credits", - Short: "Operations for billing-credits", - Long: "Operations for billing-credits", + Short: "Check credits used this billing period", + Long: "Check credits used this billing period", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/billing/limits/root.go b/internal/cli/billing/limits/root.go index 2b1377aa..30b92f94 100644 --- a/internal/cli/billing/limits/root.go +++ b/internal/cli/billing/limits/root.go @@ -11,8 +11,8 @@ import ( func InitLimitsRoot(parent *cobra.Command) error { var LimitsCmd = &cobra.Command{ Use: "limits", - Short: "Operations for limits", - Long: "Operations for limits", + Short: "Check plan limits against current usage", + Long: "Check plan limits against current usage", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/billing/root.go b/internal/cli/billing/root.go index b680ca45..421601b4 100644 --- a/internal/cli/billing/root.go +++ b/internal/cli/billing/root.go @@ -14,8 +14,8 @@ import ( func InitBillingRoot(parent *cobra.Command) error { var BillingCmd = &cobra.Command{ Use: "billing", - Short: "Operations for billing", - Long: "Operations for billing", + Short: "Check an organization's plan, limits and credits", + Long: "Check an organization's plan, limits and credits", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/billing/subscription/root.go b/internal/cli/billing/subscription/root.go index 898813ba..3d63e776 100644 --- a/internal/cli/billing/subscription/root.go +++ b/internal/cli/billing/subscription/root.go @@ -11,8 +11,8 @@ import ( func InitSubscriptionRoot(parent *cobra.Command) error { var SubscriptionCmd = &cobra.Command{ Use: "subscription", - Short: "Operations for subscription", - Long: "Operations for subscription", + Short: "Get an organization's subscription and plan", + Long: "Get an organization's subscription and plan", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/configure.go b/internal/cli/configure.go index 30b4db81..38e72617 100644 --- a/internal/cli/configure.go +++ b/internal/cli/configure.go @@ -160,7 +160,7 @@ func configureIsInteractive(cmd *cobra.Command) bool { func configureFormTheme() *huh.Theme { t := *huh.ThemeBase() - accent := lipgloss.Color("#38BDF8") + accent := lipgloss.Color("#397DFF") dimmed := lipgloss.Color("#64748B") subtle := lipgloss.Color("#475569") errColor := lipgloss.Color("#F87171") diff --git a/internal/cli/conversation/root.go b/internal/cli/conversation/root.go index 7812cc2c..22ee7af3 100644 --- a/internal/cli/conversation/root.go +++ b/internal/cli/conversation/root.go @@ -12,8 +12,8 @@ import ( func InitConversationRoot(parent *cobra.Command) error { var ConversationCmd = &cobra.Command{ Use: "conversation", - Short: "Operations for conversation", - Long: "Operations for conversation", + Short: "Talk to an agent: send messages, run scripts", + Long: "Talk to an agent: send messages, run scripts", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/conversation/state/root.go b/internal/cli/conversation/state/root.go index 42d09060..18e5b32d 100644 --- a/internal/cli/conversation/state/root.go +++ b/internal/cli/conversation/state/root.go @@ -11,8 +11,8 @@ import ( func InitStateRoot(parent *cobra.Command) error { var StateCmd = &cobra.Command{ Use: "state", - Short: "Operations for state", - Long: "Operations for state", + Short: "Read and change a user's conversation state", + Long: "Read and change a user's conversation state", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/credits/root.go b/internal/cli/credits/root.go index f60f99db..fb213348 100644 --- a/internal/cli/credits/root.go +++ b/internal/cli/credits/root.go @@ -11,8 +11,8 @@ import ( func InitCreditsRoot(parent *cobra.Command) error { var CreditsCmd = &cobra.Command{ Use: "credits", - Short: "Operations for credits", - Long: "Operations for credits", + Short: "Check whether a project has credits left to run", + Long: "Check whether a project has credits left to run", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/docs.go b/internal/cli/docs.go index da94d192..0cd1063d 100644 --- a/internal/cli/docs.go +++ b/internal/cli/docs.go @@ -20,6 +20,7 @@ import ( "time" "github.com/spf13/cobra" + "github.com/voiceflow/cli/internal/client" "github.com/voiceflow/cli/internal/flagutil" "github.com/voiceflow/cli/internal/output" ) @@ -120,7 +121,9 @@ func runDocsSearchCmd(cmd *cobra.Command, args []string) error { httpRequest.Header.Set("Content-Type", "application/json") httpRequest.Header.Set("Accept", "application/json, text/event-stream") + stop := client.StartSpinner(cmd, "Searching the docs…") body, err := doDocsRequest(httpRequest) + stop() if err != nil { return err } @@ -137,7 +140,8 @@ func runDocsSearchCmd(cmd *cobra.Command, args []string) error { return nil } - out := cmd.OutOrStdout() + out, done := output.ResultWriter(cmd) // folds inside the home prompt + defer done() for i, result := range results { if i > 0 { fmt.Fprint(out, "\n---\n\n") @@ -204,11 +208,15 @@ func runDocsGetCmd(cmd *cobra.Command, args []string) error { return err } + stop := client.StartSpinner(cmd, "Fetching the page…") body, err := doDocsRequest(httpRequest) + stop() if err != nil { return err } - fmt.Fprintln(cmd.OutOrStdout(), strings.TrimSpace(string(body))) + out, done := output.ResultWriter(cmd) // folds inside the home prompt + defer done() + fmt.Fprintln(out, strings.TrimSpace(string(body))) return nil } diff --git a/internal/cli/document/documentfolder/root.go b/internal/cli/document/documentfolder/root.go index c9bdf4c4..b3ed3284 100644 --- a/internal/cli/document/documentfolder/root.go +++ b/internal/cli/document/documentfolder/root.go @@ -11,8 +11,8 @@ import ( func InitDocumentFolderRoot(parent *cobra.Command) error { var DocumentFolderCmd = &cobra.Command{ Use: "folder", - Short: "Operations for document-folder", - Long: "Operations for document-folder", + Short: "Organize knowledge base documents into folders", + Long: "Organize knowledge base documents into folders", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/document/root.go b/internal/cli/document/root.go index 5c8d9664..2b21c61d 100644 --- a/internal/cli/document/root.go +++ b/internal/cli/document/root.go @@ -12,8 +12,8 @@ import ( func InitDocumentRoot(parent *cobra.Command) error { var DocumentCmd = &cobra.Command{ Use: "document", - Short: "Operations for document", - Long: "Operations for document", + Short: "Manage knowledge base documents and sitemaps", + Long: "Manage knowledge base documents and sitemaps", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/environment/root.go b/internal/cli/environment/root.go index 360f2206..7d518e03 100644 --- a/internal/cli/environment/root.go +++ b/internal/cli/environment/root.go @@ -11,8 +11,8 @@ import ( func InitEnvironmentRoot(parent *cobra.Command) error { var EnvironmentCmd = &cobra.Command{ Use: "environment", - Short: "Operations for environment", - Long: "Operations for environment", + Short: "Publish, clone, merge and compare environments", + Long: "Publish, clone, merge and compare environments", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/evaluation/root.go b/internal/cli/evaluation/root.go index 15494a48..7b4035cd 100644 --- a/internal/cli/evaluation/root.go +++ b/internal/cli/evaluation/root.go @@ -11,8 +11,8 @@ import ( func InitEvaluationRoot(parent *cobra.Command) error { var EvaluationCmd = &cobra.Command{ Use: "evaluation", - Short: "Operations for evaluation", - Long: "Operations for evaluation", + Short: "Create and run evaluations that score transcripts", + Long: "Create and run evaluations that score transcripts", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/event/root.go b/internal/cli/event/root.go index 87f64f85..92dadcc4 100644 --- a/internal/cli/event/root.go +++ b/internal/cli/event/root.go @@ -11,8 +11,8 @@ import ( func InitEventRoot(parent *cobra.Command) error { var EventCmd = &cobra.Command{ Use: "event", - Short: "Operations for event", - Long: "Operations for event", + Short: "Manage the events clients can send to the agent", + Long: "Manage the events clients can send to the agent", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/function/functionpath/root.go b/internal/cli/function/functionpath/root.go index a051f3a7..eac2ffc3 100644 --- a/internal/cli/function/functionpath/root.go +++ b/internal/cli/function/functionpath/root.go @@ -11,8 +11,8 @@ import ( func InitFunctionPathRoot(parent *cobra.Command) error { var FunctionPathCmd = &cobra.Command{ Use: "path", - Short: "Operations for function-path", - Long: "Operations for function-path", + Short: "Manage a function's paths", + Long: "Manage a function's paths", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/function/functionvariable/root.go b/internal/cli/function/functionvariable/root.go index e4d1acbd..3554680d 100644 --- a/internal/cli/function/functionvariable/root.go +++ b/internal/cli/function/functionvariable/root.go @@ -11,8 +11,8 @@ import ( func InitFunctionVariableRoot(parent *cobra.Command) error { var FunctionVariableCmd = &cobra.Command{ Use: "variable", - Short: "Operations for function-variable", - Long: "Operations for function-variable", + Short: "Manage a function's variables", + Long: "Manage a function's variables", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/function/root.go b/internal/cli/function/root.go index 1d1ff5d1..c7229d37 100644 --- a/internal/cli/function/root.go +++ b/internal/cli/function/root.go @@ -13,8 +13,8 @@ import ( func InitFunctionRoot(parent *cobra.Command) error { var FunctionCmd = &cobra.Command{ Use: "function", - Short: "Operations for function", - Long: "Operations for function", + Short: "Write, run and manage functions", + Long: "Write, run and manage functions", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/history.go b/internal/cli/history.go new file mode 100644 index 00000000..fbefce53 --- /dev/null +++ b/internal/cli/history.go @@ -0,0 +1,83 @@ +// This file is not generated by Speakeasy. It keeps the home prompt's history +// across sessions, as a shell and Claude Code do, so ↑ and ctrl-r reach lines +// run yesterday. + +package cli + +import ( + "os" + "path/filepath" + "regexp" + "strings" + + "github.com/voiceflow/cli/internal/config" +) + +// historyMax is how many lines the prompt remembers. +var historyMax = 1000 + +// historyPath is where the prompt keeps its lines, beside config.yaml: +// ~/.config/vf/history. +func historyPath() string { + return filepath.Join(filepath.Dir(config.GetConfigPath()), "history") +} + +// sensitiveLine matches lines that may carry a credential: a --token flag, a +// vfp_ token pasted in, anything about secrets or API keys. They are never +// written to disk; ↑ still reaches them until the prompt closes. +var sensitiveLine = regexp.MustCompile(`(?i)token|secret|password|passwd|api[-_]?key|authorization|bearer|vfp_`) + +// loadHistory reads the newest historyMax lines, oldest first. A missing or +// unreadable file is an empty history. +func loadHistory(path string) []string { + data, err := os.ReadFile(path) + if err != nil { + return nil + } + var lines []string + for _, l := range strings.Split(string(data), "\n") { + if l = strings.TrimSpace(l); l != "" && (len(lines) == 0 || lines[len(lines)-1] != l) { + lines = append(lines, l) + } + } + if len(lines) > historyMax { + lines = lines[len(lines)-historyMax:] + } + return lines +} + +// saveHistory appends line to the history file, readable by its owner only, +// unless it may carry a credential. Appending lets two prompts open at once +// both keep their lines; the file is cut back to the newest historyMax once +// it holds twice that. History is a convenience, so a failure is silent. +func saveHistory(path, line string) { + line = strings.TrimSpace(line) + if line == "" || sensitiveLine.MatchString(line) || strings.ContainsAny(line, "\r\n") { + return + } + if err := os.MkdirAll(filepath.Dir(path), 0o700); err != nil { + return + } + f, err := os.OpenFile(path, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0o600) + if err != nil { + return + } + _, werr := f.WriteString(line + "\n") + if cerr := f.Close(); werr != nil || cerr != nil { + return + } + trimHistory(path) +} + +func trimHistory(path string) { + data, err := os.ReadFile(path) + if err != nil || strings.Count(string(data), "\n") <= 2*historyMax { + return + } + lines := strings.Split(strings.TrimRight(string(data), "\n"), "\n") + keep := strings.Join(lines[len(lines)-historyMax:], "\n") + "\n" + tmp := path + ".tmp" + if os.WriteFile(tmp, []byte(keep), 0o600) == nil { + _ = os.Rename(tmp, path) + } +} diff --git a/internal/cli/history_test.go b/internal/cli/history_test.go new file mode 100644 index 00000000..572458f5 --- /dev/null +++ b/internal/cli/history_test.go @@ -0,0 +1,67 @@ +// This file is not generated by Speakeasy. It covers history.go. + +package cli + +import ( + "os" + "path/filepath" + "reflect" + "strconv" + "strings" + "testing" +) + +func TestHistorySurvivesTheSession(t *testing.T) { + path := filepath.Join(t.TempDir(), "vf", "history") + if got := loadHistory(path); got != nil { + t.Fatalf("no file yet should be no history, got %q", got) + } + for _, l := range []string{"project list", "project list", " environment publish --project-id p1 ", "version"} { + saveHistory(path, l) + } + want := []string{"project list", "environment publish --project-id p1", "version"} + if got := loadHistory(path); !reflect.DeepEqual(got, want) { + t.Errorf("got %q, want %q", got, want) + } + info, err := os.Stat(path) + if err != nil { + t.Fatal(err) + } + if perm := info.Mode().Perm(); perm != 0o600 { + t.Errorf("the history file should be readable by its owner only, got %v", perm) + } +} + +func TestHistoryKeepsNoCredentials(t *testing.T) { + path := filepath.Join(t.TempDir(), "history") + for _, l := range []string{ + "project list --token vfp_abc123", + "auth login --api-key x", + "secret create --name db --value hunter2", + "workflow get --workflow-id w1 --header 'Authorization: Bearer x'", + "variable create --name PASSWORD", + } { + saveHistory(path, l) + } + saveHistory(path, "project list") + if got := loadHistory(path); !reflect.DeepEqual(got, []string{"project list"}) { + t.Errorf("only the line without a credential should be saved, got %q", got) + } +} + +func TestHistoryIsCutBackToTheNewest(t *testing.T) { + defer func(n int) { historyMax = n }(historyMax) + historyMax = 5 + path := filepath.Join(t.TempDir(), "history") + for i := 1; i <= 11; i++ { + saveHistory(path, "project get --project-id p"+strconv.Itoa(i)) + } + data, _ := os.ReadFile(path) + if n := strings.Count(string(data), "\n"); n > 2*historyMax { + t.Errorf("the file should be cut back once it holds twice the limit, has %d lines", n) + } + got := loadHistory(path) + if len(got) != 5 || got[4] != "project get --project-id p11" || got[0] != "project get --project-id p7" { + t.Errorf("should keep the newest five, got %q", got) + } +} diff --git a/internal/cli/home.go b/internal/cli/home.go new file mode 100644 index 00000000..924b1086 --- /dev/null +++ b/internal/cli/home.go @@ -0,0 +1,256 @@ +// This file is not generated by Speakeasy. It is what bare `vf` shows a person +// at a terminal: the home banner (internal/ui/banner.go), then the home prompt +// (internal/prompt), which runs commands until the person leaves. Everywhere +// else (a pipe, an agent, TERM=dumb) bare `vf` prints help, as it always has. + +package cli + +import ( + "context" + "fmt" + "io" + "os" + "os/signal" + "strings" + + "github.com/spf13/cobra" + "github.com/voiceflow/cli/internal/config" + "github.com/voiceflow/cli/internal/interactive" + "github.com/voiceflow/cli/internal/oauth" + "github.com/voiceflow/cli/internal/output" + "github.com/voiceflow/cli/internal/prompt" + "github.com/voiceflow/cli/internal/ui" +) + +// homeWords are the prompt's own commands, offered in its menu beside vf's. +var homeWords = []prompt.Suggestion{ + {Label: "exit", Detail: "Leave vf (or ctrl-d)"}, + {Label: "clear", Detail: "Clear the screen"}, + {Label: "more", Detail: "Show the rest of folded output (or ctrl-o)"}, +} + +// homeKeys are keys that run a prompt word on an empty line. +var homeKeys = map[string]string{"ctrl+o": "more"} + +// inPrompt is set while the home prompt runs commands, so a line that runs +// the root command itself (say "--debug") prints the banner instead of +// opening a second prompt inside the first. +var inPrompt bool + +// runHome prints the home banner, then opens the home prompt when someone can +// type into it; or prints help where no one is there to see a box. +// +// Bare `vf` used to open the full-screen explorer. The banner and prompt are +// inline instead, in the scrollback, as DESIGN.md asks; the explorer is +// `vf explore`. --no-interactive, or stdin that is not a terminal, leaves the +// banner alone and returns to the shell. +func runHome(cmd *cobra.Command) error { + out := cmd.OutOrStdout() + u := output.UI(cmd, out) + if !u.Decorated() { + return cmd.Help() + } + state := signInState(cmd) + if _, err := fmt.Fprintln(out, u.Banner(homeBanner(state), ui.TerminalWidth(out))); err != nil { + return err + } + if inPrompt || !interactive.IsInteractive(cmd) { + return nil + } + return runPrompt(cmd, u, out, state) +} + +// runPrompt reads a line, runs it as a vf command, and repeats until the +// person types exit, or presses Ctrl-D or Ctrl-C twice on an empty line. +func runPrompt(cmd *cobra.Command, u *ui.UI, out io.Writer, state signIn) error { + inPrompt = true + defer func() { inPrompt = false }() + + complete := prompt.Commands(cmd.Root(), homeWords) + histFile := historyPath() + history := loadHistory(histFile) // history.go: kept across sessions + for { + placeholder := `Try "workspace list"` + if !state.signed { + placeholder = `Try "auth login"` + } + fmt.Fprintln(out) + line, ok, err := prompt.Read(prompt.Options{ + UI: u, In: os.Stdin, Out: out, Width: ui.TerminalWidth(out), + Complete: complete, History: history, Placeholder: placeholder, + Keys: homeKeys, + }) + if err != nil || !ok { + return err + } + // A leading / is how Claude Code names its commands; vf's have none. + line = strings.TrimPrefix(strings.TrimSpace(line), "/") + if line == "" { + continue + } + if len(history) == 0 || history[len(history)-1] != line { + history = append(history, line) + } + + args, err := prompt.SplitArgs(line) + if err != nil { + fmt.Fprintln(os.Stderr, u.Status(ui.StatusFailed, "That line has a quote that is never closed")) + continue + } + if len(args) > 0 && args[0] == "vf" { + args = args[1:] // "vf project list" works as typed in a shell + } + switch strings.Join(args, " ") { + case "": + continue + case "exit", "quit": + return nil + case "clear": + fmt.Fprint(out, "\x1b[H\x1b[2J") + fmt.Fprintln(out, u.Banner(homeBanner(state), ui.TerminalWidth(out))) + continue + case "more": + if rest := output.TakeFolded(); rest != "" { + fmt.Fprint(out, rest) + } else { + fmt.Fprintln(out, u.Muted("Nothing is folded away")) + } + continue + } + saveHistory(histFile, line) + runLine(u, args) + state = signInState(cmd) // a line may have signed in or out + } +} + +// runLine runs one line as its own vf invocation: a fresh command tree, with +// the agent mode and config of the last line cleared, so no flag or setting +// leaks from one line into the next. Errors print as main prints them, and +// help is the prompt's shorter help (prompt_help.go). +func runLine(u *ui.UI, args []string) { + output.ResetAgentMode() + output.SetFold(foldLines()) // a result taller than the screen folds (output/fold.go) + defer output.SetFold(0) + config.Reset() + // The line's PersistentPreRunE loads config again, but a line that never + // reaches it (--help, a flag that does not parse) would leave it reset, + // and the prompt would then read the sign-in state from nothing: "Not + // signed in". Load it again afterwards; it is a no-op when the line did. + defer func() { _ = config.Init("vf", "VF") }() + root, err := NewRootCommand() + if err != nil { + fmt.Fprintln(os.Stderr, err) + return + } + setPromptHelp(root, u) + root.SetArgs(args) + ctx, stop := interruptible() + defer stop() + err = renderFlagValueError(root, root.ExecuteContext(ctx)) + switch { + case err == nil: + case err.Error() == "": // already reported, as in main + case ctx.Err() != nil: + fmt.Fprintln(os.Stderr, u.Status(ui.StatusFailed, "Canceled")) + default: + fmt.Fprintln(os.Stderr, err.Error()) + } +} + +// foldLines is how many lines of a result show before the rest folds away: +// the terminal's height, less room for the line's echo, the fold line and +// the prompt box under them, and never fewer than ten. +func foldLines() int { return max(ui.TerminalHeight(os.Stdout)-6, 10) } + +// interruptible is the context for one line. The first Ctrl-C cancels it, so +// the command stops and the prompt comes back instead of vf exiting. A second +// one, for a command that is not listening, exits vf as Ctrl-C always has. +func interruptible() (context.Context, func()) { + ctx, cancel := context.WithCancel(context.Background()) + sigs := make(chan os.Signal, 1) + signal.Notify(sigs, os.Interrupt) + done := make(chan struct{}) + go func() { + for pressed := false; ; pressed = true { + select { + case <-sigs: + if pressed { + os.Exit(130) + } + cancel() + case <-done: + return + } + } + }() + return ctx, func() { + signal.Stop(sigs) + close(done) + cancel() + } +} + +// signIn is how the next command would authenticate. +type signIn struct { + kind ui.Status + text string + signed bool +} + +// signInState reports the credential the next API call would send, in the +// order client.buildGlobalSecurity picks one: --token, then VF_TOKEN, then a +// browser session from `vf auth login`, then a token saved by `vf configure` +// in the keychain or the config file. +// +// It reads only what is stored here and calls no API, so the banner is +// instant and works offline. That also means a token shown as in use may +// still be expired or revoked; `vf whoami` and the first request say so. +func signInState(cmd *cobra.Command) signIn { + using := func(where string) signIn { + return signIn{ui.StatusDone, "Using the access token " + where, true} + } + _, source := config.ResolveSecurityCredential(cmd, "token") + switch source { + case "flag": + return using("from --token") + case "env": + return using("from VF_TOKEN") + } + if oauth.CurrentStatus().LoggedIn { + return signIn{ui.StatusDone, "Signed in with your browser", true} + } + switch source { + case "keyring": + return using("saved by vf configure") + case "config": + return using("in " + ui.ShortPath(config.GetConfigPath())) + } + return signIn{ui.StatusWarn, "Not signed in", false} +} + +func homeBanner(s signIn) ui.Banner { + start := []ui.Tip{ + {Command: "vf workspace list", Does: "your workspaces"}, + {Command: "vf explore", Does: "browse every command"}, + {Command: "vf docs search ", Does: "search the docs"}, + } + if !s.signed { + start = []ui.Tip{ + {Command: "vf auth login", Does: "sign in with your browser"}, + {Command: "vf auth signup", Does: "create an account"}, + {Command: "vf explore", Does: "browse every command"}, + } + } + return ui.Banner{ + Product: "Voiceflow CLI", + Version: Version, + Account: ui.Line{Kind: s.kind, Text: s.text}, + Sections: []ui.Section{ + {Heading: "Get started", Tips: start}, + { + Heading: "In a coding agent", + Note: "Claude Code, Cursor and Codex get agent mode automatically: TOON output and structured errors.", + }, + }, + } +} diff --git a/internal/cli/home_test.go b/internal/cli/home_test.go new file mode 100644 index 00000000..072d6ce1 --- /dev/null +++ b/internal/cli/home_test.go @@ -0,0 +1,208 @@ +// This file is not generated by Speakeasy. It covers home.go. + +package cli + +import ( + "bytes" + "os" + "path/filepath" + "strings" + "testing" + + "github.com/spf13/cobra" + "github.com/voiceflow/cli/internal/config" + "github.com/voiceflow/cli/internal/ui" + "github.com/zalando/go-keyring" +) + +// memKeyring stands in for the OS keychain, so no test reads the real one. +type memKeyring map[string]string + +func (m memKeyring) Get(service, key string) (string, error) { + if v, ok := m[service+"/"+key]; ok { + return v, nil + } + return "", keyring.ErrNotFound +} +func (m memKeyring) Set(service, key, value string) error { m[service+"/"+key] = value; return nil } +func (m memKeyring) Delete(service, key string) error { delete(m, service+"/"+key); return nil } + +// isolate gives the test an empty home directory and keychain and no +// VF_TOKEN, then initialises config the way the root command does. +func isolate(t *testing.T) (home string, kr memKeyring) { + t.Helper() + home = t.TempDir() + t.Setenv("HOME", home) + t.Setenv("USERPROFILE", home) + t.Setenv("VF_TOKEN", "") + kr = memKeyring{} + config.SetKeyringBackend(kr) + t.Cleanup(func() { config.SetKeyringBackend(memKeyring{}) }) + loadConfig(t) + return home, kr +} + +// loadConfig rereads the config file; config.Init alone is a no-op after the +// first call. +func loadConfig(t *testing.T) { + t.Helper() + config.Reset() + t.Cleanup(config.Reset) + if err := config.Init("vf", "VF"); err != nil { + t.Fatal(err) + } +} + +func writeFile(t *testing.T, path, content string) { + t.Helper() + if err := os.MkdirAll(filepath.Dir(path), 0o700); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(path, []byte(content), 0o600); err != nil { + t.Fatal(err) + } +} + +// The banner names the credential the next API call would send, in the same +// order client.buildGlobalSecurity picks one. +func TestSignInStateFollowsClientPrecedence(t *testing.T) { + session := `{"version":1,"issuer":"https://auth.example","client_id":"c","access_token":"a","refresh_token":"r"}` + cases := []struct { + name string + setup func(t *testing.T, home string, kr memKeyring) + args []string + want string + }{ + {"nothing stored", func(*testing.T, string, memKeyring) {}, nil, "Not signed in"}, + {"config file", func(t *testing.T, home string, _ memKeyring) { + writeFile(t, filepath.Join(home, ".config", "vf", "config.yaml"), "security:\n token: vfp_file\n") + }, nil, "Using the access token in ~/.config/vf/config.yaml"}, + {"keychain beats the config file", func(t *testing.T, home string, kr memKeyring) { + writeFile(t, filepath.Join(home, ".config", "vf", "config.yaml"), "security:\n token: vfp_file\n") + kr["vf/token"] = "vfp_keychain" + }, nil, "Using the access token saved by vf configure"}, + {"browser session beats a saved token", func(t *testing.T, home string, kr memKeyring) { + kr["vf/token"] = "vfp_keychain" + writeFile(t, filepath.Join(home, ".config", "vf", "oauth.json"), session) + }, nil, "Signed in with your browser"}, + {"VF_TOKEN beats a browser session", func(t *testing.T, home string, _ memKeyring) { + writeFile(t, filepath.Join(home, ".config", "vf", "oauth.json"), session) + t.Setenv("VF_TOKEN", "vfp_env") + }, nil, "Using the access token from VF_TOKEN"}, + {"--token beats everything", func(t *testing.T, _ string, _ memKeyring) { + t.Setenv("VF_TOKEN", "vfp_env") + }, []string{"--token", "vfp_flag"}, "Using the access token from --token"}, + } + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + home, kr := isolate(t) + c.setup(t, home, kr) + loadConfig(t) + root, err := NewRootCommand() + if err != nil { + t.Fatal(err) + } + if err := root.ParseFlags(c.args); err != nil { + t.Fatal(err) + } + if got := signInState(root); got.text != c.want { + t.Errorf("signInState = %q, want %q", got.text, c.want) + } + }) + } +} + +// Each prompt line resets config and its PersistentPreRunE loads it again. +// --help returns before PersistentPreRunE, and the prompt then read the +// sign-in state from a reset config: it said "Not signed in" and offered +// `auth login` to someone signed in. +func TestSignInSurvivesALineThatSkipsSetup(t *testing.T) { + home, _ := isolate(t) + writeFile(t, filepath.Join(home, ".config", "vf", "oauth.json"), + `{"version":1,"issuer":"https://auth.example","client_id":"c","access_token":"a","refresh_token":"r"}`) + loadConfig(t) + root, err := NewRootCommand() + if err != nil { + t.Fatal(err) + } + if !signInState(root).signed { + t.Fatal("the session should count as signed in before any line runs") + } + + // runLine prints the help to os.Stdout. + devNull, err := os.OpenFile(os.DevNull, os.O_WRONLY, 0) + if err != nil { + t.Fatal(err) + } + stdout := os.Stdout + os.Stdout = devNull + t.Cleanup(func() { os.Stdout = stdout; devNull.Close() }) + + for _, line := range [][]string{{"workflow", "--help"}, {"--help"}, {"project", "list", "--no-such-flag"}} { + runLine(ui.Plain(), line) + if got := signInState(root); !got.signed { + t.Errorf("after %q the prompt says %q", strings.Join(line, " "), got.text) + } + } +} + +func TestHomeBannerTipsFollowSignIn(t *testing.T) { + commands := func(s signIn) string { + var names []string + for _, tip := range homeBanner(s).Sections[0].Tips { + names = append(names, tip.Command) + } + return strings.Join(names, ", ") + } + if got := commands(signIn{signed: false}); !strings.Contains(got, "vf auth login") || !strings.Contains(got, "vf auth signup") { + t.Errorf("signed out, the banner should offer sign-in first: %s", got) + } + if got := commands(signIn{signed: true}); strings.Contains(got, "vf auth") || !strings.Contains(got, "vf workspace list") { + t.Errorf("signed in, the banner should offer work, not sign-in: %s", got) + } +} + +// Off a terminal (a pipe, CI, a test) bare vf prints help, byte for byte what +// it printed before the banner existed. The banner itself never reaches a +// pipe. +func TestBareVfOffATerminalPrintsHelp(t *testing.T) { + isolate(t) + root, err := NewRootCommand() + if err != nil { + t.Fatal(err) + } + var out bytes.Buffer + root.SetOut(&out) + root.SetErr(&out) + root.SetArgs([]string{}) + if err := root.Execute(); err != nil { + t.Fatal(err) + } + if !strings.Contains(out.String(), "Usage:\n vf [flags]\n vf [command]") { + t.Errorf("bare vf in a pipe should print help, got:\n%s", out.String()) + } + if strings.Contains(out.String(), "╭") { + t.Errorf("the banner leaked into a pipe") + } +} + +// Speakeasy names a group with no description "Operations for ". The +// home prompt's / menu and help list every group by its description, so each +// one needs a real one: edit Short and Long in the group's root.go (persistent +// edits keep them through regeneration). +func TestEveryGroupHasADescription(t *testing.T) { + root, err := NewRootCommand() + if err != nil { + t.Fatal(err) + } + var check func(c *cobra.Command) + check = func(c *cobra.Command) { + for _, child := range c.Commands() { + if strings.HasPrefix(child.Short, "Operations for ") || strings.HasPrefix(child.Long, "Operations for ") { + t.Errorf("%q has the generated description %q; write one in its root.go", child.CommandPath(), child.Short) + } + check(child) + } + } + check(root) +} diff --git a/internal/cli/integration/root.go b/internal/cli/integration/root.go index 6a38d10d..f7402c1e 100644 --- a/internal/cli/integration/root.go +++ b/internal/cli/integration/root.go @@ -11,8 +11,8 @@ import ( func InitIntegrationRoot(parent *cobra.Command) error { var IntegrationCmd = &cobra.Command{ Use: "integration", - Short: "Operations for integration", - Long: "Operations for integration", + Short: "Connect integrations and use their tools", + Long: "Connect integrations and use their tools", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/knowledgebase/root.go b/internal/cli/knowledgebase/root.go index 0d021768..280a8466 100644 --- a/internal/cli/knowledgebase/root.go +++ b/internal/cli/knowledgebase/root.go @@ -11,8 +11,8 @@ import ( func InitKnowledgeBaseRoot(parent *cobra.Command) error { var KnowledgeBaseCmd = &cobra.Command{ Use: "knowledge-base", - Short: "Operations for knowledge-base", - Long: "Operations for knowledge-base", + Short: "Query the knowledge base", + Long: "Query the knowledge base", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/mcpserver/root.go b/internal/cli/mcpserver/root.go index 472c59d1..f726036d 100644 --- a/internal/cli/mcpserver/root.go +++ b/internal/cli/mcpserver/root.go @@ -11,8 +11,8 @@ import ( func InitMcpServerRoot(parent *cobra.Command) error { var McpServerCmd = &cobra.Command{ Use: "mcp-server", - Short: "Operations for mcp-server", - Long: "Operations for mcp-server", + Short: "Manage the MCP servers an agent connects to", + Long: "Manage the MCP servers an agent connects to", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/mcptool/root.go b/internal/cli/mcptool/root.go index 77effc96..78611fa5 100644 --- a/internal/cli/mcptool/root.go +++ b/internal/cli/mcptool/root.go @@ -11,8 +11,8 @@ import ( func InitMcpToolRoot(parent *cobra.Command) error { var McpToolCmd = &cobra.Command{ Use: "mcp-tool", - Short: "Operations for mcp-tool", - Long: "Operations for mcp-tool", + Short: "List, inspect and run MCP server tools", + Long: "List, inspect and run MCP server tools", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/message/root.go b/internal/cli/message/root.go index 0eeb5f65..4c8c0b0e 100644 --- a/internal/cli/message/root.go +++ b/internal/cli/message/root.go @@ -11,8 +11,8 @@ import ( func InitMessageRoot(parent *cobra.Command) error { var MessageCmd = &cobra.Command{ Use: "message", - Short: "Operations for message", - Long: "Operations for message", + Short: "Manage reusable messages and their variants", + Long: "Manage reusable messages and their variants", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/persona/root.go b/internal/cli/persona/root.go index cd06515f..d3113a57 100644 --- a/internal/cli/persona/root.go +++ b/internal/cli/persona/root.go @@ -11,8 +11,8 @@ import ( func InitPersonaRoot(parent *cobra.Command) error { var PersonaCmd = &cobra.Command{ Use: "persona", - Short: "Operations for persona", - Long: "Operations for persona", + Short: "Manage personas, sets of preset variable values", + Long: "Manage personas, sets of preset variable values", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/phonenumber/root.go b/internal/cli/phonenumber/root.go index 1e099a5e..f5ffac25 100644 --- a/internal/cli/phonenumber/root.go +++ b/internal/cli/phonenumber/root.go @@ -11,8 +11,8 @@ import ( func InitPhoneNumberRoot(parent *cobra.Command) error { var PhoneNumberCmd = &cobra.Command{ Use: "phone-number", - Short: "Operations for phone-number", - Long: "Operations for phone-number", + Short: "Manage phone numbers and assign them to projects", + Long: "Manage phone numbers and assign them to projects", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/playbook/playbookpath/root.go b/internal/cli/playbook/playbookpath/root.go index d693b93f..f1b3d42b 100644 --- a/internal/cli/playbook/playbookpath/root.go +++ b/internal/cli/playbook/playbookpath/root.go @@ -11,8 +11,8 @@ import ( func InitPlaybookPathRoot(parent *cobra.Command) error { var PlaybookPathCmd = &cobra.Command{ Use: "path", - Short: "Operations for playbook-path", - Long: "Operations for playbook-path", + Short: "Manage a playbook's exit paths", + Long: "Manage a playbook's exit paths", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/playbook/root.go b/internal/cli/playbook/root.go index 44a633ec..6a4a84ed 100644 --- a/internal/cli/playbook/root.go +++ b/internal/cli/playbook/root.go @@ -12,8 +12,8 @@ import ( func InitPlaybookRoot(parent *cobra.Command) error { var PlaybookCmd = &cobra.Command{ Use: "playbook", - Short: "Operations for playbook", - Long: "Operations for playbook", + Short: "Build playbooks: instructions, tools and exit paths", + Long: "Build playbooks: instructions, tools and exit paths", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/project/root.go b/internal/cli/project/root.go index 816ac354..2c1ec728 100644 --- a/internal/cli/project/root.go +++ b/internal/cli/project/root.go @@ -11,8 +11,8 @@ import ( func InitProjectRoot(parent *cobra.Command) error { var ProjectCmd = &cobra.Command{ Use: "project", - Short: "Operations for project", - Long: "Operations for project", + Short: "Create, list and manage projects", + Long: "Create, list and manage projects", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/prompt/root.go b/internal/cli/prompt/root.go index 91ab63ac..dfa5bc76 100644 --- a/internal/cli/prompt/root.go +++ b/internal/cli/prompt/root.go @@ -11,8 +11,8 @@ import ( func InitPromptRoot(parent *cobra.Command) error { var PromptCmd = &cobra.Command{ Use: "prompt", - Short: "Operations for prompt", - Long: "Operations for prompt", + Short: "Manage reusable prompts and their settings", + Long: "Manage reusable prompts and their settings", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/prompt_help.go b/internal/cli/prompt_help.go new file mode 100644 index 00000000..86c6e6f6 --- /dev/null +++ b/internal/cli/prompt_help.go @@ -0,0 +1,107 @@ +// This file is not generated by Speakeasy. It is the help a command prints +// inside the home prompt (home.go): what the command is for, then its +// commands or its own flags, then one line about the global flags. +// +// Cobra's help ends every page with the global flags: two dozen lines, the +// same on every command, which in the prompt bury the few lines that answer +// the question. Here they are listed only by --help on its own. Outside the +// prompt, and in agent mode inside it, help is Cobra's, unchanged: agents read +// it to learn --output-format, --jq and --dry-run. + +package cli + +import ( + "fmt" + "io" + "strings" + + "github.com/spf13/cobra" + "github.com/spf13/pflag" + "github.com/voiceflow/cli/internal/output" + "github.com/voiceflow/cli/internal/ui" +) + +// setPromptHelp makes every command under root print the prompt's help, +// except in agent mode. +func setPromptHelp(root *cobra.Command, u *ui.UI) { + standard := root.HelpFunc() + root.SetHelpFunc(func(cmd *cobra.Command, args []string) { + if output.IsAgentMode() { + standard(cmd, args) + return + } + writePromptHelp(u, cmd.OutOrStdout(), cmd) + }) +} + +func writePromptHelp(u *ui.UI, w io.Writer, cmd *cobra.Command) { + desc := strings.TrimSpace(cmd.Long) + if desc == "" { + desc = strings.TrimSpace(cmd.Short) + } + if desc != "" { + fmt.Fprintln(w, desc) + } + + if children := helpChildren(cmd); len(children) > 0 { + // A group, or vf itself: its commands, named as the menu names them. + width := 0 + for _, c := range children { + width = max(width, len(c.Name())) + } + fmt.Fprintln(w) + for _, c := range children { + fmt.Fprintf(w, " %s %s\n", u.Accent(fmt.Sprintf("%-*s", width, c.Name())), u.Muted(c.Short)) + } + if !cmd.HasParent() { + // --help on its own is where the global flags are listed. + fmt.Fprintln(w) + fmt.Fprintln(w, groupedFlagUsages(withoutHelp(cmd.LocalFlags()))) + } + path := strings.TrimSpace(strings.TrimPrefix(cmd.CommandPath(), cmd.Root().Name())) + fmt.Fprintln(w) + fmt.Fprintln(w, u.Muted(strings.TrimSpace(path+" --help shows a command's flags"))) + return + } + + // A command: how to run it, its examples, then its own flags, in the same + // sections as Cobra's help. + fmt.Fprintln(w) + fmt.Fprintln(w, "Usage:") + fmt.Fprintln(w, " "+cmd.UseLine()) + if ex := strings.TrimRight(cmd.Example, " \n"); strings.TrimSpace(ex) != "" { + fmt.Fprintln(w) + fmt.Fprintln(w, "Examples:") + fmt.Fprintln(w, ex) + } + if flags := withoutHelp(cmd.LocalFlags()); flags.HasAvailableFlags() { + fmt.Fprintln(w) + fmt.Fprintln(w, groupedFlagUsages(flags)) + } + fmt.Fprintln(w) + fmt.Fprintln(w, u.Muted("Global flags such as --output-format, --jq and --dry-run work here too; --help on its own lists them.")) +} + +// helpChildren are the commands help lists under cmd: those Cobra lists, +// less the shell completion scripts, which mean nothing inside the prompt. +func helpChildren(cmd *cobra.Command) []*cobra.Command { + var out []*cobra.Command + for _, c := range cmd.Commands() { + if c.IsAvailableCommand() && c.Name() != "completion" { + out = append(out, c) + } + } + return out +} + +// withoutHelp is flags less --help, which needs no explaining from inside +// help itself. +func withoutHelp(flags *pflag.FlagSet) *pflag.FlagSet { + out := pflag.NewFlagSet("help", pflag.ContinueOnError) + flags.VisitAll(func(f *pflag.Flag) { + if f.Name != "help" { + out.AddFlag(f) + } + }) + return out +} diff --git a/internal/cli/prompt_help_test.go b/internal/cli/prompt_help_test.go new file mode 100644 index 00000000..a42f7bac --- /dev/null +++ b/internal/cli/prompt_help_test.go @@ -0,0 +1,125 @@ +// This file is not generated by Speakeasy. It covers prompt_help.go. + +package cli + +import ( + "bytes" + "io" + "strings" + "testing" + + "github.com/spf13/cobra" + "github.com/voiceflow/cli/internal/output" + "github.com/voiceflow/cli/internal/ui" +) + +// promptHelp runs `vf --help` with the prompt's help in place, as +// runLine sets it up, and returns what it printed. +func promptHelp(t *testing.T, args ...string) string { + t.Helper() + output.ResetAgentMode() + t.Cleanup(output.ResetAgentMode) + root, err := NewRootCommand() + if err != nil { + t.Fatal(err) + } + setPromptHelp(root, ui.New(io.Discard, ui.Options{Decorate: true})) + var out bytes.Buffer + root.SetOut(&out) + root.SetErr(&out) + root.SetArgs(append(args, "--help")) + if err := root.Execute(); err != nil { + t.Fatal(err) + } + return out.String() +} + +// The section headers Cobra's help gives the global flags. +var globalSections = []string{"Output:", "Authentication:", "Server:", "Network:", "Diagnostics:", "Global Flags:"} + +func TestPromptHelpForAGroupListsItsCommands(t *testing.T) { + got := promptHelp(t, "workflow") + root, _ := NewRootCommand() + workflow, _, _ := root.Find([]string{"workflow"}) + + if !strings.HasPrefix(got, workflow.Short+"\n\n") { + t.Errorf("help should open with what the group is for:\n%s", got) + } + for _, c := range helpChildren(workflow) { + if !strings.Contains(got, " "+c.Name()+" ") || !strings.Contains(got, c.Short) { + t.Errorf("help is missing %q:\n%s", c.Name(), got) + } + } + for _, s := range append(globalSections, "Usage:", "-h, --help") { + if strings.Contains(got, s) { + t.Errorf("group help should leave out %q:\n%s", s, got) + } + } + if !strings.HasSuffix(got, "\nworkflow --help shows a command's flags\n") { + t.Errorf("help should end by saying where the flags are:\n%s", got) + } +} + +func TestPromptHelpForACommandKeepsItsOwnFlags(t *testing.T) { + got := promptHelp(t, "environment", "publish") + for _, s := range []string{"Usage:\n vf environment publish [flags]", "Examples:", "Required Flags:", "--project-id", "Optional Flags:", "--description"} { + if !strings.Contains(got, s) { + t.Errorf("command help is missing %q:\n%s", s, got) + } + } + for _, s := range append(globalSections, "--jq string", "-h, --help") { + if strings.Contains(got, s) { + t.Errorf("command help should leave out %q:\n%s", s, got) + } + } + if !strings.HasSuffix(got, "--help on its own lists them.\n") { + t.Errorf("help should end by pointing at the global flags:\n%s", got) + } +} + +// --help on its own is where the global flags are listed. +func TestPromptHelpForVfListsTheGlobalFlags(t *testing.T) { + got := promptHelp(t) + for _, s := range []string{" workflow ", " project ", "Output:", "--output-format", "--dry-run"} { + if !strings.Contains(got, s) { + t.Errorf("vf --help is missing %q:\n%s", s, got) + } + } + if strings.Contains(got, " completion ") { + t.Errorf("shell completion means nothing inside the prompt:\n%s", got) + } +} + +// Outside the prompt, and in agent mode inside it, help is Cobra's, global +// flags and all: agents read it to learn them. +func TestHelpOutsideThePromptIsUnchanged(t *testing.T) { + output.ResetAgentMode() + t.Cleanup(output.ResetAgentMode) + help := func(root *cobra.Command, path ...string) string { + cmd, _, err := root.Find(path) + if err != nil { + t.Fatal(err) + } + var out bytes.Buffer + cmd.SetOut(&out) + root.HelpFunc()(cmd, nil) + return out.String() + } + + root, err := NewRootCommand() + if err != nil { + t.Fatal(err) + } + if got := help(root, "environment", "publish"); !strings.Contains(got, "Output:") || !strings.Contains(got, "--jq string") { + t.Errorf("help outside the prompt lost the global flags:\n%s", got) + } + + setPromptHelp(root, ui.New(io.Discard, ui.Options{Decorate: true})) + if err := root.ParseFlags([]string{"--agent-mode"}); err != nil { + t.Fatal(err) + } + output.InitAgentMode(root) + if got := help(root, "environment", "publish"); !strings.Contains(got, "Output:") || !strings.Contains(got, "--jq string") { + t.Errorf("agent mode inside the prompt should get Cobra's help:\n%s", got) + } +} diff --git a/internal/cli/root.go b/internal/cli/root.go index 3de85d21..6f2dfef2 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -5,7 +5,6 @@ package cli import ( "fmt" - "os" "strings" "github.com/spf13/cobra" @@ -43,7 +42,6 @@ import ( "github.com/voiceflow/cli/internal/explorer" "github.com/voiceflow/cli/internal/output" "github.com/voiceflow/cli/internal/usage" - "golang.org/x/term" ) var rootCmd *cobra.Command @@ -55,15 +53,15 @@ func NewRootCommand() (*cobra.Command, error) { cobra.AddTemplateFunc("groupedGlobalFlagUsages", groupedGlobalFlagUsages) rootCmd := &cobra.Command{ Use: "vf", - Short: "Realtime: Realtime gateway API service", - Long: "Realtime: Realtime gateway API service", + Short: "Build, test, and operate Voiceflow AI agents from your terminal", + Long: "vf is the Voiceflow CLI. Build, test, and operate AI agents on Voiceflow from your terminal, your CI, or your coding agent.", SilenceUsage: true, SilenceErrors: true, RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) } - return cmd.Help() + return runHome(cmd) // the home banner at a terminal, help elsewhere; see home.go }, PersistentPreRunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { @@ -203,7 +201,7 @@ func NewRootCommand() (*cobra.Command, error) { // Request timeout (always available) rootCmd.PersistentFlags().String("timeout", "", "HTTP request timeout (e.g., 30s, 5m, 100ms)") // Interactive mode control - rootCmd.PersistentFlags().Bool("no-interactive", false, "Disable all interactive features (auto-prompting, explorer auto-launch, TUI forms)") + rootCmd.PersistentFlags().Bool("no-interactive", false, "Disable all interactive features (auto-prompting, the home prompt, TUI forms)") // Diagnostics flags rootCmd.PersistentFlags().Bool("usage", false, "Print the CLI Usage schema in KDL format") @@ -253,34 +251,16 @@ func Execute() error { return err } - // Early agent mode detection from env vars (flag parsing hasn't happened yet). - // This prevents the explorer TUI from launching when an AI agent is driving the CLI. + // Early agent mode detection from env vars (flag parsing hasn't happened yet), + // so an error from parsing the flags themselves is already in agent form. output.InitAgentMode(rootCmd) - // Auto-launch explorer when invoked with no subcommand from a TTY - if shouldAutoExplore() { - return runExplorer(rootCmd) - } - + // Bare `vf` no longer opens the explorer: the root command prints the home + // banner and opens the home prompt instead (home.go), and the explorer is + // `vf explore`. return renderFlagValueError(rootCmd, rootCmd.Execute()) // see flagerrors.go } -// shouldAutoExplore returns true when the CLI is invoked with no subcommand -// from an interactive terminal and agent mode is not active. -func shouldAutoExplore() bool { - if len(os.Args) > 1 { - return false - } - if !term.IsTerminal(int(os.Stdin.Fd())) || !term.IsTerminal(int(os.Stdout.Fd())) { - return false - } - // Agent mode: agents run in PTY terminals but should never get a TUI. - if output.IsAgentMode() { - return false - } - return true -} - // initExploreCmd registers the "explore" subcommand. func initExploreCmd(parent *cobra.Command) { parent.AddCommand(&cobra.Command{ diff --git a/internal/cli/secret/root.go b/internal/cli/secret/root.go index 592cbb2e..86509751 100644 --- a/internal/cli/secret/root.go +++ b/internal/cli/secret/root.go @@ -11,8 +11,8 @@ import ( func InitSecretRoot(parent *cobra.Command) error { var SecretCmd = &cobra.Command{ Use: "secret", - Short: "Operations for secret", - Long: "Operations for secret", + Short: "Manage secrets and their values", + Long: "Manage secrets and their values", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/test/check/root.go b/internal/cli/test/check/root.go index 0c75260b..1fd63c89 100644 --- a/internal/cli/test/check/root.go +++ b/internal/cli/test/check/root.go @@ -11,8 +11,8 @@ import ( func InitCheckRoot(parent *cobra.Command) error { var CheckCmd = &cobra.Command{ Use: "check", - Short: "Operations for check", - Long: "Operations for check", + Short: "Manage the checks a test makes", + Long: "Manage the checks a test makes", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/test/root.go b/internal/cli/test/root.go index a3a94047..479714fa 100644 --- a/internal/cli/test/root.go +++ b/internal/cli/test/root.go @@ -15,8 +15,8 @@ import ( func InitTestRoot(parent *cobra.Command) error { var TestCmd = &cobra.Command{ Use: "test", - Short: "Operations for test", - Long: "Operations for test", + Short: "Build and run agent tests", + Long: "Build and run agent tests", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/test/run/root.go b/internal/cli/test/run/root.go index c9c66711..36bea561 100644 --- a/internal/cli/test/run/root.go +++ b/internal/cli/test/run/root.go @@ -11,8 +11,8 @@ import ( func InitRunRoot(parent *cobra.Command) error { var RunCmd = &cobra.Command{ Use: "run", - Short: "Operations for run", - Long: "Operations for run", + Short: "Run tests, wait for results and read their logs", + Long: "Run tests, wait for results and read their logs", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/test/testfolder/root.go b/internal/cli/test/testfolder/root.go index 81c44396..21ac20a7 100644 --- a/internal/cli/test/testfolder/root.go +++ b/internal/cli/test/testfolder/root.go @@ -11,8 +11,8 @@ import ( func InitTestFolderRoot(parent *cobra.Command) error { var TestFolderCmd = &cobra.Command{ Use: "folder", - Short: "Operations for test-folder", - Long: "Operations for test-folder", + Short: "List the folders tests are kept in", + Long: "List the folders tests are kept in", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/test/turn/root.go b/internal/cli/test/turn/root.go index 5039a81c..deb89f53 100644 --- a/internal/cli/test/turn/root.go +++ b/internal/cli/test/turn/root.go @@ -11,8 +11,8 @@ import ( func InitTurnRoot(parent *cobra.Command) error { var TurnCmd = &cobra.Command{ Use: "turn", - Short: "Operations for turn", - Long: "Operations for turn", + Short: "Manage the turns of a test conversation", + Long: "Manage the turns of a test conversation", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/tool/root.go b/internal/cli/tool/root.go index c0bce752..e57cd8d2 100644 --- a/internal/cli/tool/root.go +++ b/internal/cli/tool/root.go @@ -11,8 +11,8 @@ import ( func InitToolRoot(parent *cobra.Command) error { var ToolCmd = &cobra.Command{ Use: "tool", - Short: "Operations for tool", - Long: "Operations for tool", + Short: "Manage the tools an agent and its playbooks use", + Long: "Manage the tools an agent and its playbooks use", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/transcript/property/root.go b/internal/cli/transcript/property/root.go index e42b0ee3..b732d75a 100644 --- a/internal/cli/transcript/property/root.go +++ b/internal/cli/transcript/property/root.go @@ -11,8 +11,8 @@ import ( func InitPropertyRoot(parent *cobra.Command) error { var PropertyCmd = &cobra.Command{ Use: "property", - Short: "Operations for property", - Long: "Operations for property", + Short: "Manage the properties that tag transcripts", + Long: "Manage the properties that tag transcripts", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/transcript/root.go b/internal/cli/transcript/root.go index 19f3db23..c764ff65 100644 --- a/internal/cli/transcript/root.go +++ b/internal/cli/transcript/root.go @@ -12,8 +12,8 @@ import ( func InitTranscriptRoot(parent *cobra.Command) error { var TranscriptCmd = &cobra.Command{ Use: "transcript", - Short: "Operations for transcript", - Long: "Operations for transcript", + Short: "Search and read conversation transcripts", + Long: "Search and read conversation transcripts", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/variable/root.go b/internal/cli/variable/root.go index a0ddb639..af317842 100644 --- a/internal/cli/variable/root.go +++ b/internal/cli/variable/root.go @@ -11,8 +11,8 @@ import ( func InitVariableRoot(parent *cobra.Command) error { var VariableCmd = &cobra.Command{ Use: "variable", - Short: "Operations for variable", - Long: "Operations for variable", + Short: "Manage the variables an agent reads and sets", + Long: "Manage the variables an agent reads and sets", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/whoami.go b/internal/cli/whoami.go index 75fd0428..5258b24f 100644 --- a/internal/cli/whoami.go +++ b/internal/cli/whoami.go @@ -8,6 +8,7 @@ import ( "github.com/spf13/cobra" "github.com/voiceflow/cli/internal/config" "github.com/voiceflow/cli/internal/oauth" + "github.com/voiceflow/cli/internal/output" "github.com/voiceflow/cli/internal/usage" ) @@ -38,6 +39,12 @@ func runWhoamiCmd(cmd *cobra.Command, args []string) error { return usage.EmitSchema(cmd, cmd.OutOrStdout()) } out := cmd.OutOrStdout() + // At a terminal: the styled view in auth_present.go. Elsewhere the plain + // text below, unchanged, which scripts and tests read. + if u := output.UI(cmd, out); u.Decorated() { + writeWhoami(cmd, u, out) + return nil + } fmt.Fprintln(out, "Configuration") fmt.Fprintln(out, "=============") fmt.Fprintln(out) diff --git a/internal/cli/widget/root.go b/internal/cli/widget/root.go index 0473a81b..f4f1c699 100644 --- a/internal/cli/widget/root.go +++ b/internal/cli/widget/root.go @@ -11,8 +11,8 @@ import ( func InitWidgetRoot(parent *cobra.Command) error { var WidgetCmd = &cobra.Command{ Use: "widget", - Short: "Operations for widget", - Long: "Operations for widget", + Short: "Configure the web chat widget and get its snippet", + Long: "Configure the web chat widget and get its snippet", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/workflow/addactions.go b/internal/cli/workflow/addactions.go index 7a6a6a3f..518c1a70 100644 --- a/internal/cli/workflow/addactions.go +++ b/internal/cli/workflow/addactions.go @@ -23,6 +23,7 @@ var addActionsCmdMeta = []flagutil.FlagMeta{ {FlagName: "environment-alias", FieldPath: "EnvironmentAlias", Kind: flagutil.FlagKindString, Required: true, Description: "[required]"}, {FlagName: "actions", FieldPath: "Body.Actions", Kind: flagutil.FlagKindJSON, Required: true, Annotations: `json:"actions"`, Description: "1 to 10 actions to add, in run order. [required]"}, {FlagName: "after-action-id", FieldPath: "Body.AfterActionID", Kind: flagutil.FlagKindString, Optional: true, Description: "Add them after this action. Leave out afterActionID and atStart to add them at the end, before an action that ends the path."}, + {FlagName: "at-start", FieldPath: "Body.AtStart", Kind: flagutil.FlagKindBool, Optional: true, Description: "Add them before every other action on this exit."}, {FlagName: "expected-actions", FieldPath: "Body.ExpectedActions", Kind: flagutil.FlagKindStringArray, Required: true, Description: "The IDs in this exit's actions from your last read, in order. Send [] when it has none. [required]"}, {FlagName: "to", Shorthand: "t", FieldPath: "Body.To", Kind: flagutil.FlagKindJSON, Optional: true, Annotations: `json:"to,omitempty"`, Description: "The block the path goes to after the actions. Leave it out to keep the current one. Send null to clear it."}, } diff --git a/internal/cli/workflow/insertstep.go b/internal/cli/workflow/insertstep.go index f55465c2..1102e91b 100644 --- a/internal/cli/workflow/insertstep.go +++ b/internal/cli/workflow/insertstep.go @@ -21,6 +21,7 @@ var insertStepCmdMeta = []flagutil.FlagMeta{ {FlagName: "project-id", Shorthand: "p", FieldPath: "ProjectID", Kind: flagutil.FlagKindString, Required: true, Description: "[required]"}, {FlagName: "environment-alias", FieldPath: "EnvironmentAlias", Kind: flagutil.FlagKindString, Required: true, Description: "[required]"}, {FlagName: "after-step-id", FieldPath: "Body.AfterStepID", Kind: flagutil.FlagKindString, Optional: true, Description: "Insert right after this step of the block. Send this or atStart."}, + {FlagName: "at-start", FieldPath: "Body.AtStart", Kind: flagutil.FlagKindBool, Optional: true, Description: "Insert as the first step of the block. Send this or afterStepID."}, {FlagName: "step", Shorthand: "s", FieldPath: "Body.Step", Kind: flagutil.FlagKindUnion, Union: &flagutil.UnionMeta{Discriminated: true, DiscriminatorKey: "Kind", TypeDescription: "JSON value (variants: message: { kind: string, key: string, content: value, links: object }, end: { kind: string, key: string, content: object, links: object }, set: { kind: string, key: string, content: object, links: object }, workflow: { kind: string, key: string, content: object, links: object }, listen: { kind: string, key: string, content: object, links: object }, condition: { kind: string, key: string, content: object, links: object }, buttons: { kind: string, key: string, content: object, links: object }, card: { kind: string, key: string, content: object, links: object }, carousel: { kind: string, key: string, content: object, links: object }, code: { kind: string, key: string, content: object, links: object }, api: { kind: string, key: string, content: object, links: object }, function: { kind: string, key: string, content: object, links: object }, integration: { kind: string, key: string, content: object, links: object }, mcp: { kind: string, key: string, content: object, links: object }, playbook: { kind: string, key: string, content: object, links: object }, operator: { kind: string, key: string, content: object, links: object }, crew: { kind: string, key: string, content: object, links: object }, handoff: { kind: string, key: string, content: object, links: object }, callForward: { kind: string, key: string, content: object, links: object })", Variants: []flagutil.UnionVariantMeta{ {DiscriminatorValue: "message", FlagName: "step.message", FieldName: "StableWorkflowStepInputMessage", CanExpand: false, Description: "StableWorkflowStepInput_Message variant as JSON"}, {DiscriminatorValue: "end", FlagName: "step.end", FieldName: "StableWorkflowStepInputEnd", CanExpand: false, Description: "StableWorkflowStepInput_End variant as JSON"}, diff --git a/internal/cli/workflow/optional_literal_flags_test.go b/internal/cli/workflow/optional_literal_flags_test.go new file mode 100644 index 00000000..b7dc8dac --- /dev/null +++ b/internal/cli/workflow/optional_literal_flags_test.go @@ -0,0 +1,124 @@ +// This file is not generated by Speakeasy. It pins the fix in +// .speakeasy/overlays/optional-literal-flags.yaml: atStart is sent only when +// --at-start is given. + +package workflow + +import ( + "encoding/json" + "strings" + "testing" + + "github.com/spf13/cobra" + "github.com/voiceflow/cli/internal/flagutil" + "github.com/voiceflow/cli/internal/sdk/models/operations" +) + +// subcommand registers one workflow subcommand on a fresh parent and returns +// it with its flags parsed from args. +func subcommand(t *testing.T, register func(*cobra.Command) error, name string, args ...string) *cobra.Command { + t.Helper() + parent := &cobra.Command{Use: "workflow"} + if err := register(parent); err != nil { + t.Fatal(err) + } + cmd, _, err := parent.Find([]string{name}) + if err != nil { + t.Fatal(err) + } + cmd.SetIn(strings.NewReader("")) + if err := cmd.ParseFlags(args); err != nil { + t.Fatal(err) + } + return cmd +} + +func bodyJSON(t *testing.T, body any) map[string]any { + t.Helper() + raw, err := json.Marshal(body) + if err != nil { + t.Fatal(err) + } + var m map[string]any + if err := json.Unmarshal(raw, &m); err != nil { + t.Fatal(err) + } + return m +} + +var insertStepArgs = []string{ + "--workflow-id", "w", "--block-id", "b", "--project-id", "p", "--environment-alias", "main", + "--expected-steps", "step_1", "--step.end", `{}`, +} + +func insertStepBody(t *testing.T, args ...string) map[string]any { + t.Helper() + cmd := subcommand(t, initInsertStepCmd, "insert-step", append(append([]string{}, insertStepArgs...), args...)...) + req, err := flagutil.BuildRequest[operations.StableWorkflowControllerInsertStepRequest](cmd, insertStepCmdMeta, "Body", "body") + if err != nil { + t.Fatal(err) + } + return bodyJSON(t, req.Body) +} + +// The server rejects a body with both afterStepID and atStart. Before the fix +// the CLI sent atStart: true on every insert, so inserting after a step always +// failed. +func TestInsertStepAfterAStepSendsNoAtStart(t *testing.T) { + body := insertStepBody(t, "--after-step-id", "step_1") + if body["afterStepID"] != "step_1" { + t.Errorf("afterStepID = %v, want step_1", body["afterStepID"]) + } + if v, sent := body["atStart"]; sent { + t.Errorf("atStart = %v was sent alongside afterStepID; the API accepts exactly one", v) + } +} + +func TestInsertStepAtStartSendsAtStart(t *testing.T) { + body := insertStepBody(t, "--at-start") + if body["atStart"] != true { + t.Errorf("atStart = %v, want true", body["atStart"]) + } + if v, sent := body["afterStepID"]; sent { + t.Errorf("afterStepID = %v, want it left out", v) + } +} + +var addActionsArgs = []string{ + "--workflow-id", "w", "--step-id", "s", "--port-key", "next", "--project-id", "p", "--environment-alias", "main", + "--actions", `[{"kind":"end"}]`, "--expected-actions", "a1", +} + +func addActionsBody(t *testing.T, args ...string) map[string]any { + t.Helper() + cmd := subcommand(t, initAddActionsCmd, "add-actions", append(append([]string{}, addActionsArgs...), args...)...) + req, err := flagutil.BuildRequest[operations.StableWorkflowControllerAddActionsRequest](cmd, addActionsCmdMeta, "Body", "body") + if err != nil { + t.Fatal(err) + } + return bodyJSON(t, req.Body) +} + +// Leaving out both afterActionID and atStart adds the actions at the end. That +// was unreachable while atStart: true went out on every call. +func TestAddActionsWithNeitherFlagAddsAtTheEnd(t *testing.T) { + body := addActionsBody(t) + for _, key := range []string{"atStart", "afterActionID"} { + if v, sent := body[key]; sent { + t.Errorf("%s = %v was sent; leave both out to add at the end", key, v) + } + } +} + +func TestAddActionsAfterAnActionSendsNoAtStart(t *testing.T) { + body := addActionsBody(t, "--after-action-id", "a1") + if v, sent := body["atStart"]; sent { + t.Errorf("atStart = %v was sent alongside afterActionID", v) + } +} + +func TestAddActionsAtStartSendsAtStart(t *testing.T) { + if body := addActionsBody(t, "--at-start"); body["atStart"] != true { + t.Errorf("atStart = %v, want true", body["atStart"]) + } +} diff --git a/internal/cli/workflow/root.go b/internal/cli/workflow/root.go index 8892c82a..455f416d 100644 --- a/internal/cli/workflow/root.go +++ b/internal/cli/workflow/root.go @@ -11,8 +11,8 @@ import ( func InitWorkflowRoot(parent *cobra.Command) error { var WorkflowCmd = &cobra.Command{ Use: "workflow", - Short: "Operations for workflow", - Long: "Operations for workflow", + Short: "Build workflows: blocks, steps, branches and links", + Long: "Build workflows: blocks, steps, branches and links", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/cli/workspace/root.go b/internal/cli/workspace/root.go index 68eae054..e09d394a 100644 --- a/internal/cli/workspace/root.go +++ b/internal/cli/workspace/root.go @@ -11,8 +11,8 @@ import ( func InitWorkspaceRoot(parent *cobra.Command) error { var WorkspaceCmd = &cobra.Command{ Use: "workspace", - Short: "Operations for workspace", - Long: "Operations for workspace", + Short: "Create, list and manage workspaces", + Long: "Create, list and manage workspaces", RunE: func(cmd *cobra.Command, args []string) error { if usage.UsageRequested(cmd) { return usage.EmitSchema(cmd, cmd.OutOrStdout()) diff --git a/internal/client/client.go b/internal/client/client.go index 6f270a0c..8675b5e8 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -53,6 +53,7 @@ func NewClient(cmd *cobra.Command) (*sdk.VoiceflowSDK, error) { if testClient := testclient.NewTestHTTPClient(); testClient != nil { httpClient = testClient } + httpClient = WrapClientForSpinner(cmd, httpClient) // spinner.go: ✻ while a request is in flight httpClient = WrapClientForDiagnostics(cmd, httpClient) sdkOpts = append(sdkOpts, sdk.WithClient(httpClient)) return sdk.New(sdkOpts...), nil diff --git a/internal/client/spinner.go b/internal/client/spinner.go new file mode 100644 index 00000000..f87ca048 --- /dev/null +++ b/internal/client/spinner.go @@ -0,0 +1,75 @@ +// This file is not generated by Speakeasy. client.go wraps every API request +// in it, so a person at a terminal sees what vf is waiting for. + +package client + +import ( + "io" + "net/http" + "time" + + "github.com/spf13/cobra" + "github.com/voiceflow/cli/internal/output" + "github.com/voiceflow/cli/internal/ui" +) + +// spinnerDelay is how long a request runs before the spinner appears. Most +// take less, and motion that flashes for one frame is noise. DESIGN.md asks +// for a spinner on anything that can take longer than about 300 ms. +const spinnerDelay = 300 * time.Millisecond + +// WrapClientForSpinner shows the Working spinner on stderr while a request is +// in flight, once it has run for spinnerDelay: +// +// ✻ List projects… 2s · ctrl-c to cancel +// +// It erases its line when the response arrives, before anything is printed. +// Only at a terminal: never in a pipe, in agent mode or with TERM=dumb, and +// not with --debug or --dry-run, which write their own lines to stderr. +func WrapClientForSpinner(cmd *cobra.Command, inner HTTPClient) HTTPClient { + if IsDebug(cmd) || IsDryRun(cmd) { + return inner + } + w := cmd.ErrOrStderr() + u := output.UI(cmd, w) + if !u.Decorated() { + return inner + } + return &spinnerClient{inner: inner, u: u, w: w, msg: spinnerMessage(cmd), delay: spinnerDelay} +} + +// StartSpinner shows the spinner for a wait outside the SDK, such as vf +// docs's own requests, under the same rules as WrapClientForSpinner. Call +// stop when the wait is over. +func StartSpinner(cmd *cobra.Command, msg string) (stop func()) { + if IsDebug(cmd) || IsDryRun(cmd) { + return func() {} + } + w := cmd.ErrOrStderr() + return output.UI(cmd, w).SpinAfter(w, spinnerDelay, msg, "ctrl-c to cancel").Stop +} + +// spinnerMessage is what the command does, as its help says it ("List +// projects"), so the line reads like Claude Code's "Reading file…". +func spinnerMessage(cmd *cobra.Command) string { + if cmd.Short != "" { + return cmd.Short + "…" + } + return "Waiting for Voiceflow…" +} + +type spinnerClient struct { + inner HTTPClient + u *ui.UI + w io.Writer + msg string + delay time.Duration +} + +// Do runs the request under a spinner. The spinner stops when the response +// headers arrive, so a streamed body is never drawn over. +func (c *spinnerClient) Do(req *http.Request) (*http.Response, error) { + s := c.u.SpinAfter(c.w, c.delay, c.msg, "ctrl-c to cancel") + defer s.Stop() + return c.inner.Do(req) +} diff --git a/internal/client/spinner_test.go b/internal/client/spinner_test.go new file mode 100644 index 00000000..1a4e93c4 --- /dev/null +++ b/internal/client/spinner_test.go @@ -0,0 +1,78 @@ +// This file is not generated by Speakeasy. It covers spinner.go. + +package client + +import ( + "bytes" + "net/http" + "strings" + "testing" + "time" + + "github.com/spf13/cobra" + "github.com/voiceflow/cli/internal/ui" +) + +// slowClient answers after a pause. +type slowClient struct{ pause time.Duration } + +func (c *slowClient) Do(*http.Request) (*http.Response, error) { + time.Sleep(c.pause) + return &http.Response{StatusCode: http.StatusOK, Body: http.NoBody}, nil +} + +func spinning(pause, delay time.Duration) string { + var out bytes.Buffer + c := &spinnerClient{ + inner: &slowClient{pause: pause}, + u: ui.New(&out, ui.Options{Decorate: true}), + w: &out, + msg: "List projects…", + delay: delay, + } + req, _ := http.NewRequest(http.MethodGet, "https://api.example/v1/projects", nil) + if _, err := c.Do(req); err != nil { + panic(err) + } + return out.String() +} + +func TestASlowRequestShowsTheSpinnerThenErasesIt(t *testing.T) { + got := spinning(250*time.Millisecond, 10*time.Millisecond) + for _, want := range []string{"List projects…", "ctrl-c to cancel"} { + if !strings.Contains(got, want) { + t.Errorf("the spinner should say %q, got %q", want, got) + } + } + if !strings.HasSuffix(got, "\r\x1b[2K") { + t.Errorf("the spinner should erase its line before the result prints, got %q", got) + } +} + +func TestAQuickRequestLeavesNoTrace(t *testing.T) { + if got := spinning(0, time.Second); got != "" { + t.Errorf("a request faster than the delay should draw nothing, got %q", got) + } +} + +// In a pipe, as in agent mode, nothing wraps the client. +func TestNoSpinnerOffATerminal(t *testing.T) { + cmd := &cobra.Command{Use: "list", Short: "List projects"} + cmd.Flags().Bool("debug", false, "") + cmd.Flags().Bool("dry-run", false, "") + cmd.Flags().String("color", "auto", "") + cmd.SetErr(&bytes.Buffer{}) + inner := &slowClient{} + if got := WrapClientForSpinner(cmd, inner); got != HTTPClient(inner) { + t.Errorf("off a terminal the client should be left alone, got %T", got) + } +} + +func TestSpinnerMessageIsWhatTheCommandDoes(t *testing.T) { + if got := spinnerMessage(&cobra.Command{Short: "Publish environment"}); got != "Publish environment…" { + t.Errorf("got %q", got) + } + if got := spinnerMessage(&cobra.Command{}); got != "Waiting for Voiceflow…" { + t.Errorf("got %q", got) + } +} diff --git a/internal/explorer/styles.go b/internal/explorer/styles.go index 64ce4b84..eabb64ed 100644 --- a/internal/explorer/styles.go +++ b/internal/explorer/styles.go @@ -9,7 +9,7 @@ import ( ) var ( - accentColor = lipgloss.Color("#38BDF8") + accentColor = lipgloss.Color("#397DFF") dimmedColor = lipgloss.Color("#64748B") subtleColor = lipgloss.Color("#475569") diff --git a/internal/interactive/interactive.go b/internal/interactive/interactive.go index e36f37ff..14ec77c7 100644 --- a/internal/interactive/interactive.go +++ b/internal/interactive/interactive.go @@ -102,7 +102,7 @@ func formWidth() int { func formTheme() *huh.Theme { t := *huh.ThemeBase() - accent := lipgloss.Color("#38BDF8") + accent := lipgloss.Color("#397DFF") dimmed := lipgloss.Color("#64748B") subtle := lipgloss.Color("#475569") errColor := lipgloss.Color("#F87171") @@ -158,7 +158,7 @@ type fieldInfo struct { // printCommandHeader prints the command documentation header to the terminal // before the form starts. This avoids huh.Note rendering issues. func printCommandHeader(cmd *cobra.Command, totalRequired, totalOptional int) { - accent := lipgloss.Color("#38BDF8") + accent := lipgloss.Color("#397DFF") dimmed := lipgloss.Color("#64748B") titleStyle := lipgloss.NewStyle().Foreground(accent).Bold(true) diff --git a/internal/oauth/command.go b/internal/oauth/command.go index 1492da73..0ffe9e62 100644 --- a/internal/oauth/command.go +++ b/internal/oauth/command.go @@ -91,6 +91,12 @@ func runBrowserLogin(cmd *cobra.Command, signup bool) error { out := cmd.OutOrStderr() + // A person at a terminal gets status lines and a spinner; see present.go. + // Everywhere else the plain text below is unchanged. + if u := output.UI(cmd, out); u.Decorated() { + return runStyledLogin(cmd, signup, u, out) + } + opts := loginOptionsFromFlags(cmd, signup) opts.Out = out // Login drops prompt=create when the server does not support it, so the diff --git a/internal/oauth/oauth.go b/internal/oauth/oauth.go index cd846fcf..6536fc20 100644 --- a/internal/oauth/oauth.go +++ b/internal/oauth/oauth.go @@ -187,6 +187,20 @@ type LoginOptions struct { // observeAuthURL, when set, sees the authorization URL without replacing // the prose on Out, unlike OnAuthURL. observeAuthURL func(authURL string) + + // present, when set, replaces the prose that announces the authorization + // URL and the wait, for a caller that draws its own: the styled terminal + // output in present.go. Unlike OnAuthURL it learns whether the browser + // opened. OnAuthURL wins when both are set. + present func(authPrompt) +} + +// authPrompt is what Login knows when it hands the user the authorization URL. +type authPrompt struct { + URL string + Signup bool // prompt=create was sent, so the browser shows signup + NoBrowser bool + BrowserErr error // why the browser did not open, when it was asked to } // ErrStoreSession reports that authorization completed but the resulting @@ -270,9 +284,12 @@ func Login(ctx context.Context, getenv func(string) string, opts LoginOptions) ( browserErr = browserOpener(authURL) } - if opts.OnAuthURL != nil { + switch { + case opts.OnAuthURL != nil: opts.OnAuthURL(authURL) - } else { + case opts.present != nil: + opts.present(authPrompt{URL: authURL, Signup: prompt == PromptCreate, NoBrowser: opts.NoBrowser, BrowserErr: browserErr}) + default: action, wait := "sign in", "Waiting for the browser to complete sign-in..." if prompt == PromptCreate { action, wait = "create your account", "Waiting for the browser to complete signup..." @@ -574,6 +591,7 @@ type Status struct { Storage string Expiry time.Time Expired bool + Renews bool // a refresh token is stored, so the session renews itself } // CurrentStatus reports the stored session without refreshing it. @@ -590,5 +608,6 @@ func CurrentStatus() Status { Storage: session.storageLocation(), Expiry: session.Expiry, Expired: session.expired(time.Now()), + Renews: session.RefreshToken != "", } } diff --git a/internal/oauth/present.go b/internal/oauth/present.go new file mode 100644 index 00000000..d4eb40ac --- /dev/null +++ b/internal/oauth/present.go @@ -0,0 +1,199 @@ +// This file is not generated by Speakeasy. It is how 'vf auth login' and +// 'vf auth signup' look to a person at a terminal: status lines and a spinner +// from internal/ui, per internal/ui/DESIGN.md. Off a terminal the plain text +// in command.go and Login is printed instead, byte for byte as before, and +// agent mode has its own JSON events (agent.go). + +package oauth + +import ( + "context" + "errors" + "fmt" + "io" + "os" + "os/signal" + "strings" + "time" + + "github.com/spf13/cobra" + "github.com/voiceflow/cli/internal/config" + "github.com/voiceflow/cli/internal/output" + "github.com/voiceflow/cli/internal/ui" +) + +// loginWorkspaceWait bounds the one workspace lookup after a sign-in, which +// only decorates the result: if it is slow or fails, the line is left out. +var loginWorkspaceWait = 5 * time.Second + +// signupTips are the commands suggested once an account exists. The plain +// output's signupNextSteps are built from the same list. +var signupTips = []ui.Tip{ + {Command: "vf workspace list", Does: "List your workspaces"}, + {Command: "vf auth whoami", Does: "Show the stored session"}, + {Command: "vf docs --help", Does: "Search the Voiceflow documentation from the terminal"}, + {Command: "vf explore", Does: "Browse and run every command interactively"}, +} + +func runStyledLogin(cmd *cobra.Command, signup bool, u *ui.UI, out io.Writer) error { + opts := loginOptionsFromFlags(cmd, signup) + opts.Out = out + // Login drops prompt=create when the server does not support it, so the + // URL records whether this really was a signup. + signupRequested := false + opts.observeAuthURL = func(authURL string) { signupRequested = isSignupURL(authURL) } + + // Ctrl-C cancels the login rather than killing the process mid-line, so + // the spinner is erased and the cancellation is said once. + ctx, stopSignals := signal.NotifyContext(cmd.Context(), os.Interrupt) + defer stopSignals() + + var spin *ui.Spinner + opts.present = func(p authPrompt) { + writeAuthPrompt(u, out, p) + wait := "Waiting for you to sign in in your browser…" + if p.Signup { + wait = "Waiting for you to create your account in your browser…" + } + spin = u.Spin(out, wait, "ctrl-c to cancel") + } + + session, err := Login(ctx, os.Getenv, opts) + if spin != nil { + spin.Stop() + } + if err != nil { + retry := "vf auth login" + if signup { + retry = "vf auth signup" + } + // Ctrl-C cancels ctx, here or in the home prompt (which cancels the + // command's context); a deadline on the parent is not a cancellation. + return reportLoginError(u, out, err, errors.Is(ctx.Err(), context.Canceled), retry) + } + + var workspaces []Workspace + var listErr error + if workspaceLister != nil { + if signupRequested { + // A new account's first workspace is created asynchronously. + spin = u.Spin(out, "Setting up your first workspace…", "") + workspaces, listErr = waitForWorkspaces(ctx, cmd, session.AccessToken) + } else { + spin = u.Spin(out, "Loading your workspaces…", "") + wctx, cancel := context.WithTimeout(ctx, loginWorkspaceWait) + workspaces, listErr = workspaceLister(wctx, cmd, session.AccessToken) + cancel() + } + spin.Stop() + } + + writeSignedIn(u, out, session, signupRequested, workspaces, listErr, time.Now()) + return nil +} + +// writeAuthPrompt announces the authorization URL. The URL gets a line of its +// own, unindented, so a terminal that wraps it still copies and opens it +// whole. +func writeAuthPrompt(u *ui.UI, out io.Writer, p authPrompt) { + action := "sign in" + if p.Signup { + action = "create your account" + } + switch { + case p.NoBrowser: + fmt.Fprintln(out, u.Status(ui.StatusInfo, "Open this URL to "+action+":")) + case p.BrowserErr != nil: + fmt.Fprintln(out, u.Status(ui.StatusWarn, "Couldn't open a browser")) + fmt.Fprintln(out, u.Under(u.Muted(p.BrowserErr.Error()), "Open this URL to "+action+":")) + default: + fmt.Fprintln(out, u.Status(ui.StatusInfo, "Opening your browser to "+action)) + fmt.Fprintln(out, u.Under(u.Muted("Didn't open? Use this URL:"))) + } + fmt.Fprintf(out, "\n%s\n\n", p.URL) +} + +// reportLoginError says why the login ended, once, and returns the error +// marked as reported so main does not print it again. +func reportLoginError(u *ui.UI, out io.Writer, err error, interrupted bool, retry string) error { + if interrupted { + fmt.Fprintln(out, u.Status(ui.StatusFailed, "Sign-in canceled")) + return output.AlreadyReported(err) + } + fmt.Fprintln(out, u.Status(ui.StatusFailed, "Couldn't sign in")) + fmt.Fprintln(out, u.Under(err.Error(), "Try again: "+u.Accent(retry))) + return output.AlreadyReported(err) +} + +// writeSignedIn reports a finished login or signup: who and where, then only +// what needs attention. Scopes and storage details are in 'vf auth whoami'. +func writeSignedIn(u *ui.UI, out io.Writer, s *Session, signup bool, workspaces []Workspace, listErr error, now time.Time) { + title := "Signed in" + if signup { + title = "Account created and signed in" + // accountFromToken falls back to "user ", which says nothing to + // the person who just signed up. + if account := accountFromToken(s.AccessToken); account != "" && !strings.HasPrefix(account, "user ") { + title += " as " + account + } + } + if s.Issuer != "" && s.Issuer != DefaultIssuer { + title += " to " + s.Issuer // a staging or self-hosted server + } + fmt.Fprintln(out, u.Status(ui.StatusDone, title)) + + var details []string + switch { + case len(workspaces) > 0: + details = append(details, workspaceSummary(u, workspaces)) + case signup && listErr != nil: + details = append(details, "Couldn't list your workspaces yet. Try "+u.Accent("vf workspace list")+" in a minute.") + case signup && workspaceLister != nil: + details = append(details, "Your first workspace is still being set up. Try "+u.Accent("vf workspace list")+" in a minute.") + } + if !s.TokensInKeyring { + // Not an error, but worth knowing: no keychain here (often over SSH), + // so the tokens are in an owner-only file. + details = append(details, u.Muted("Saved to "+ui.ShortPath(s.storageLocation())+", readable only by you; no keychain here")) + } + if len(details) > 0 { + fmt.Fprintln(out, u.Under(details...)) + } + + // With a refresh token the session renews by itself, and the access + // token's 15-minute expiry is not worth a word. Without one it really ends. + if s.RefreshToken == "" && !s.Expiry.IsZero() { + fmt.Fprintln(out, u.Status(ui.StatusWarn, "This session ends "+ui.Until(s.Expiry, now)+" and won't renew")) + fmt.Fprintln(out, u.Under("Run "+u.Accent("vf auth login")+" again then")) + } + + // A token from the environment outranks the session that was just stored. + if config.GetEnvValue("token") != "" { + fmt.Fprintln(out, u.Status(ui.StatusWarn, "VF_TOKEN is set, and it outranks this session")) + fmt.Fprintln(out, u.Under("To use the browser session: "+u.Accent("unset VF_TOKEN"))) + } + + if signup { + fmt.Fprintln(out, "\n"+u.Bold("Next steps")) + for _, row := range u.Tips(signupTips, ui.TerminalWidth(out)-2) { + fmt.Fprintln(out, " "+row) + } + } +} + +// workspaceSummary names the account's workspaces: one with its ID, a few by +// name, many as the first three and a count. +func workspaceSummary(u *ui.UI, workspaces []Workspace) string { + if len(workspaces) == 1 { + return "Workspace: " + workspaces[0].Name + " " + u.Muted(ui.Separator.Symbol()) + " " + u.Accent(workspaces[0].ID) + } + names := make([]string, 0, 3) + for _, ws := range workspaces[:min(3, len(workspaces))] { + names = append(names, ws.Name) + } + summary := "Workspaces: " + strings.Join(names, ", ") + if more := len(workspaces) - len(names); more > 0 { + summary += fmt.Sprintf(" and %d more", more) + } + return summary +} diff --git a/internal/oauth/present_test.go b/internal/oauth/present_test.go new file mode 100644 index 00000000..7cbf6b7f --- /dev/null +++ b/internal/oauth/present_test.go @@ -0,0 +1,247 @@ +// This file is not generated by Speakeasy. It covers present.go. + +package oauth + +import ( + "context" + "encoding/base64" + "errors" + "os" + "runtime" + "strings" + "testing" + "time" + + "github.com/spf13/cobra" + "github.com/voiceflow/cli/internal/config" + "github.com/voiceflow/cli/internal/ui" +) + +// terminal is the UI a person at a terminal gets, minus color, so tests can +// match text. +func terminal(out *strings.Builder) *ui.UI { return ui.New(out, ui.Options{Decorate: true}) } + +// useConfig points config at an empty home, so VF_TOKEN is read as the CLI +// reads it. +func useConfig(t *testing.T) { + t.Helper() + t.Setenv("HOME", t.TempDir()) + t.Setenv("VF_TOKEN", "") + config.Reset() + t.Cleanup(config.Reset) + if err := config.Init("vf", "VF"); err != nil { + t.Fatal(err) + } +} + +func styledLoginCmd(t *testing.T, ctx context.Context) *cobra.Command { + t.Helper() + cmd := &cobra.Command{Use: "login"} + AddLoginFlags(cmd) + if err := cmd.ParseFlags([]string{"--login-timeout", "15s"}); err != nil { + t.Fatal(err) + } + cmd.SetContext(ctx) + return cmd +} + +func TestStyledLoginEndToEnd(t *testing.T) { + useTestStore(t, true) + useTestHTTPClient(t) + useFakeBrowser(t) + useConfig(t) + server := newFakeAuthServer(t) + t.Setenv(envIssuer, server.URL) + t.Setenv(envResource, "https://realtime-api.test") + useWorkspaceLister(t, func(context.Context, *cobra.Command, string) ([]Workspace, error) { + return []Workspace{{"ws-1", "Acme"}, {"ws-2", "Support"}, {"ws-3", "Sales"}, {"ws-4", "Labs"}}, nil + }) + + ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second) + defer cancel() + var out strings.Builder + if err := runStyledLogin(styledLoginCmd(t, ctx), false, terminal(&out), &out); err != nil { + t.Fatalf("login: %v\n%s", err, out.String()) + } + got := out.String() + + for _, want := range []string{ + ui.Action.Symbol() + " Opening your browser to sign in\n", + " ⎿ Didn't open? Use this URL:\n\n" + server.URL + "/", + "Waiting for you to sign in in your browser…", + "\r\x1b[2K", // the spinner erases its line before the result + "✓ Signed in to " + server.URL + "\n", + " ⎿ Workspaces: Acme, Support, Sales and 1 more\n", + } { + if !strings.Contains(got, want) { + t.Errorf("output is missing %q:\n%s", want, got) + } + } + // Details that alarm or distract on the main path stay in whoami. + for _, unwanted := range []string{"expires", "scopes", "storage", "Saved to"} { + if strings.Contains(got, unwanted) { + t.Errorf("output should not mention %q:\n%s", unwanted, got) + } + } + if _, err := LoadSession(); err != nil { + t.Errorf("session not stored: %v", err) + } +} + +func TestStyledLoginSaysCtrlCCanceledIt(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip("os.Interrupt cannot be sent to a process on Windows") + } + useTestStore(t, true) + useTestHTTPClient(t) + useConfig(t) + server := newFakeAuthServer(t) + t.Setenv(envIssuer, server.URL) + useWorkspaceLister(t, nil) + + // Instead of opening a browser, press Ctrl-C. runStyledLogin is already + // listening for it by then, so the signal cannot kill the test. + orig := browserOpener + browserOpener = func(string) error { + p, _ := os.FindProcess(os.Getpid()) + return p.Signal(os.Interrupt) + } + t.Cleanup(func() { browserOpener = orig }) + + ctx, cancel := context.WithTimeout(context.Background(), 20*time.Second) + defer cancel() + var out strings.Builder + err := runStyledLogin(styledLoginCmd(t, ctx), false, terminal(&out), &out) + if err == nil { + t.Fatal("login succeeded after Ctrl-C") + } + if err.Error() != "" { + t.Errorf("the error should be marked as reported, so main prints nothing more; got %q", err) + } + if !strings.HasSuffix(out.String(), "✗ Sign-in canceled\n") { + t.Errorf("output should end with the cancellation:\n%q", out.String()) + } +} + +func TestReportLoginError(t *testing.T) { + var out strings.Builder + cause := errors.New("timed out after 5m0s waiting for the browser to complete sign-in") + err := reportLoginError(terminal(&out), &out, cause, false, "vf auth login") + want := "✗ Couldn't sign in\n" + + " ⎿ timed out after 5m0s waiting for the browser to complete sign-in\n" + + " Try again: vf auth login\n" + if out.String() != want { + t.Errorf("got:\n%s\nwant:\n%s", out.String(), want) + } + if err.Error() != "" || !errors.Is(err, cause) { + t.Errorf("returned error should wrap the cause and be marked reported: %v", err) + } +} + +func TestWriteAuthPrompt(t *testing.T) { + cases := []struct { + name string + p authPrompt + want string + }{ + {"browser opened", authPrompt{URL: "https://x/auth"}, + ui.Action.Symbol() + " Opening your browser to sign in\n ⎿ Didn't open? Use this URL:\n\nhttps://x/auth\n\n"}, + {"signup, no browser", authPrompt{URL: "https://x/auth", Signup: true, NoBrowser: true}, + ui.Action.Symbol() + " Open this URL to create your account:\n\nhttps://x/auth\n\n"}, + {"browser failed", authPrompt{URL: "https://x/auth", BrowserErr: errors.New("xdg-open not found")}, + "⚠ Couldn't open a browser\n ⎿ xdg-open not found\n Open this URL to sign in:\n\nhttps://x/auth\n\n"}, + } + for _, c := range cases { + var out strings.Builder + writeAuthPrompt(terminal(&out), &out, c.p) + if out.String() != c.want { + t.Errorf("%s:\ngot %q\nwant %q", c.name, out.String(), c.want) + } + } +} + +func TestWriteSignedIn(t *testing.T) { + now := time.Date(2026, 11, 28, 12, 0, 0, 0, time.UTC) + jwt := func(claims string) string { + return "h." + base64.RawURLEncoding.EncodeToString([]byte(claims)) + ".s" + } + renewing := Session{Issuer: DefaultIssuer, TokensInKeyring: true, AccessToken: jwt(`{"sub":"42"}`), RefreshToken: "r", Expiry: now.Add(15 * time.Minute)} + + cases := []struct { + name string + session Session + signup bool + workspaces []Workspace + listErr error + vfToken string + want []string + unwanted []string + }{ + { + name: "plain sign-in, one workspace", session: renewing, + workspaces: []Workspace{{"ws-1", "Acme"}}, + want: []string{"✓ Signed in\n", " ⎿ Workspace: Acme · ws-1\n"}, + unwanted: []string{" to https://", "won't renew", "Next steps", "VF_TOKEN"}, + }, + { + name: "signup names the account and suggests next steps", + session: func() Session { + s := renewing + s.AccessToken = jwt(`{"email":"you@example.com"}`) + return s + }(), + signup: true, workspaces: []Workspace{{"ws-1", "My Workspace"}}, + want: []string{"✓ Account created and signed in as you@example.com\n", "Next steps\n", "vf workspace list"}, + }, + { + name: "signup without an email claim does not say 'as user 42'", session: renewing, signup: true, + want: []string{"✓ Account created and signed in\n", "still being set up"}, unwanted: []string{"user 42"}, + }, + { + name: "no keychain, no refresh token, VF_TOKEN set", + session: Session{Issuer: DefaultIssuer, TokensInKeyring: false, AccessToken: "a", + Expiry: now.Add(15 * time.Minute)}, + vfToken: "vfp_env", + want: []string{ + "readable only by you; no keychain here", + "⚠ This session ends in 15m and won't renew\n", + "⚠ VF_TOKEN is set, and it outranks this session\n", + "To use the browser session: unset VF_TOKEN", + }, + }, + } + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + useTestStore(t, true) + useConfig(t) + t.Setenv("VF_TOKEN", c.vfToken) + useWorkspaceLister(t, func(context.Context, *cobra.Command, string) ([]Workspace, error) { return nil, nil }) + var out strings.Builder + writeSignedIn(terminal(&out), &out, &c.session, c.signup, c.workspaces, c.listErr, now) + for _, w := range c.want { + if !strings.Contains(out.String(), w) { + t.Errorf("missing %q in:\n%s", w, out.String()) + } + } + for _, w := range c.unwanted { + if strings.Contains(out.String(), w) { + t.Errorf("unexpected %q in:\n%s", w, out.String()) + } + } + }) + } +} + +// The plain output (pipes, logs, the existing tests) prints the next steps +// exactly as it did before they were built from signupTips. +func TestSignupNextStepsPlainTextUnchanged(t *testing.T) { + want := []string{ + "vf workspace list List your workspaces", + "vf auth whoami Show the stored session", + "vf docs --help Search the Voiceflow documentation from the terminal", + "vf explore Browse and run every command interactively", + } + if strings.Join(signupNextSteps, "\n") != strings.Join(want, "\n") { + t.Errorf("signupNextSteps changed:\n%s", strings.Join(signupNextSteps, "\n")) + } +} diff --git a/internal/oauth/signup.go b/internal/oauth/signup.go index e2c6fca9..db464339 100644 --- a/internal/oauth/signup.go +++ b/internal/oauth/signup.go @@ -172,13 +172,15 @@ func waitForWorkspaces(ctx context.Context, cmd *cobra.Command, accessToken stri } } -// signupNextSteps are the commands suggested once the account exists. -var signupNextSteps = []string{ - "vf workspace list List your workspaces", - "vf auth whoami Show the stored session", - "vf docs --help Search the Voiceflow documentation from the terminal", - "vf explore Browse and run every command interactively", -} +// signupNextSteps are the commands suggested once the account exists, in the +// plain output: signupTips (present.go) in two columns. +var signupNextSteps = func() []string { + steps := make([]string, len(signupTips)) + for i, tip := range signupTips { + steps[i] = fmt.Sprintf("%-20s %s", tip.Command, tip.Does) + } + return steps +}() // writeSignupResult prints the account, its workspaces, and next steps after // a signup in human mode. diff --git a/internal/output/fold.go b/internal/output/fold.go new file mode 100644 index 00000000..69099ded --- /dev/null +++ b/internal/output/fold.go @@ -0,0 +1,108 @@ +// This file is not generated by Speakeasy. Inside the home prompt, a result +// longer than the screen is folded, as Claude Code folds long tool output: +// the first screenful prints, then one muted line says how much is left, +// +// … +182 lines · ctrl-o to show them +// +// and ctrl-o, or the prompt's `more`, prints the rest. Only there, and only +// at a terminal: a shell, a pipe and agent mode always get every line. + +package output + +import ( + "bytes" + "fmt" + "io" + + "github.com/spf13/cobra" + "github.com/voiceflow/cli/internal/ui" +) + +// foldSlack is how many lines past the limit print anyway: folding away two +// lines saves nothing. +const foldSlack = 3 + +var ( + foldAt int // lines a result prints before the rest folds; 0 never folds + folded string // the rest of the last folded result, until TakeFolded +) + +// SetFold sets how many lines of a result print before the rest is folded +// away. The home prompt sets it around each line it runs; 0, the default, +// never folds. +func SetFold(lines int) { foldAt = lines } + +// TakeFolded returns the rest of the last folded result and forgets it; "" +// when nothing is folded away. +func TakeFolded() string { + s := folded + folded = "" + return s +} + +// ResultWriter is where a command writes its result: stdout, through a +// folder while the home prompt folds and stdout is a terminal vf decorates. +// Result uses it; so should a hand-written command that prints a result of +// its own (vf docs). done must run once the result is written. +func ResultWriter(cmd *cobra.Command) (w io.Writer, done func()) { + out := cmd.OutOrStdout() + if foldAt <= 0 { + return out, func() {} + } + u := UI(cmd, out) + if !u.Decorated() { + return out, func() {} + } + f := &folder{out: out, u: u, limit: foldAt} + return f, f.finish +} + +// folder passes writes through until limit lines have gone by, then keeps +// the rest. +type folder struct { + out io.Writer + u *ui.UI + limit int + lines int + rest bytes.Buffer +} + +func (f *folder) Write(p []byte) (int, error) { + n := len(p) + for f.lines < f.limit && len(p) > 0 { + i := bytes.IndexByte(p, '\n') + if i < 0 { + if _, err := f.out.Write(p); err != nil { + return 0, err + } + return n, nil + } + if _, err := f.out.Write(p[:i+1]); err != nil { + return 0, err + } + f.lines++ + p = p[i+1:] + } + f.rest.Write(p) + return n, nil +} + +// finish prints what was kept if it is only a few lines, or folds it away +// behind one muted line saying how many there are. +func (f *folder) finish() { + rest := f.rest.Bytes() + if len(rest) == 0 { + return + } + n := bytes.Count(rest, []byte{'\n'}) + if rest[len(rest)-1] != '\n' { + n++ + } + if n <= foldSlack { + _, _ = f.out.Write(rest) + return + } + folded = string(rest) + sep := " " + ui.Separator.Symbol() + " " + fmt.Fprintln(f.out, f.u.Muted(fmt.Sprintf("… +%d lines%sctrl-o to show them", n, sep))) +} diff --git a/internal/output/fold_test.go b/internal/output/fold_test.go new file mode 100644 index 00000000..8f691fa8 --- /dev/null +++ b/internal/output/fold_test.go @@ -0,0 +1,90 @@ +// This file is not generated by Speakeasy. It covers fold.go. + +package output + +import ( + "bytes" + "io" + "strings" + "testing" + + "github.com/spf13/cobra" + "github.com/voiceflow/cli/internal/ui" +) + +func numbered(n int) string { + var b strings.Builder + for i := 1; i <= n; i++ { + b.WriteString("row " + string(rune('a'+i-1)) + "\n") + } + return b.String() +} + +func folding(limit int, chunks ...string) (shown string, f *folder) { + var out bytes.Buffer + f = &folder{out: &out, u: ui.New(io.Discard, ui.Options{Decorate: true}), limit: limit} + for _, c := range chunks { + if _, err := f.Write([]byte(c)); err != nil { + panic(err) + } + } + f.finish() + return out.String(), f +} + +func TestALongResultFoldsBehindOneLine(t *testing.T) { + t.Cleanup(func() { TakeFolded() }) + all := numbered(10) + // Written in uneven pieces, as encoders write. + shown, _ := folding(3, all[:5], all[5:17], all[17:]) + want := numbered(3) + "… +7 lines · ctrl-o to show them\n" + if shown != want { + t.Errorf("got %q, want %q", shown, want) + } + if got := TakeFolded(); got != all[len(numbered(3)):] { + t.Errorf("the rest should wait for ctrl-o, got %q", got) + } + if got := TakeFolded(); got != "" { + t.Errorf("taking it once forgets it, got %q", got) + } +} + +func TestAFewLinesOverTheLimitPrintAnyway(t *testing.T) { + t.Cleanup(func() { TakeFolded() }) + all := numbered(3 + foldSlack) + if shown, _ := folding(3, all); shown != all { + t.Errorf("got %q, want every line", shown) + } + if got := TakeFolded(); got != "" { + t.Errorf("nothing should be folded away, got %q", got) + } + if shown, _ := folding(3, "a\nb\n"); shown != "a\nb\n" { + t.Errorf("a short result prints as it is, got %q", shown) + } +} + +// A last line without a newline still counts. +func TestFoldCountsAnUnfinishedLastLine(t *testing.T) { + t.Cleanup(func() { TakeFolded() }) + shown, _ := folding(1, "a\nb\nc\nd\ne") + if !strings.HasSuffix(shown, "… +4 lines · ctrl-o to show them\n") { + t.Errorf("got %q", shown) + } +} + +// Outside the prompt, and off a terminal inside it, Result writes straight to +// stdout. +func TestNoFoldingOutsideThePromptOrOffATerminal(t *testing.T) { + cmd := &cobra.Command{Use: "list"} + var out bytes.Buffer + cmd.SetOut(&out) + + if w, _ := ResultWriter(cmd); w != io.Writer(&out) { + t.Errorf("outside the prompt the result should go straight to stdout, got %T", w) + } + SetFold(5) + t.Cleanup(func() { SetFold(0) }) + if w, _ := ResultWriter(cmd); w != io.Writer(&out) { + t.Errorf("off a terminal nothing folds, got %T", w) + } +} diff --git a/internal/output/output.go b/internal/output/output.go index 96616b26..e60acde5 100644 --- a/internal/output/output.go +++ b/internal/output/output.go @@ -146,7 +146,8 @@ func ValidateGlobalServerName(cmd *cobra.Command, validNames map[string]string) // Result formats and outputs the response based on the --output-format flag. func Result(cmd *cobra.Command, res interface{}) error { - out := cmd.OutOrStdout() + out, done := ResultWriter(cmd) // fold.go: folds a long result inside the home prompt + defer done() colorFlag, _ := flagutil.GetStringFlag(cmd, "color") colorize := ShouldColorize(colorFlag) jqExpr, _ := flagutil.GetStringFlag(cmd, "jq") @@ -401,7 +402,7 @@ func Error(cmd *cobra.Command, err error) error { // Surface the error so the user can see what went wrong. if body != "" && statusCode != 0 { - fmt.Fprintf(cmd.ErrOrStderr(), "\nAPI Error (HTTP %d):\n%s\n", statusCode, formatErrorBody(body)) + fmt.Fprintf(cmd.ErrOrStderr(), "\nAPI Error (HTTP %d):%s\n%s\n", statusCode, sdkErrorDetail(err), formatErrorBody(body)) } else if body != "" { fmt.Fprintf(cmd.ErrOrStderr(), "\nAPI Error:\n%s\n", formatErrorBody(body)) } else { @@ -415,7 +416,7 @@ func Error(cmd *cobra.Command, err error) error { fmt.Fprintf(cmd.ErrOrStderr(), "\nHint: run '%s auth login' to sign in, '%s auth signup' to create an account, or '%s configure' to set a token.\n", cliName, cliName, cliName) } - return err + return AlreadyReported(err) // see reported.go } out := cmd.ErrOrStderr() diff --git a/internal/output/reported.go b/internal/output/reported.go index 816d1da9..179af204 100644 --- a/internal/output/reported.go +++ b/internal/output/reported.go @@ -18,12 +18,41 @@ // product. A trailing non-JSON line after a JSON object is exactly what breaks // a naive parser, and this CLI's whole purpose is being driven by agents. // -// Human (pretty) output is deliberately left alone. There the trailing line is -// the readable one-line summary that follows a raw API body, so suppressing it -// would remove the most useful part of the message rather than a duplicate. +// Human (pretty) output had the same duplicate, and was at first left alone on +// the theory that its trailing line was a readable one-line summary of the raw +// API body above it. It was not. That line is SDKDefaultError.Error(), which +// repeats the status code and then the entire body again, and for a connection +// error it repeats the "Error: …" line word for word: +// +// Error: error sending request: Get "…": dial tcp …: connection refused +// error sending request: Get "…": dial tcp …: connection refused +// +// The one part of it the body does not show is the SDK's message, and only +// when it says more than the generic "API error occurred": for a status the +// operation never documents, such as a 200 where only 201 means success, it is +// "unknown status code returned", which is why a 200 is an error at all. Error +// puts that message on its status line (sdkErrorDetail below), so everything +// the trailing line carried is already printed, and human mode now marks its +// errors as reported too. package output +import ( + "errors" + + "github.com/voiceflow/cli/internal/sdk/models/sdkerrors" +) + +// sdkErrorDetail is the SDK's message for Error's status line, with a leading +// space, or "" when it is the generic one that the status already says. +func sdkErrorDetail(err error) string { + var sdkErr *sdkerrors.SDKDefaultError + if !errors.As(err, &sdkErr) || sdkErr.Message == "" || sdkErr.Message == "API error occurred" { + return "" + } + return " " + sdkErr.Message +} + // alreadyReported marks an error whose message has been written to stderr by // the code that produced it. // diff --git a/internal/output/reported_test.go b/internal/output/reported_test.go new file mode 100644 index 00000000..44f97a2b --- /dev/null +++ b/internal/output/reported_test.go @@ -0,0 +1,78 @@ +package output + +import ( + "errors" + "fmt" + "net/http" + "strings" + "testing" + + "github.com/voiceflow/cli/internal/sdk/models/sdkerrors" +) + +// In human mode, Error prints the failure and returns it marked as reported, +// so cmd/vf/main.go does not print it a second time. See reported.go. + +func TestHumanModeReportsAnAPIErrorOnce(t *testing.T) { + ResetAgentMode() + t.Cleanup(ResetAgentMode) + + body := `{"statusCode":404,"message":"Project not found"}` + res := &http.Response{StatusCode: http.StatusNotFound, Status: "404 Not Found", Header: http.Header{}} + apiErr := sdkerrors.NewSDKDefaultError("API error occurred", http.StatusNotFound, body, res) + + got, printed := reportError(t, apiErr, false) + + if n := strings.Count(printed, "Project not found"); n != 1 { + t.Errorf("printed the body %d times, want once:\n%s", n, printed) + } + if !strings.Contains(printed, "API Error (HTTP 404):\n") { + t.Errorf("printed %q, want the status line with nothing after it", printed) + } + if got == nil || got.Error() != "" { + t.Fatalf("Error returned %v, want an error marked as already reported", got) + } + var sdkErr *sdkerrors.SDKDefaultError + if !errors.As(got, &sdkErr) || sdkErr.StatusCode != http.StatusNotFound { + t.Errorf("the reported error lost the SDK error it wraps: %#v", got) + } +} + +// The suppressed line was the only place that said why a status the operation +// never documents is an error. The status line keeps that message. +func TestHumanModeNamesAnUndocumentedStatus(t *testing.T) { + ResetAgentMode() + t.Cleanup(ResetAgentMode) + + res := &http.Response{StatusCode: http.StatusOK, Status: "200 OK", Header: http.Header{}} + apiErr := sdkerrors.NewSDKDefaultError("unknown status code returned", http.StatusOK, "{}", res) + + got, printed := reportError(t, apiErr, false) + + if !strings.Contains(printed, "API Error (HTTP 200): unknown status code returned\n") { + t.Errorf("printed %q, want the SDK's message on the status line", printed) + } + if got == nil || got.Error() != "" { + t.Fatalf("Error returned %v, want an error marked as already reported", got) + } +} + +func TestHumanModeReportsAConnectionErrorOnce(t *testing.T) { + ResetAgentMode() + t.Cleanup(ResetAgentMode) + + cause := errors.New("dial tcp 127.0.0.1:9: connect: connection refused") + connErr := fmt.Errorf("error sending request: %w", cause) + + got, printed := reportError(t, connErr, false) + + if want := "\nError: error sending request: dial tcp 127.0.0.1:9: connect: connection refused\n"; printed != want { + t.Errorf("printed %q, want %q", printed, want) + } + if got == nil || got.Error() != "" { + t.Fatalf("Error returned %v, want an error marked as already reported", got) + } + if !errors.Is(got, cause) { + t.Errorf("the reported error lost its cause: %#v", got) + } +} diff --git a/internal/output/ui.go b/internal/output/ui.go new file mode 100644 index 00000000..011eabb8 --- /dev/null +++ b/internal/output/ui.go @@ -0,0 +1,58 @@ +// This file is not generated by Speakeasy. It decides, for one output stream, +// whether vf's human-facing output may use color and decoration, and hands +// that decision to the ui package, which does the rendering. + +package output + +import ( + "io" + "os" + + "github.com/spf13/cobra" + "github.com/voiceflow/cli/internal/flagutil" + "github.com/voiceflow/cli/internal/ui" + "golang.org/x/term" +) + +// UI returns the design-system renderer for w, the stream cmd is about to +// write to. +// +// Agent mode turns everything off: an agent reads the bytes, and escape codes +// and glyphs are noise in its context. Otherwise color follows the same rules +// as ShouldColorize (--color, then NO_COLOR, then FORCE_COLOR) but asks about +// w itself rather than always about stdout. That difference is the point: +// `vf project list | jq` pipes stdout, and the error that run prints still +// goes to a terminal on stderr, so it can still be colored. +// +// Decoration (glyphs now, boxes and motion later) needs a person watching a +// terminal, so it never follows --color=always or FORCE_COLOR into a pipe. +func UI(cmd *cobra.Command, w io.Writer) *ui.UI { + colorFlag, _ := flagutil.GetStringFlag(cmd, "color") + terminal := isTerminal(w) + return ui.New(w, ui.Options{ + Color: !IsAgentMode() && wantsColor(colorFlag, terminal), + Decorate: !IsAgentMode() && terminal && os.Getenv("TERM") != "dumb", + }) +} + +func wantsColor(colorFlag string, terminal bool) bool { + switch colorFlag { + case "never": + return false + case "always": + return true + } + // https://no-color.org/ + if _, ok := os.LookupEnv("NO_COLOR"); ok { + return false + } + if _, ok := os.LookupEnv("FORCE_COLOR"); ok { + return true + } + return terminal +} + +func isTerminal(w io.Writer) bool { + f, ok := w.(interface{ Fd() uintptr }) + return ok && term.IsTerminal(int(f.Fd())) +} diff --git a/internal/output/ui_test.go b/internal/output/ui_test.go new file mode 100644 index 00000000..f82d9e5d --- /dev/null +++ b/internal/output/ui_test.go @@ -0,0 +1,77 @@ +package output + +import ( + "bytes" + "os" + "testing" + + "github.com/spf13/cobra" +) + +// unsetenv removes name for the duration of the test. t.Setenv can only set, +// and an exported NO_COLOR or FORCE_COLOR on the host would decide the result. +func unsetenv(t *testing.T, name string) { + t.Helper() + if old, ok := os.LookupEnv(name); ok { + t.Cleanup(func() { _ = os.Setenv(name, old) }) + } + _ = os.Unsetenv(name) +} + +func uiFor(t *testing.T, colorFlag string, agent bool) (color, decorate bool) { + t.Helper() + ResetAgentMode() + t.Cleanup(ResetAgentMode) + if agent { + t.Setenv("FORCE_AGENT_MODE", "1") + InitAgentMode(&cobra.Command{Use: "vf"}) + } + cmd := &cobra.Command{Use: "vf"} + cmd.Flags().String("color", "auto", "") + if err := cmd.Flags().Set("color", colorFlag); err != nil { + t.Fatal(err) + } + u := UI(cmd, &bytes.Buffer{}) + return u.Colored(), u.Decorated() +} + +func TestUIIsPlainForAPipe(t *testing.T) { + unsetenv(t, "NO_COLOR") + unsetenv(t, "FORCE_COLOR") + if color, decorate := uiFor(t, "auto", false); color || decorate { + t.Fatalf("color=%v decorate=%v for a non-terminal, want neither", color, decorate) + } +} + +func TestUIColorsAPipeOnlyWhenAsked(t *testing.T) { + unsetenv(t, "NO_COLOR") + unsetenv(t, "FORCE_COLOR") + if color, decorate := uiFor(t, "always", false); !color || decorate { + t.Fatalf("--color=always: color=%v decorate=%v, want color without decoration", color, decorate) + } + + t.Setenv("FORCE_COLOR", "1") + if color, decorate := uiFor(t, "auto", false); !color || decorate { + t.Fatalf("FORCE_COLOR: color=%v decorate=%v, want color without decoration", color, decorate) + } +} + +func TestUIHonorsNoColorAndNever(t *testing.T) { + t.Setenv("FORCE_COLOR", "1") + if color, _ := uiFor(t, "never", false); color { + t.Fatal("--color=never still colored") + } + + unsetenv(t, "FORCE_COLOR") + t.Setenv("NO_COLOR", "1") + if color, _ := uiFor(t, "auto", false); color { + t.Fatal("NO_COLOR still colored") + } +} + +func TestUIIsPlainInAgentModeWhateverTheFlags(t *testing.T) { + t.Setenv("FORCE_COLOR", "1") + if color, decorate := uiFor(t, "always", true); color || decorate { + t.Fatalf("agent mode: color=%v decorate=%v, want neither", color, decorate) + } +} diff --git a/internal/prompt/complete.go b/internal/prompt/complete.go new file mode 100644 index 00000000..38e08617 --- /dev/null +++ b/internal/prompt/complete.go @@ -0,0 +1,410 @@ +// This file is not generated by Speakeasy. + +// Package prompt is the home prompt: the ❯ line under the banner that bare +// `vf` opens at a terminal, with a menu of commands and flags as you type. +// It reads one line at a time, inline, and leaves running it to the caller. +package prompt + +import ( + "sort" + "strings" + + "github.com/spf13/cobra" + "github.com/spf13/pflag" +) + +// Suggestion is one row of the menu. +type Suggestion struct { + Label string // shown, and inserted in place of the line from From on + Detail string // what it does, shown muted + Required bool // a flag the command cannot run without + Group bool // a command with commands under it, which does nothing bare + From int // byte offset in the line where Label is inserted +} + +// Completer suggests what can come next in line. +type Completer func(line string) []Suggestion + +// deepSearchMin is how many characters a word needs before the menu also +// searches below the top level, e.g. "publish" finding "environment publish". +const deepSearchMin = 3 + +// fuzzyMin is how many characters a word needs before the menu tries +// abbreviations, once nothing starts with or contains it: "envpub" finding +// "environment publish", "--pid" finding "--project-id". +const fuzzyMin = 2 + +// fuzzyMax is how many abbreviation matches the menu offers at most. +const fuzzyMax = 20 + +// Commands returns a Completer for root's command tree: subcommands while the +// line is still naming a command, then that command's flags, required first. +// extra are top-level entries that are not commands, such as the prompt's own +// "exit". +func Commands(root *cobra.Command, extra []Suggestion) Completer { + return func(line string) []Suggestion { return complete(root, extra, line) } +} + +type token struct { + text string + start int +} + +func complete(root *cobra.Command, extra []Suggestion, line string) []Suggestion { + toks, endsInWord := tokenize(line) + partial := token{start: len(line)} + if endsInWord { + partial, toks = toks[len(toks)-1], toks[:len(toks)-1] + } + + // A pasted "/project list" means "project list": / opens the menu in + // Claude Code, and the prompt drops it before running the line. + first := &partial + if len(toks) > 0 { + first = &toks[0] + } + if strings.HasPrefix(first.text, "/") { + first.text, first.start = first.text[1:], first.start+1 + } + + // "vf project list" and "project list" mean the same here. + if len(toks) > 0 && toks[0].text == "vf" { + toks = toks[1:] + } else if len(toks) == 0 && partial.text == "vf" { + return nil + } + cmdStart := partial.start + if len(toks) > 0 { + cmdStart = toks[0].start + } + + cmd, used := root, map[string]bool{} + inArgs, wantsValue := false, false + for _, t := range toks { + wantsValue = false + if strings.HasPrefix(t.text, "-") { + inArgs = true + name, hasValue := strings.TrimLeft(t.text, "-"), false + if eq := strings.IndexByte(name, '='); eq >= 0 { + name, hasValue = name[:eq], true + } + f := lookupFlag(cmd, t.text, name) + if f != nil { + used[f.Name] = true + wantsValue = !hasValue && f.Value.Type() != "bool" + } + continue + } + if !inArgs { + if child := findChild(cmd, t.text); child != nil { + cmd = child + continue + } + } + inArgs = true // a positional argument or a flag's value + } + + switch { + case wantsValue: + return nil // the word being typed is the previous flag's value + case strings.HasPrefix(partial.text, "-"): + return flags(cmd, partial, used) + case inArgs: + return nil + case hasSubcommands(cmd): + return subcommands(root, cmd, partial, cmdStart, extra) + case partial.text == "": + return flags(cmd, partial, used) + } + return nil +} + +func subcommands(root, cmd *cobra.Command, partial token, cmdStart int, extra []Suggestion) []Suggestion { + p := partial.text + var prefix, contains []Suggestion + for _, child := range visibleChildren(cmd) { + s := Suggestion{Label: child.Name(), Detail: child.Short, Group: hasSubcommands(child), From: partial.start} + switch { + case strings.HasPrefix(child.Name(), p) || hasAliasPrefix(child, p): + prefix = append(prefix, s) + case p != "" && strings.Contains(child.Name(), p): + contains = append(contains, s) + } + } + sortByLabel(prefix) + sortByLabel(contains) + // The prompt's own words follow the commands they match, so the full + // list (nothing typed yet) ends with them. + if cmd == root { + for _, e := range extra { + if strings.HasPrefix(e.Label, p) { + e.From = partial.start + prefix = append(prefix, e) + } + } + } + out := append(prefix, contains...) + + // At the top level, a word that names no command may name a deeper one. + if cmd == root && len(p) >= deepSearchMin { + seen := map[string]bool{} + for _, s := range out { + seen[s.Label] = true + } + var deep []Suggestion + walk(root, func(c *cobra.Command, path string) { + if strings.Count(path, " ") == 0 || seen[path] { + return + } + for _, word := range strings.Fields(path)[1:] { + if strings.HasPrefix(word, p) { + deep = append(deep, Suggestion{Label: path, Detail: c.Short, Group: hasSubcommands(c), From: cmdStart}) + return + } + } + }) + sortByLabel(deep) + out = append(out, deep...) + } + + // Nothing starts with, contains or deeply names the word: try it as an + // abbreviation of a command here, or, at the top level, of any command. + if len(out) == 0 && len(p) >= fuzzyMin { + var cands []fuzzyCand + for _, child := range visibleChildren(cmd) { + cands = append(cands, fuzzyCand{Suggestion{Label: child.Name(), Detail: child.Short, Group: hasSubcommands(child), From: partial.start}, 0}) + } + if cmd == root && len(p) >= deepSearchMin { + walk(root, func(c *cobra.Command, path string) { + if strings.Contains(path, " ") { + cands = append(cands, fuzzyCand{Suggestion{Label: path, Detail: c.Short, Group: hasSubcommands(c), From: cmdStart}, 0}) + } + }) + } + out = fuzzyRank(cands, p) + } + return out +} + +type fuzzyCand struct { + s Suggestion + score int +} + +// fuzzyRank keeps the candidates whose label p abbreviates, best first. +func fuzzyRank(cands []fuzzyCand, p string) []Suggestion { + var kept []fuzzyCand + for _, c := range cands { + if score, ok := fuzzyScore(strings.TrimLeft(c.s.Label, "-"), p); ok { + c.score = score + kept = append(kept, c) + } + } + sort.SliceStable(kept, func(i, j int) bool { return kept[i].score > kept[j].score }) + var out []Suggestion + for _, c := range kept[:min(len(kept), fuzzyMax)] { + out = append(out, c.s) + } + return out +} + +// fuzzyScore reports whether every letter of p appears in s, in order, and +// how well: a letter that starts a word (after a space or a dash) counts +// most, then a letter right after the last one matched, and a shorter s wins +// a tie. The first letter must start a word, so "envpub" matches +// "environment publish" and "nment" matches nothing: without that rule a +// few letters match half the commands by chance. +func fuzzyScore(s, p string) (int, bool) { + s, p = strings.ToLower(s), strings.ToLower(p) + wordStart := func(i int) bool { return i == 0 || s[i-1] == ' ' || s[i-1] == '-' } + i := -1 + for k := 0; k < len(s); k++ { + if s[k] == p[0] && wordStart(k) { + i = k + break + } + } + if i < 0 { + return 0, false + } + score, last := 4, i + for j := 1; j < len(p); j++ { + k := strings.IndexByte(s[last+1:], p[j]) + if k < 0 { + return 0, false + } + at := last + 1 + k + score++ + if wordStart(at) { + score += 3 + } + if at == last+1 { + score += 2 + } + last = at + } + return score*16 - len(s), true +} + +func flags(cmd *cobra.Command, partial token, used map[string]bool) []Suggestion { + p := strings.TrimLeft(partial.text, "-") + out := flagsWhere(cmd, partial, used, func(name string) bool { return strings.HasPrefix(name, p) }) + if len(out) == 0 && len(p) >= fuzzyMin { + // No flag starts with it: try it as an abbreviation, "--pid" for + // "--project-id". + var cands []fuzzyCand + for _, s := range flagsWhere(cmd, partial, used, func(string) bool { return true }) { + cands = append(cands, fuzzyCand{s, 0}) + } + out = fuzzyRank(cands, p) + } + return out +} + +// flagsWhere is cmd's flags whose names pass keep: required, then optional, +// then, once a dash is typed, the global ones. +func flagsWhere(cmd *cobra.Command, partial token, used map[string]bool, keep func(name string) bool) []Suggestion { + var required, optional, global []Suggestion + add := func(f *pflag.Flag, inherited bool) { + if f.Hidden || used[f.Name] || f.Name == "help" || !keep(f.Name) { + return + } + s := Suggestion{Label: "--" + f.Name, Detail: flagDetail(f.Usage), From: partial.start} + switch { + case inherited: + global = append(global, s) + case isRequired(f): + s.Required = true + required = append(required, s) + default: + optional = append(optional, s) + } + } + cmd.LocalFlags().VisitAll(func(f *pflag.Flag) { add(f, false) }) + // Global flags (--output-format, --jq, ...) only once a dash is typed, + // so they do not bury the command's own. + if strings.HasPrefix(partial.text, "-") { + cmd.InheritedFlags().VisitAll(func(f *pflag.Flag) { add(f, true) }) + } + return append(append(required, optional...), global...) +} + +// flagDetail is a flag's usage, first line, without the generated +// "[required]" marker, which the menu shows its own way. +func flagDetail(usage string) string { + if i := strings.IndexByte(usage, '\n'); i >= 0 { + usage = usage[:i] + } + usage = strings.TrimSpace(strings.ReplaceAll(usage, "[required]", "")) + return usage +} + +func isRequired(f *pflag.Flag) bool { + ann := f.Annotations["speakeasy:required"] + return len(ann) > 0 && ann[0] == "true" +} + +func lookupFlag(cmd *cobra.Command, raw, name string) *pflag.Flag { + if !strings.HasPrefix(raw, "--") && len(name) == 1 { + return cmd.Flags().ShorthandLookup(name) + } + if f := cmd.Flags().Lookup(name); f != nil { + return f + } + return cmd.InheritedFlags().Lookup(name) +} + +func findChild(cmd *cobra.Command, name string) *cobra.Command { + for _, c := range visibleChildren(cmd) { + if c.Name() == name || c.HasAlias(name) { + return c + } + } + return nil +} + +func hasAliasPrefix(c *cobra.Command, p string) bool { + if p == "" { + return false + } + for _, a := range c.Aliases { + if strings.HasPrefix(a, p) { + return true + } + } + return false +} + +// hiddenFromMenu are commands the prompt does not offer: shell completion +// scripts mean nothing inside it. +var hiddenFromMenu = map[string]bool{"completion": true} + +func visibleChildren(cmd *cobra.Command) []*cobra.Command { + var out []*cobra.Command + for _, c := range cmd.Commands() { + if c.Hidden || c.Deprecated != "" || hiddenFromMenu[c.Name()] { + continue + } + out = append(out, c) + } + return out +} + +func hasSubcommands(cmd *cobra.Command) bool { return len(visibleChildren(cmd)) > 0 } + +// walk visits every command below root with its path, e.g. "project list". +func walk(root *cobra.Command, visit func(*cobra.Command, string)) { + var rec func(c *cobra.Command, path string) + rec = func(c *cobra.Command, path string) { + for _, child := range visibleChildren(c) { + p := strings.TrimSpace(path + " " + child.Name()) + visit(child, p) + rec(child, p) + } + } + rec(root, "") +} + +func sortByLabel(s []Suggestion) { + sort.SliceStable(s, func(i, j int) bool { return s[i].Label < s[j].Label }) +} + +// tokenize splits line at unquoted spaces, keeping each word's offset, and +// reports whether the line ends inside a word. +func tokenize(line string) (toks []token, endsInWord bool) { + var quote byte + start := -1 + for i := 0; i < len(line); i++ { + c := line[i] + switch { + case quote != 0: + if c == quote { + quote = 0 + } else if c == '\\' && quote == '"' && i+1 < len(line) { + i++ + } + case c == '\'' || c == '"': + quote = c + if start < 0 { + start = i + } + case c == ' ' || c == '\t': + if start >= 0 { + toks = append(toks, token{line[start:i], start}) + start = -1 + } + default: + if start < 0 { + start = i + } + if c == '\\' && i+1 < len(line) { + i++ // an escaped character, e.g. "\ ", stays in the word + } + } + } + if start >= 0 { + toks = append(toks, token{line[start:], start}) + return toks, true + } + return toks, false +} diff --git a/internal/prompt/complete_test.go b/internal/prompt/complete_test.go new file mode 100644 index 00000000..13520498 --- /dev/null +++ b/internal/prompt/complete_test.go @@ -0,0 +1,251 @@ +// This file is not generated by Speakeasy. It covers complete.go and split.go. + +package prompt + +import ( + "reflect" + "sort" + "testing" + + "github.com/spf13/cobra" +) + +// tree is a small command tree shaped like vf's: groups with operations +// under them, required flags annotated the way Speakeasy annotates them, and +// global flags on the root. +func tree() *cobra.Command { + root := &cobra.Command{Use: "vf"} + root.PersistentFlags().StringP("output-format", "o", "pretty", "Specify the output format.") + root.PersistentFlags().Bool("debug", false, "Log diagnostics") + + op := func(use, short string) *cobra.Command { + return &cobra.Command{Use: use, Short: short, Run: func(*cobra.Command, []string) {}} + } + required := func(c *cobra.Command, name, usage string) { + c.Flags().String(name, "", usage+" [required]") + _ = c.Flags().SetAnnotation(name, "speakeasy:required", []string{"true"}) + } + + project := &cobra.Command{Use: "project", Short: "Manage projects", Aliases: []string{"proj"}} + list := op("list", "List projects") + list.Flags().String("workspace-id", "", "The workspace\nsecond line") + list.Flags().Int("limit", 20, "How many") + get := op("get", "Get a project") + required(get, "project-id", "The project") + project.AddCommand(list, get) + + env := &cobra.Command{Use: "environment", Short: "Manage environments"} + publish := op("publish", "Publish an environment") + required(publish, "project-id", "The project") + required(publish, "environment-id", "The environment") + publish.Flags().Bool("wait", false, "Wait for it") + env.AddCommand(publish, op("list", "List environments")) + + hidden := op("internal", "Hidden") + hidden.Hidden = true + old := op("legacy", "Old") + old.Deprecated = "use project" + root.AddCommand(project, env, op("version", "Print the version"), op("completion", "Shell completion"), hidden, old) + return root +} + +var extras = []Suggestion{{Label: "exit", Detail: "Leave vf"}, {Label: "clear", Detail: "Clear the screen"}} + +func labels(s []Suggestion) []string { + out := []string{} + for _, x := range s { + out = append(out, x.Label) + } + return out +} + +func TestCompleteCommands(t *testing.T) { + complete := Commands(tree(), extras) + cases := []struct { + line string + want []string + }{ + // Nothing typed: every visible command, then the prompt's own + // words; no hidden, deprecated or completion commands. + {"", []string{"environment", "project", "version", "exit", "clear"}}, + {"pro", []string{"project"}}, + {"proj", []string{"project"}}, // the alias is a prefix too + {"vf pro", []string{"project"}}, // a leading vf is skipped + {"vf", nil}, // still typing vf itself + {"/pro", []string{"project"}}, // a pasted Claude Code slash + {"/project l", []string{"list"}}, + {"ex", []string{"exit"}}, // the prompt's own words + {"ers", []string{"version"}}, // contains, after prefixes + {"project ", []string{"get", "list"}}, // a group lists its commands + {"proj l", []string{"list"}}, // through the alias + {"internal", nil}, // hidden stays hidden + {"nosuch thing", nil}, // an unknown word is an argument + {"version ", nil}, // a leaf with no flags + {"project get ", []string{"--project-id"}}, + {"project get --project-id ", nil}, // the flag's value + {"project get --project-id=x ", nil}, + {"project get --project-id x ", nil}, // the only flag is used + {"project get --project-id x --", []string{"--debug", "--output-format"}}, // then the globals + {"project list --", []string{"--limit", "--workspace-id", "--debug", "--output-format"}}, + {"project list -o ", nil}, // shorthand that takes a value + {"project list --debug ", []string{}}, + } + for _, c := range cases { + got := labels(complete(c.line)) + if len(got) == 0 && len(c.want) == 0 { + continue + } + if !reflect.DeepEqual(got, c.want) { + t.Errorf("%q: got %v, want %v", c.line, got, c.want) + } + } +} + +func TestDeepSearchFindsCommandsBelowTheTop(t *testing.T) { + got := Commands(tree(), extras)("publ") + if want := []string{"environment publish"}; !reflect.DeepEqual(labels(got), want) { + t.Fatalf("got %v, want %v", labels(got), want) + } + // It replaces the whole command, not just the word being typed. + if got[0].From != 0 { + t.Errorf("From = %d, want 0", got[0].From) + } + // Two letters are too few to search everything. + if got := Commands(tree(), extras)("pu"); len(got) != 0 { + t.Errorf("pu: got %v", labels(got)) + } + // A top-level match is not repeated as a deep one. + for _, l := range labels(Commands(tree(), extras)("list")) { + if l == "list" { + t.Errorf("list matched a top-level command that does not exist") + } + } +} + +func TestFlagsPutRequiredFirst(t *testing.T) { + got := Commands(tree(), nil)("environment publish ") + if want := []string{"--environment-id", "--project-id", "--wait"}; !reflect.DeepEqual(labels(got), want) { + t.Fatalf("got %v, want %v", labels(got), want) + } + if !got[0].Required || !got[1].Required || got[2].Required { + t.Errorf("required markers: %+v", got) + } + if got[0].Detail != "The environment" { + t.Errorf("detail should drop [required]: %q", got[0].Detail) + } + if d := Commands(tree(), nil)("project list --w")[0].Detail; d != "The workspace" { + t.Errorf("detail should be the first line: %q", d) + } +} + +func TestSuggestionsReplaceTheWordBeingTyped(t *testing.T) { + line := `project get --pro` + s := Commands(tree(), nil)(line) + if len(s) != 1 { + t.Fatalf("got %v", labels(s)) + } + if got := line[:s[0].From] + s[0].Label; got != "project get --project-id" { + t.Errorf("accepting gives %q", got) + } + line = `project get ` + s = Commands(tree(), nil)(line) + if got := line[:s[0].From] + s[0].Label; got != "project get --project-id" { + t.Errorf("accepting gives %q", got) + } +} + +func TestQuotedValuesAreOneWord(t *testing.T) { + complete := Commands(tree(), nil) + // The value has a space and a dash inside quotes; it is still the flag's + // value, so what follows is a new flag. + if got := labels(complete(`project list --workspace-id "a -b c" --l`)); !reflect.DeepEqual(got, []string{"--limit"}) { + t.Errorf("got %v", got) + } + if got := complete(`project list --workspace-id "a b`); len(got) != 0 { + t.Errorf("inside an open quote: got %v", labels(got)) + } +} + +func TestWalkSkipsWhatTheMenuHides(t *testing.T) { + var paths []string + walk(tree(), func(_ *cobra.Command, path string) { paths = append(paths, path) }) + want := []string{"environment", "environment list", "environment publish", "project", "project get", "project list", "version"} + sort.Strings(paths) + if !reflect.DeepEqual(paths, want) { + t.Errorf("got %v, want %v", paths, want) + } +} + +func TestSplitArgs(t *testing.T) { + cases := []struct { + line string + want []string + }{ + {"", nil}, + {" project list ", []string{"project", "list"}}, + {`--name "My Agent"`, []string{"--name", "My Agent"}}, + {`--body '{"type":"end"}'`, []string{"--body", `{"type":"end"}`}}, + {`--q "say \"hi\""`, []string{"--q", `say "hi"`}}, + {`a\ b c`, []string{"a b", "c"}}, + {`""`, []string{""}}, + {`--x=""`, []string{"--x="}}, + {`it's"`, nil}, + } + for _, c := range cases { + got, err := SplitArgs(c.line) + if c.line == `it's"` { + if err != ErrUnclosedQuote { + t.Errorf("%q: want ErrUnclosedQuote, got %v %v", c.line, got, err) + } + continue + } + if err != nil || !reflect.DeepEqual(got, c.want) { + t.Errorf("%q: got %q %v, want %q", c.line, got, err, c.want) + } + } + if _, err := SplitArgs(`"open`); err != ErrUnclosedQuote { + t.Errorf("open double quote: %v", err) + } +} + +// When nothing starts with, contains or deeply names the word, the menu reads +// it as an abbreviation, as Claude Code's does. +func TestCompleteAbbreviations(t *testing.T) { + complete := Commands(tree(), extras) + cases := []struct { + line string + want []string + }{ + {"envpub", []string{"environment publish"}}, + {"prjl", []string{"project list"}}, + {"project lst", []string{"list"}}, + {"project get --pid", []string{"--project-id"}}, + {"environment publish --eid", []string{"--environment-id"}}, + {"nmnt", nil}, // the first letter must start a word + {"pro", []string{"project"}}, // a prefix match still wins alone + {"vx", nil}, // every letter must appear + } + for _, c := range cases { + got := labels(complete(c.line)) + if len(c.want) == 0 && len(got) == 0 { + continue + } + if !reflect.DeepEqual(got, c.want) { + t.Errorf("%q: got %q, want %q", c.line, got, c.want) + } + } +} + +func TestFuzzyScorePrefersWordStartsAndRuns(t *testing.T) { + better, ok1 := fuzzyScore("environment publish", "envpub") + worse, ok2 := fuzzyScore("environment-update-publish-settings", "envpub") + if !ok1 || !ok2 || better <= worse { + t.Errorf("a shorter label with the same matches should rank first: %d vs %d", better, worse) + } + if _, ok := fuzzyScore("project", "pjx"); ok { + t.Error("every letter must appear") + } + if _, ok := fuzzyScore("project", "jec"); ok { + t.Error("the first letter must start a word") + } +} diff --git a/internal/prompt/prompt.go b/internal/prompt/prompt.go new file mode 100644 index 00000000..d0da95a9 --- /dev/null +++ b/internal/prompt/prompt.go @@ -0,0 +1,560 @@ +// This file is not generated by Speakeasy. + +package prompt + +import ( + "io" + "strconv" + "strings" + "unicode/utf8" + + "github.com/charmbracelet/bubbles/cursor" + "github.com/charmbracelet/bubbles/textinput" + tea "github.com/charmbracelet/bubbletea" + "github.com/charmbracelet/lipgloss" + "github.com/charmbracelet/x/ansi" + "github.com/voiceflow/cli/internal/ui" +) + +// Options configures one Read. +type Options struct { + UI *ui.UI + In io.Reader + Out io.Writer + Width int // the terminal's columns; resizes are followed + Complete Completer // nil for no menu + History []string // earlier lines, oldest first, for ↑ and ↓ + Placeholder string // shown faint while the line is empty + // Keys enter a word of their own when pressed on an empty line, as if + // it were typed and run: {"ctrl+o": "more"}. + Keys map[string]string +} + +// maxRows is how many suggestions the menu shows at once; it scrolls with +// the selection. +const maxRows = 8 + +// Read shows the prompt and returns the line that was entered. ok is false +// when the person left instead: Ctrl-D, or Ctrl-C twice, on an empty line. +// +// The prompt is drawn inline, under whatever is already on screen, and +// replaced by a one-line echo of what was entered, so the scrollback reads +// like a shell session. +func Read(opts Options) (line string, ok bool, err error) { + m := newModel(opts) + final, err := tea.NewProgram(m, tea.WithInput(opts.In), tea.WithOutput(opts.Out)).Run() + if err != nil { + return "", false, err + } + fm := final.(*model) + return fm.line, !fm.exited, nil +} + +type model struct { + ui *ui.UI + input textinput.Model + width int + complete Completer + keys map[string]string + + history []string + histAt int // len(history) while editing a new line + draft string // the new line, kept while ↑ shows older ones + + suggestions []Suggestion + sel, top int // the selected row, and the first row shown + dismissed bool // Esc hid the menu until the line changes + browsing bool // / or Tab on an empty line opened every command + help bool // ? on an empty line opened the shortcuts + armed bool // Ctrl-C on an empty line; a second one exits + + searching bool // ctrl-r: searching history, as a shell does + query string // what the search looks for + hit int // the history line it found, or -1 + + done, exited bool + line string +} + +func newModel(o Options) *model { + in := textinput.New() + in.Prompt = "" + in.Placeholder = o.Placeholder + in.PlaceholderStyle = lipgloss.NewStyle() + if o.UI.Colored() { + in.PlaceholderStyle = in.PlaceholderStyle.Faint(true) + } + in.Cursor.SetMode(cursor.CursorStatic) + in.Focus() + m := &model{ui: o.UI, input: in, width: o.Width, complete: o.Complete, keys: o.Keys, history: o.History, histAt: len(o.History)} + m.resize() + return m +} + +func (m *model) Init() tea.Cmd { return nil } + +// boxWidth matches the home banner's, so the two boxes line up, but never +// wider than the terminal: a wrapped line breaks inline redraws. +func (m *model) boxWidth() int { + w := ui.BoxWidth(m.width) + if m.width > 0 && w > m.width { + w = m.width + } + return w +} + +// resize fits the input to the box: "│ ❯ " and " │" take 6 columns, and the +// input draws its cursor one column past its width. +func (m *model) resize() { m.input.Width = max(m.boxWidth()-7, 1) } + +func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { + switch msg := msg.(type) { + case tea.WindowSizeMsg: + m.width = msg.Width + m.resize() + return m, nil + case tea.KeyMsg: + return m.key(msg) + } + var cmd tea.Cmd + m.input, cmd = m.input.Update(msg) + return m, cmd +} + +func (m *model) key(k tea.KeyMsg) (tea.Model, tea.Cmd) { + if m.searching { + return m.searchKey(k) + } + key := k.String() + if key != "ctrl+c" { + m.armed = false + } + if key != "?" { + m.help = false // any other key closes the shortcuts + } + empty := m.input.Value() == "" + if word, ok := m.keys[key]; ok && empty { + m.line = word + return m.quit(false) + } + switch key { + case "?": + if empty { + m.help = !m.help + return m, nil + } + case "/": + // As in Claude Code, / opens every command. vf's commands have no + // slash, so it is not typed into the line. + if empty { + m.browse() + return m, nil + } + case "ctrl+c": + if m.input.Value() != "" { + m.setLine("") + return m, nil + } + if m.armed { + return m.quit(true) + } + m.armed = true + return m, nil + case "ctrl+d": + if m.input.Value() == "" { + return m.quit(true) + } + case "esc": + m.dismissed = true + return m, nil + case "ctrl+r": + m.searching, m.query, m.draft = true, "", m.input.Value() + m.hit = m.find(len(m.history)-1, "") + return m, nil + case "tab": + switch { + case empty && !m.menuVisible(): + m.browse() + case len(m.suggestions) == 0: + case m.dismissed: + m.dismissed = false + default: + m.accept() + } + return m, nil + case "up", "ctrl+p": + if m.menuVisible() { + m.move(-1) + } else { + m.recall(-1) + } + return m, nil + case "down", "ctrl+n": + if m.menuVisible() { + m.move(1) + } else { + m.recall(1) + } + return m, nil + case "enter": + if m.menuVisible() && m.enterCompletes() { + picked := m.suggestions[m.sel] + m.accept() + // Finishing a command that takes nothing more runs it, as Enter + // on a Claude Code slash command does: "vers" runs version. A + // group, or a command with flags to offer, waits for more; so + // does a flag, which waits for its value. + if len(m.suggestions) > 0 || strings.HasPrefix(picked.Label, "-") { + return m, nil + } + } + m.line = m.input.Value() + return m.quit(false) + } + + value, pos := m.input.Value(), m.input.Position() + var cmd tea.Cmd + m.input, cmd = m.input.Update(k) + if m.input.Value() != value { + m.dismissed, m.browsing = false, false + } + if m.input.Value() != value || m.input.Position() != pos { + m.refresh() + } + return m, cmd +} + +func (m *model) quit(exited bool) (tea.Model, tea.Cmd) { + m.done, m.exited = true, exited + return m, tea.Quit +} + +// split is the line before and after the cursor. +func (m *model) split() (before, after string) { + r := []rune(m.input.Value()) + pos := min(m.input.Position(), len(r)) + return string(r[:pos]), string(r[pos:]) +} + +func (m *model) setLine(v string) { + m.input.SetValue(v) + m.input.CursorEnd() + m.browsing = false + m.refresh() +} + +// browse opens the menu on an empty line with every command in it. +func (m *model) browse() { + m.browsing, m.dismissed = true, false + m.refresh() +} + +// refresh recomputes the menu for the text before the cursor. An empty line +// has no menu unless / or Tab asked for one: the footer says so instead. +func (m *model) refresh() { + m.suggestions, m.sel, m.top = nil, 0, 0 + before, _ := m.split() + if m.complete != nil && (m.browsing || strings.TrimSpace(before) != "") { + m.suggestions = m.complete(before) + } +} + +func (m *model) menuVisible() bool { return !m.dismissed && len(m.suggestions) > 0 } + +// enterCompletes is whether Enter should take the selected row rather than +// run the line: "proj" completes to "project ", and "project list" runs. +// +// A group never runs bare, since all it would do is print its help. Its name +// typed in full opens it ("environment" becomes "environment "), and with its +// commands in the menu, Enter takes the one the ❯ is on. A command's flags in +// the menu are different: Enter runs the command, and the flags wait for Tab. +func (m *model) enterCompletes() bool { + s := m.suggestions[m.sel] + before, _ := m.split() + if m.browsing && strings.TrimSpace(before) == "" { + return true // picking from the full list + } + word := before[min(s.From, len(before)):] + switch word { + case "": + return !strings.HasPrefix(s.Label, "-") // a group's commands, not flags + case s.Label: + return s.Group + } + return true // a partial word +} + +// accept puts the selected suggestion in place of the word being typed, +// followed by a space, and opens the menu for what can come next. +func (m *model) accept() { + s := m.suggestions[m.sel] + before, after := m.split() + head := before[:min(s.From, len(before))] + s.Label + if !strings.HasPrefix(after, " ") { + after = " " + after + } + m.input.SetValue(head + after) + m.input.SetCursor(utf8.RuneCountInString(head) + 1) + m.dismissed, m.browsing = false, false + m.refresh() +} + +func (m *model) move(d int) { + n := len(m.suggestions) + m.sel = (m.sel + d + n) % n + switch { + case m.sel < m.top: + m.top = m.sel + case m.sel >= m.top+maxRows: + m.top = m.sel - maxRows + 1 + } +} + +// recall steps through earlier lines. The menu stays hidden while it does, +// so ↑ and ↓ keep moving through history. +func (m *model) recall(d int) { + at := m.histAt + d + if at < 0 || at > len(m.history) { + return + } + if m.histAt == len(m.history) { + m.draft = m.input.Value() + } + m.histAt = at + line := m.draft + if at < len(m.history) { + line = m.history[at] + } + m.setLine(line) + m.dismissed = true +} + +// searchKey handles a key while ctrl-r searches history. Typing narrows the +// search to the newest line containing what was typed; ctrl-r again steps +// to an older one. Enter runs the line found, Tab puts it on the line to +// edit, and Esc goes back to what was there before. +func (m *model) searchKey(k tea.KeyMsg) (tea.Model, tea.Cmd) { + switch k.String() { + case "ctrl+r": + if m.hit >= 0 { + if older := m.find(m.hit-1, m.history[m.hit]); older >= 0 { + m.hit = older + } + } + case "enter": + m.searching = false + if m.hit >= 0 { + m.line = m.history[m.hit] + return m.quit(false) + } + m.setLine(m.draft) + case "tab", "right": + m.searching = false + if m.hit >= 0 { + m.setLine(m.history[m.hit]) + m.dismissed = true + } else { + m.setLine(m.draft) + } + case "esc", "ctrl+c", "ctrl+g": + m.searching = false + m.setLine(m.draft) + case "backspace": + if r := []rune(m.query); len(r) > 0 { + m.query = string(r[:len(r)-1]) + m.hit = m.find(len(m.history)-1, "") + } + default: + if k.Type == tea.KeyRunes || k.Type == tea.KeySpace { + m.query += string(k.Runes) + m.hit = m.find(len(m.history)-1, "") + } + } + return m, nil +} + +// find is the newest history line at or before index from that contains the +// query, ignoring case, and is not skip; -1 when there is none. +func (m *model) find(from int, skip string) int { + q := strings.ToLower(m.query) + for i := min(from, len(m.history)-1); i >= 0; i-- { + if m.history[i] != skip && strings.Contains(strings.ToLower(m.history[i]), q) { + return i + } + } + return -1 +} + +// searchRow is the line the search found, with the part that matched in +// bold; the box shows it in place of the line being edited. +func (m *model) searchRow() string { + if m.hit < 0 { + return "" + } + line := m.history[m.hit] + at := strings.Index(strings.ToLower(line), strings.ToLower(m.query)) + if m.query == "" || at < 0 { + return line + } + end := at + len(m.query) + return line[:at] + m.ui.Bold(line[at:end]) + line[end:] +} + +// searchFooter replaces the footer while ctrl-r searches: what is being +// looked for, then what the keys do, or that nothing matches. +func (m *model) searchFooter() string { + sep := " " + ui.Separator.Symbol() + " " + hint := sep + "ctrl-r older" + sep + "tab to edit" + sep + "esc to cancel" + if m.hit < 0 { + hint = sep + "no match" + sep + "esc to cancel" + } + return "search history: " + m.query + m.ui.Muted(hint) +} + +func (m *model) View() string { + u := m.ui + pointer := ui.Pointer.Symbol() + if m.done { + if m.exited { + // Not empty: the renderer leaves the last frame up when the + // final view is empty. This clears it and leaves the cursor + // where the box began. + return " " + } + // The trailing newline is the line the renderer clears on exit. + return u.Muted(pointer) + " " + strings.TrimSpace(m.line) + "\n" + } + + w := m.boxWidth() + inner := w - 4 + row := u.Accent(pointer) + " " + m.input.View() + if m.searching { + row = u.Accent(pointer) + " " + m.searchRow() + } + if pad := inner - lipgloss.Width(row); pad > 0 { + row += strings.Repeat(" ", pad) + } + lines := []string{ + u.Subtle("╭" + strings.Repeat("─", w-2) + "╮"), + u.Subtle("│") + " " + ansi.Truncate(row, inner, "") + " " + u.Subtle("│"), + u.Subtle("╰" + strings.Repeat("─", w-2) + "╯"), + } + + switch { + case m.searching: + lines = append(lines, " "+ansi.Truncate(m.searchFooter(), max(w-2, 0), "…")) + case m.menuVisible(): + lines = append(lines, m.menu(w)...) + case m.help: + lines = append(lines, m.shortcuts(w)...) + default: + lines = append(lines, " "+u.Muted(m.footer())) + } + return strings.Join(lines, "\n") +} + +// footer is the one muted line under the box when no menu is open: how to +// find commands while the line is empty, how to run it once it is not. +func (m *model) footer() string { + sep := " " + ui.Separator.Symbol() + " " + switch { + case m.armed: + return "Press Ctrl-C again to exit" + case m.input.Value() == "": + return "/ for commands" + sep + "? for shortcuts" + } + return "enter to run" + sep + "ctrl-c to clear" +} + +// shortcutKeys are the rows of the ? panel, in two columns. +var shortcutKeys = [][2]string{ + {"/ or tab", "all commands"}, + {"↑ ↓", "menu or history"}, + {"ctrl-r", "search history"}, + {"enter", "run, or finish a word"}, + {"esc", "hide the menu"}, + {"ctrl-c", "clear; twice exits"}, + {"ctrl-d", "exit"}, + {"ctrl-o", "show folded output"}, + {"clear", "clear the screen"}, + {"vf explore", "full-screen explorer"}, +} + +// shortcuts draws the ? panel: keys, and what they do muted beside them. Two +// columns when they fit in the box's width, one otherwise. +func (m *model) shortcuts(w int) []string { + column := func(rows [][2]string) (lines []string, width int) { + keyWidth := 0 + for _, r := range rows { + keyWidth = max(keyWidth, ansi.StringWidth(r[0])) + } + for _, r := range rows { + key := r[0] + strings.Repeat(" ", keyWidth-ansi.StringWidth(r[0])) + lines = append(lines, key+" "+m.ui.Muted(r[1])) + width = max(width, keyWidth+2+ansi.StringWidth(r[1])) + } + return lines, width + } + half := (len(shortcutKeys) + 1) / 2 + left, leftWidth := column(shortcutKeys[:half]) + right, rightWidth := column(shortcutKeys[half:]) + if 2+leftWidth+4+rightWidth > w { + all, _ := column(shortcutKeys) + for i := range all { + all[i] = ansi.Truncate(" "+all[i], w, "…") + } + return all + } + lines := make([]string, half) + for i := range lines { + lines[i] = " " + left[i] + if i < len(right) { + lines[i] += strings.Repeat(" ", leftWidth-lipgloss.Width(left[i])+4) + right[i] + } + } + return lines +} + +// menu draws the suggestions under the box: the selected row marked with ❯ +// in the accent color, what each one does muted beside it. +func (m *model) menu(w int) []string { + u := m.ui + end := min(m.top+maxRows, len(m.suggestions)) + shown := m.suggestions[m.top:end] + + labelWidth := 0 + for _, s := range shown { + labelWidth = max(labelWidth, utf8.RuneCountInString(s.Label)) + } + labelWidth = min(labelWidth, w/2) + + var lines []string + for i, s := range shown { + label := ansi.Truncate(s.Label, labelWidth, "…") + label += strings.Repeat(" ", labelWidth-ansi.StringWidth(label)) + detail := s.Detail + switch { + case s.Required && detail == "": + detail = "required" // most generated required flags have no usage text + case s.Required: + detail = "required " + ui.Separator.Symbol() + " " + detail + } + // " ❯ " + label + " " + detail, inside the box's width. + detail = ansi.Truncate(detail, max(w-4-labelWidth-2, 0), "…") + + mark := " " + if m.top+i == m.sel { + mark = u.Accent(ui.Pointer.Symbol()) + label = u.Accent(label) + } + line := " " + mark + " " + label + if detail != "" { + line += " " + u.Muted(detail) + } + lines = append(lines, line) + } + if more := len(m.suggestions) - end; more > 0 { + lines = append(lines, " "+u.Muted("↓ "+strconv.Itoa(more)+" more")) + } + return lines +} diff --git a/internal/prompt/prompt_test.go b/internal/prompt/prompt_test.go new file mode 100644 index 00000000..7dd7d654 --- /dev/null +++ b/internal/prompt/prompt_test.go @@ -0,0 +1,473 @@ +// This file is not generated by Speakeasy. It covers prompt.go. + +package prompt + +import ( + "fmt" + "io" + "strings" + "testing" + + tea "github.com/charmbracelet/bubbletea" + "github.com/charmbracelet/lipgloss" + "github.com/voiceflow/cli/internal/ui" +) + +func testModel(history ...string) *model { + return newModel(Options{ + UI: ui.New(io.Discard, ui.Options{Decorate: true}), + Width: 80, + Complete: Commands(tree(), extras), + History: history, + Placeholder: `Try "project list"`, + }) +} + +func (m *model) press(keys ...tea.KeyMsg) *model { + for _, k := range keys { + m.Update(k) + } + return m +} + +func (m *model) typed(s string) *model { + return m.press(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune(s)}) +} + +var ( + tab = tea.KeyMsg{Type: tea.KeyTab} + enter = tea.KeyMsg{Type: tea.KeyEnter} + esc = tea.KeyMsg{Type: tea.KeyEsc} + up = tea.KeyMsg{Type: tea.KeyUp} + down = tea.KeyMsg{Type: tea.KeyDown} + left = tea.KeyMsg{Type: tea.KeyLeft} + ctrlC = tea.KeyMsg{Type: tea.KeyCtrlC} + ctrlD = tea.KeyMsg{Type: tea.KeyCtrlD} + slash = tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune("/")} + quest = tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune("?")} + ctrlR = tea.KeyMsg{Type: tea.KeyCtrlR} + bksp = tea.KeyMsg{Type: tea.KeyBackspace} +) + +func TestTabCompletesAndOpensWhatComesNext(t *testing.T) { + m := testModel().typed("pro") + if !m.menuVisible() || m.suggestions[0].Label != "project" { + t.Fatalf("menu: %v", labels(m.suggestions)) + } + m.press(tab) + if got := m.input.Value(); got != "project " { + t.Fatalf("after tab: %q", got) + } + if got := labels(m.suggestions); strings.Join(got, ",") != "get,list" { + t.Errorf("menu after tab: %v", got) + } + m.press(down, tab) + if got := m.input.Value(); got != "project list " { + t.Errorf("after down, tab: %q", got) + } +} + +func TestEnterFinishesAWordThenRuns(t *testing.T) { + m := testModel().typed("proj") + m.press(enter) + if m.done || m.input.Value() != "project " { + t.Fatalf("enter on a partial word should complete it: done=%v %q", m.done, m.input.Value()) + } + m.typed("list").press(enter) + if !m.done || m.exited || m.line != "project list" { + t.Fatalf("enter on a whole command should submit: done=%v exited=%v %q", m.done, m.exited, m.line) + } + if got := testModel().typed("version ").press(enter).View(); got != "❯ version\n" { + t.Errorf("the echo drops trailing space: %q", got) + } + if got := m.View(); got != "❯ project list\n" { + t.Errorf("final view %q", got) + } +} + +func TestEnterRunsWhatTheMenuCannotHelpWith(t *testing.T) { + // A flag's value: no menu, so Enter runs the line as typed. + m := testModel().typed("project get --project-id abc").press(enter) + if !m.done || m.line != "project get --project-id abc" { + t.Errorf("done=%v %q", m.done, m.line) + } + // An empty line submits too; the caller prompts again. + if m := testModel().press(enter); !m.done || m.exited || m.line != "" { + t.Errorf("empty enter: done=%v exited=%v", m.done, m.exited) + } +} + +// A group never runs bare: all it would do is print its help, a wall of text +// in the middle of the prompt. +func TestEnterNeverRunsABareGroup(t *testing.T) { + // Picked from the full list, a group opens with its commands in the menu + // and the ❯ on the first. Enter takes that one, here a command that takes + // nothing more, so it runs. + m := testModel().press(slash, enter) + if m.done || m.input.Value() != "environment " || !m.menuVisible() { + t.Fatalf("picking environment: done=%v %q menu=%v", m.done, m.input.Value(), m.menuVisible()) + } + if m.press(enter); !m.done || m.line != "environment list " { + t.Fatalf("enter under environment: done=%v %q", m.done, m.line) + } + // The ❯ moved, Enter follows it; a command with flags waits for them. + m = testModel().press(slash, enter, down, enter) + if m.done || m.input.Value() != "environment publish " || !m.menuVisible() { + t.Fatalf("enter on publish: done=%v %q", m.done, m.input.Value()) + } + // A group's name typed in full opens it, as a partial name does. + m = testModel().typed("environment").press(enter) + if m.done || m.input.Value() != "environment " || !m.menuVisible() { + t.Fatalf("environment + enter: done=%v %q", m.done, m.input.Value()) + } + // Typed with its space, the menu already lists its commands: Enter takes + // the first, which has a required flag, so it waits for that. + m = testModel().typed("project ").press(enter) + if m.done || m.input.Value() != "project get " { + t.Fatalf("project + enter: done=%v %q", m.done, m.input.Value()) + } + // A command's flags in the menu do not stop it running: they wait for Tab. + m = testModel().typed("project list ").press(enter) + if !m.done || m.line != "project list " { + t.Errorf("project list + enter: done=%v %q", m.done, m.line) + } + // With the menu hidden, Enter runs the line as typed, group or not. + m = testModel().typed("environment ").press(esc, enter) + if !m.done || m.line != "environment " { + t.Errorf("esc then enter: done=%v %q", m.done, m.line) + } +} + +func TestDeepMatchReplacesTheWholeLine(t *testing.T) { + m := testModel().typed("publ").press(enter) + if got := m.input.Value(); got != "environment publish " { + t.Errorf("got %q", got) + } + if got := labels(m.suggestions); len(got) == 0 || got[0] != "--environment-id" { + t.Errorf("required flags should come next: %v", got) + } +} + +func TestSelectionWrapsAndScrolls(t *testing.T) { + m := testModel() + m.complete = func(string) []Suggestion { + var s []Suggestion + for i := range 12 { + s = append(s, Suggestion{Label: fmt.Sprintf("cmd%02d", i)}) + } + return s + } + m.typed("c") + m.press(up) + if m.sel != 11 || m.top != 4 { + t.Errorf("up from the first row: sel=%d top=%d", m.sel, m.top) + } + m.press(down) + if m.sel != 0 || m.top != 0 { + t.Errorf("down from the last row: sel=%d top=%d", m.sel, m.top) + } + view := m.View() + if !strings.Contains(view, "↓ 4 more") { + t.Errorf("view should count the rows below:\n%s", view) + } + if strings.Contains(view, "cmd08") { + t.Errorf("only %d rows show:\n%s", maxRows, view) + } +} + +func TestEscHidesTheMenuAndArrowsWalkHistory(t *testing.T) { + m := testModel("version", "project list") + m.press(up) + if got := m.input.Value(); got != "project list" { + t.Fatalf("up: %q", got) + } + if m.menuVisible() { + t.Error("the menu stays hidden while recalling, so up keeps walking history") + } + m.press(up, up) + if got := m.input.Value(); got != "version" { + t.Errorf("up past the oldest stays there: %q", got) + } + m.press(down, down) + if got := m.input.Value(); got != "" { + t.Errorf("down past the newest returns to the new line: %q", got) + } + + m = testModel("version").typed("pro") + m.press(esc) + if m.menuVisible() { + t.Fatal("esc should hide the menu") + } + m.press(up) + if got := m.input.Value(); got != "version" { + t.Errorf("with the menu hidden, up recalls: %q", got) + } + m.press(down) + if got := m.input.Value(); got != "pro" { + t.Errorf("down comes back to what was being typed: %q", got) + } +} + +func TestCtrlCClearsThenAsksThenExits(t *testing.T) { + m := testModel().typed("project") + m.press(ctrlC) + if m.done || m.input.Value() != "" { + t.Fatalf("ctrl-c with text clears it: done=%v %q", m.done, m.input.Value()) + } + m.press(ctrlC) + if m.done || !strings.Contains(m.View(), "Press Ctrl-C again to exit") { + t.Fatalf("first ctrl-c on an empty line asks:\n%s", m.View()) + } + m.typed("x").press(ctrlC) // typing disarms; this ctrl-c clears "x" + m.press(ctrlC) + if m.done { + t.Fatal("a ctrl-c after typing should ask again, not exit") + } + m.press(ctrlC) + if !m.done || !m.exited { + t.Fatal("the second ctrl-c in a row exits") + } + if m.View() != " " { + t.Errorf("exit view %q", m.View()) + } +} + +func TestCtrlDExitsOnlyOnAnEmptyLine(t *testing.T) { + m := testModel().typed("ab").press(left, ctrlD) + if m.done || m.input.Value() != "a" { + t.Errorf("ctrl-d with text deletes forward: done=%v %q", m.done, m.input.Value()) + } + if m := testModel().press(ctrlD); !m.done || !m.exited { + t.Error("ctrl-d on an empty line exits") + } +} + +func TestViewFitsTheTerminal(t *testing.T) { + for _, width := range []int{30, 40, 60, 80, 140} { + m := testModel() + m.Update(tea.WindowSizeMsg{Width: width, Height: 40}) + m.typed("project list --workspace-id a-very-long-value-that-scrolls-inside-the-box --") + box := min(ui.BoxWidth(width), width) + for i, line := range strings.Split(m.View(), "\n") { + w := lipgloss.Width(line) + if i < 3 && w != box { + t.Errorf("width %d: box line %d is %d wide, want %d: %q", width, i, w, box, line) + } + if w > width { + t.Errorf("width %d: line %d is %d wide: %q", width, i, w, line) + } + } + } +} + +func TestFooterAndPlaceholderOnAnEmptyLine(t *testing.T) { + view := testModel().View() + for _, want := range []string{"╭", `│ ❯ Try "project list"`, "\n / for commands · ? for shortcuts"} { + if !strings.Contains(view, want) { + t.Errorf("missing %q:\n%s", want, view) + } + } +} + +func TestMenuRows(t *testing.T) { + m := testModel().typed("environment publish ") + view := m.View() + for _, want := range []string{ + " ❯ --environment-id required · The environment", + " --project-id required · The project", + " --wait Wait for it", + } { + if !strings.Contains(view, want) { + t.Errorf("missing %q:\n%s", want, view) + } + } +} + +func TestRequiredFlagWithoutUsage(t *testing.T) { + m := testModel() + m.complete = func(string) []Suggestion { return []Suggestion{{Label: "--workspace-id", Required: true}} } + if view := m.typed("x").View(); !strings.Contains(view, " ❯ --workspace-id required\n") && !strings.HasSuffix(view, " ❯ --workspace-id required") { + t.Errorf("got:\n%s", view) + } +} + +func TestSlashOrTabOnAnEmptyLineListsEveryCommand(t *testing.T) { + all := []string{"environment", "project", "version", "exit", "clear"} + for name, open := range map[string]tea.KeyMsg{"/": slash, "tab": tab} { + m := testModel().press(open) + if got := labels(m.suggestions); !m.menuVisible() || strings.Join(got, ",") != strings.Join(all, ",") { + t.Errorf("%s: menu %v, want %v", name, got, all) + } + if m.input.Value() != "" { + t.Errorf("%s: the line should stay empty, got %q", name, m.input.Value()) + } + // Typing narrows it, as on any line. + m.typed("pro") + if got := labels(m.suggestions); strings.Join(got, ",") != "project" { + t.Errorf("%s then pro: %v", name, got) + } + // Deleting back to empty closes it again. + m.press(tea.KeyMsg{Type: tea.KeyBackspace}, tea.KeyMsg{Type: tea.KeyBackspace}, tea.KeyMsg{Type: tea.KeyBackspace}) + if m.menuVisible() { + t.Errorf("%s: menu still open on an empty line: %v", name, labels(m.suggestions)) + } + } + // With text on the line, / and ? are just characters. + if m := testModel().typed("project get --q a").press(slash, quest); m.input.Value() != "project get --q a/?" { + t.Errorf("got %q", m.input.Value()) + } +} + +func TestPastedSlashCompletes(t *testing.T) { + m := testModel().typed("/pro").press(tab) + if got := m.input.Value(); got != "/project " { + t.Errorf("got %q", got) + } +} + +func TestPickingFromTheFullList(t *testing.T) { + // A group opens what is under it. + m := testModel().press(slash, enter) + if m.done || m.input.Value() != "environment " { + t.Fatalf("enter on environment: done=%v %q", m.done, m.input.Value()) + } + // A command that takes nothing more runs at once. + m = testModel().press(slash, down, down, enter) + if !m.done || m.exited || m.line != "version " { + t.Fatalf("enter on version: done=%v %q", m.done, m.line) + } + m = testModel().press(slash, up, enter) // up wraps to the last row + if !m.done || strings.TrimSpace(m.line) != "clear" { + t.Fatalf("enter on clear: done=%v %q", m.done, m.line) + } + // So does a partial word that completes to one. + if m := testModel().typed("vers").press(enter); !m.done || strings.TrimSpace(m.line) != "version" { + t.Errorf("vers + enter: done=%v %q", m.done, m.line) + } + // Esc closes the list; Tab opens it again. + m = testModel().press(slash, esc) + if m.menuVisible() { + t.Fatal("esc should close the list") + } + if m.press(tab); !m.menuVisible() { + t.Error("tab should reopen it") + } +} + +func TestQuestionMarkTogglesShortcuts(t *testing.T) { + m := testModel().press(quest) + view := m.View() + for _, want := range []string{ + " / or tab " + "all commands", + "ctrl-c clear; twice exits", + "vf explore full-screen explorer", + } { + if !strings.Contains(view, want) { + t.Errorf("missing %q:\n%s", want, view) + } + } + if strings.Contains(view, "? for shortcuts") { + t.Error("the panel replaces the footer") + } + if m.press(quest); m.help { + t.Error("? again closes it") + } + m.press(quest).typed("p") + if m.help || m.input.Value() != "p" { + t.Errorf("typing closes it and types: help=%v %q", m.help, m.input.Value()) + } + // It fits narrow terminals by stacking. + for _, width := range []int{40, 60, 80, 120} { + m := testModel() + m.Update(tea.WindowSizeMsg{Width: width}) + m.press(quest) + lines := strings.Split(m.View(), "\n") + for _, l := range lines { + if lipgloss.Width(l) > width { + t.Errorf("width %d: %q is %d wide", width, l, lipgloss.Width(l)) + } + } + if rows := len(lines) - 3; (width >= 80) != (rows == (len(shortcutKeys)+1)/2) { + t.Errorf("width %d: %d rows", width, rows) + } + } +} + +func TestFooterOnceTheLineHasText(t *testing.T) { + m := testModel().typed("project get --project-id ") + if !strings.HasSuffix(m.View(), " enter to run · ctrl-c to clear") { + t.Errorf("got:\n%s", m.View()) + } +} + +func TestCtrlRSearchesHistoryNewestFirst(t *testing.T) { + m := testModel("project list", "environment publish --project-id p1", "version", "environment publish --project-id p2", "environment publish --project-id p2") + m.typed("half typed").press(ctrlR) + if !m.searching || m.history[m.hit] != "environment publish --project-id p2" { + t.Fatalf("ctrl-r should start at the newest line, got %d", m.hit) + } + m.typed("PUBL") + if got := m.history[m.hit]; got != "environment publish --project-id p2" { + t.Errorf("typing narrows to the newest match, ignoring case: %q", got) + } + if view := m.View(); !strings.Contains(view, "environment publish --project-id p2") || !strings.Contains(view, "search history: PUBL") { + t.Errorf("the box shows the match and the footer the search:\n%s", view) + } + m.press(ctrlR) + if got := m.history[m.hit]; got != "environment publish --project-id p1" { + t.Errorf("ctrl-r again steps to an older line, past repeats: %q", got) + } + m.press(ctrlR) + if got := m.history[m.hit]; got != "environment publish --project-id p1" { + t.Errorf("at the oldest match it stays put: %q", got) + } + m.press(enter) + if !m.done || m.line != "environment publish --project-id p1" { + t.Errorf("enter runs the line found: done=%v %q", m.done, m.line) + } +} + +func TestCtrlRTabEditsAndEscRestores(t *testing.T) { + m := testModel("project list", "version").typed("draft").press(ctrlR).typed("proj").press(tab) + if m.searching || m.done || m.input.Value() != "project list" { + t.Errorf("tab puts the match on the line to edit: searching=%v done=%v %q", m.searching, m.done, m.input.Value()) + } + m = testModel("project list").typed("draft").press(ctrlR).typed("proj").press(esc) + if m.searching || m.input.Value() != "draft" { + t.Errorf("esc goes back to what was typed: %q", m.input.Value()) + } + m = testModel("project list").press(ctrlR).typed("zzz") + if m.hit != -1 || !strings.Contains(m.View(), "no match") { + t.Errorf("a search with no match says so:\n%s", m.View()) + } + m.press(bksp, bksp, bksp) + if m.hit != 0 { + t.Errorf("backspace widens the search again: %d", m.hit) + } + m.typed("zzz").press(enter) + if m.done || m.searching { + t.Errorf("enter with no match leaves the search without running anything") + } +} + +func TestTabTakesAnAbbreviation(t *testing.T) { + m := testModel().typed("envpub").press(tab) + if got := m.input.Value(); got != "environment publish " { + t.Errorf("got %q", got) + } +} + +func TestAKeyRunsItsWordOnAnEmptyLine(t *testing.T) { + ctrlO := tea.KeyMsg{Type: tea.KeyCtrlO} + opts := Options{UI: ui.New(io.Discard, ui.Options{Decorate: true}), Width: 80, Keys: map[string]string{"ctrl+o": "more"}} + m := newModel(opts) + m.press(ctrlO) + if !m.done || m.exited || m.line != "more" { + t.Errorf("ctrl-o on an empty line should run \"more\": done=%v %q", m.done, m.line) + } + m = newModel(opts) + m.typed("pro").press(ctrlO) + if m.done || m.input.Value() != "pro" { + t.Errorf("with text on the line the key does nothing: done=%v %q", m.done, m.input.Value()) + } +} diff --git a/internal/prompt/split.go b/internal/prompt/split.go new file mode 100644 index 00000000..a63ed4a8 --- /dev/null +++ b/internal/prompt/split.go @@ -0,0 +1,69 @@ +// This file is not generated by Speakeasy. + +package prompt + +import "errors" + +// ErrUnclosedQuote reports a line that ends inside a quoted word. +var ErrUnclosedQuote = errors.New("unclosed quote") + +// SplitArgs splits a line into arguments the way a POSIX shell would, minus +// expansion: words break at unquoted spaces, 'single quotes' keep everything +// literally, "double quotes" allow \" and \\, and a backslash outside quotes +// escapes the next character. So JSON can be passed as in a shell: +// --step.end '{"type":"end"}'. +func SplitArgs(line string) ([]string, error) { + var args []string + var word []byte + inWord := false + for i := 0; i < len(line); i++ { + c := line[i] + switch { + case c == ' ' || c == '\t': + if inWord { + args = append(args, string(word)) + word, inWord = word[:0], false + } + case c == '\'': + inWord = true + end := indexFrom(line, i+1, '\'') + if end < 0 { + return nil, ErrUnclosedQuote + } + word = append(word, line[i+1:end]...) + i = end + case c == '"': + inWord = true + i++ + for ; i < len(line) && line[i] != '"'; i++ { + if line[i] == '\\' && i+1 < len(line) && (line[i+1] == '"' || line[i+1] == '\\') { + i++ + } + word = append(word, line[i]) + } + if i >= len(line) { + return nil, ErrUnclosedQuote + } + case c == '\\' && i+1 < len(line): + inWord = true + i++ + word = append(word, line[i]) + default: + inWord = true + word = append(word, c) + } + } + if inWord { + args = append(args, string(word)) + } + return args, nil +} + +func indexFrom(s string, from int, c byte) int { + for i := from; i < len(s); i++ { + if s[i] == c { + return i + } + } + return -1 +} diff --git a/internal/sdk/models/components/optional_literal_flags_test.go b/internal/sdk/models/components/optional_literal_flags_test.go new file mode 100644 index 00000000..1d671177 --- /dev/null +++ b/internal/sdk/models/components/optional_literal_flags_test.go @@ -0,0 +1,79 @@ +// This file is not generated by Speakeasy. It pins the fix in +// .speakeasy/overlays/optional-literal-flags.yaml: the API sends each of these +// flags only when it is true, and the CLI must keep "absent" distinct from +// "true" when it decodes a response and encodes it again for output. + +package components + +import ( + "encoding/json" + "testing" +) + +type roundTrip interface { + json.Marshaler + json.Unmarshaler +} + +func TestOptionalLiteralFlagsRoundTrip(t *testing.T) { + cases := []struct { + name string + flag string + absent string + present string + decoded func() (roundTrip, func() *bool) + }{ + { + name: "StableWorkflowLink.overridden", flag: "overridden", + absent: `{"port":"next","label":"","to":"b2"}`, + present: `{"port":"next","label":"","to":"b2","overridden":true,"effectiveTo":"b3"}`, + decoded: func() (roundTrip, func() *bool) { v := &StableWorkflowLink{}; return v, v.GetOverridden }, + }, + { + name: "StableEnvironmentSearchTextReadResponse.incomplete", flag: "incomplete", + absent: `{}`, + present: `{"incomplete":true}`, + decoded: func() (roundTrip, func() *bool) { + v := &StableEnvironmentSearchTextReadResponse{} + return v, v.GetIncomplete + }, + }, + { + name: "StableTranscriptGrepResponse.literalText", flag: "literalText", + absent: `{}`, + present: `{"literalText":true}`, + decoded: func() (roundTrip, func() *bool) { v := &StableTranscriptGrepResponse{}; return v, v.GetLiteralText }, + }, + } + + for _, c := range cases { + t.Run(c.name, func(t *testing.T) { + for _, sent := range []bool{false, true} { + input := c.absent + if sent { + input = c.present + } + v, get := c.decoded() + if err := v.UnmarshalJSON([]byte(input)); err != nil { + t.Fatalf("decoding %s: %v", input, err) + } + + if got := get(); (got != nil) != sent || (sent && !*got) { + t.Errorf("API sent %s=%v, getter returned %v", c.flag, sent, got) + } + + raw, err := v.MarshalJSON() + if err != nil { + t.Fatal(err) + } + var out map[string]any + if err := json.Unmarshal(raw, &out); err != nil { + t.Fatal(err) + } + if got, present := out[c.flag]; present != sent || (sent && got != true) { + t.Errorf("API sent %s=%v, CLI printed %s", c.flag, sent, raw) + } + } + }) + } +} diff --git a/internal/sdk/models/components/stableenvironmentsearchtextreadresponse.go b/internal/sdk/models/components/stableenvironmentsearchtextreadresponse.go index 3a8e52c9..d147c1e1 100644 --- a/internal/sdk/models/components/stableenvironmentsearchtextreadresponse.go +++ b/internal/sdk/models/components/stableenvironmentsearchtextreadresponse.go @@ -5,7 +5,6 @@ package components import ( "github.com/voiceflow/cli/internal/sdk/sdkinternal/utils" - "github.com/voiceflow/cli/internal/sdk/types" ) type StableEnvironmentSearchTextReadResponse struct { @@ -17,8 +16,7 @@ type StableEnvironmentSearchTextReadResponse struct { HasMore bool `json:"hasMore"` NextOffset *int64 `json:"nextOffset,omitzero"` // Present when the search did not read everything: it stopped at its time limit, or a regular expression read only the first 1,000 characters of a longer line. The counts cover only what it read. - //lint:ignore U1000 accessed via reflection for JSON marshaling - incomplete *bool `const:"true" json:"incomplete,omitzero"` + Incomplete *bool `json:"incomplete,omitzero"` // What this search never reads. NotSearched []string `json:"notSearched"` } @@ -70,7 +68,10 @@ func (s *StableEnvironmentSearchTextReadResponse) GetNextOffset() *int64 { } func (s *StableEnvironmentSearchTextReadResponse) GetIncomplete() *bool { - return types.Pointer(true) + if s == nil { + return nil + } + return s.Incomplete } func (s *StableEnvironmentSearchTextReadResponse) GetNotSearched() []string { diff --git a/internal/sdk/models/components/stabletranscriptgrepresponse.go b/internal/sdk/models/components/stabletranscriptgrepresponse.go index 7b2be0f7..3ca49a7c 100644 --- a/internal/sdk/models/components/stabletranscriptgrepresponse.go +++ b/internal/sdk/models/components/stabletranscriptgrepresponse.go @@ -5,7 +5,6 @@ package components import ( "github.com/voiceflow/cli/internal/sdk/sdkinternal/utils" - "github.com/voiceflow/cli/internal/sdk/types" ) type StableTranscriptGrepResponse struct { @@ -22,8 +21,7 @@ type StableTranscriptGrepResponse struct { Skipped *int64 `json:"skipped,omitzero"` Note *string `json:"note,omitzero"` // The pattern ran as plain text; `note` says why. - //lint:ignore U1000 accessed via reflection for JSON marshaling - literalText *bool `const:"true" json:"literalText,omitzero"` + LiteralText *bool `json:"literalText,omitzero"` Hits []StableTranscriptGrepHit `json:"hits"` } @@ -88,7 +86,10 @@ func (s *StableTranscriptGrepResponse) GetNote() *string { } func (s *StableTranscriptGrepResponse) GetLiteralText() *bool { - return types.Pointer(true) + if s == nil { + return nil + } + return s.LiteralText } func (s *StableTranscriptGrepResponse) GetHits() []StableTranscriptGrepHit { diff --git a/internal/sdk/models/components/stableworkflowlink.go b/internal/sdk/models/components/stableworkflowlink.go index ef642909..a9b10286 100644 --- a/internal/sdk/models/components/stableworkflowlink.go +++ b/internal/sdk/models/components/stableworkflowlink.go @@ -5,7 +5,6 @@ package components import ( "github.com/voiceflow/cli/internal/sdk/sdkinternal/utils" - "github.com/voiceflow/cli/internal/sdk/types" ) type StableWorkflowLink struct { @@ -17,8 +16,7 @@ type StableWorkflowLink struct { // The port actions this exit runs, in order, before it reaches to. Actions []StableWorkflowPortAction `json:"actions,omitzero"` // Present when this link does not run, because the step is not the last of its block. - //lint:ignore U1000 accessed via reflection for JSON marshaling - overridden *bool `const:"true" json:"overridden,omitzero"` + Overridden *bool `json:"overridden,omitzero"` // With overridden: the step that runs instead. EffectiveTo *string `json:"effectiveTo,omitzero"` } @@ -63,7 +61,10 @@ func (s *StableWorkflowLink) GetActions() []StableWorkflowPortAction { } func (s *StableWorkflowLink) GetOverridden() *bool { - return types.Pointer(true) + if s == nil { + return nil + } + return s.Overridden } func (s *StableWorkflowLink) GetEffectiveTo() *string { diff --git a/internal/sdk/models/components/stableworkflowportactionsaddrequest.go b/internal/sdk/models/components/stableworkflowportactionsaddrequest.go index 60993220..e74fb390 100644 --- a/internal/sdk/models/components/stableworkflowportactionsaddrequest.go +++ b/internal/sdk/models/components/stableworkflowportactionsaddrequest.go @@ -6,7 +6,6 @@ package components import ( "github.com/voiceflow/cli/internal/sdk/optionalnullable" "github.com/voiceflow/cli/internal/sdk/sdkinternal/utils" - "github.com/voiceflow/cli/internal/sdk/types" ) type StableWorkflowPortActionsAddRequest struct { @@ -15,8 +14,7 @@ type StableWorkflowPortActionsAddRequest struct { // Add them after this action. Leave out afterActionID and atStart to add them at the end, before an action that ends the path. AfterActionID *string `json:"afterActionID,omitzero"` // Add them before every other action on this exit. - //lint:ignore U1000 accessed via reflection for JSON marshaling - atStart *bool `const:"true" json:"atStart,omitzero"` + AtStart *bool `json:"atStart,omitzero"` // The IDs in this exit's actions from your last read, in order. Send [] when it has none. ExpectedActions []string `json:"expectedActions"` // The block the path goes to after the actions. Leave it out to keep the current one. Send null to clear it. @@ -49,7 +47,10 @@ func (s *StableWorkflowPortActionsAddRequest) GetAfterActionID() *string { } func (s *StableWorkflowPortActionsAddRequest) GetAtStart() *bool { - return types.Pointer(true) + if s == nil { + return nil + } + return s.AtStart } func (s *StableWorkflowPortActionsAddRequest) GetExpectedActions() []string { diff --git a/internal/sdk/models/components/stableworkflowstepinsertrequest.go b/internal/sdk/models/components/stableworkflowstepinsertrequest.go index 2a063c4f..3378c532 100644 --- a/internal/sdk/models/components/stableworkflowstepinsertrequest.go +++ b/internal/sdk/models/components/stableworkflowstepinsertrequest.go @@ -5,15 +5,13 @@ package components import ( "github.com/voiceflow/cli/internal/sdk/sdkinternal/utils" - "github.com/voiceflow/cli/internal/sdk/types" ) type StableWorkflowStepInsertRequest struct { // Insert right after this step of the block. Send this or atStart. AfterStepID *string `json:"afterStepID,omitzero"` // Insert as the first step of the block. Send this or afterStepID. - //lint:ignore U1000 accessed via reflection for JSON marshaling - atStart *bool `const:"true" json:"atStart,omitzero"` + AtStart *bool `json:"atStart,omitzero"` Step StableWorkflowStepInput `json:"step"` // The block's step IDs exactly as your last read returned them. If the block changed, nothing is written. ExpectedSteps []string `json:"expectedSteps"` @@ -40,7 +38,10 @@ func (s *StableWorkflowStepInsertRequest) GetAfterStepID() *string { } func (s *StableWorkflowStepInsertRequest) GetAtStart() *bool { - return types.Pointer(true) + if s == nil { + return nil + } + return s.AtStart } func (s *StableWorkflowStepInsertRequest) GetStep() StableWorkflowStepInput { diff --git a/internal/ui/DESIGN.md b/internal/ui/DESIGN.md new file mode 100644 index 00000000..6148be01 --- /dev/null +++ b/internal/ui/DESIGN.md @@ -0,0 +1,261 @@ +# vf terminal design + +The spec for everything vf shows a person at a terminal. `internal/ui` implements +it; `output.UI` decides when it applies. The goal is the quality bar of Claude +Code's CLI, in Voiceflow's colors. It is also the spec the `vfe` CLI +(voiceflow/engine) should converge on, so the two read as siblings. + +## Rules + +1. **Machine output is untouchable.** JSON, YAML, TOON, `--jq` output, and + everything in agent mode carry no color and no glyphs, byte for byte what they + carry today. Agents are a primary user of vf; styling is for people. +2. **Decide per stream.** `vf project list | jq` pipes stdout, but an error from + that run still lands on a terminal on stderr, and can still be styled. +3. **One accent.** Voiceflow blue is the only fixed color. If everything is + accented, nothing is. +4. **State colors mean state.** Green, yellow and red say worked, look, failed. + Never decoration. +5. **One glyph, one meaning.** The vocabulary below is closed; add to it here + first. +6. **Words when not decorating.** Off a terminal, a status reads + `Error: …`, not `✗ …`, so logs and CI output stay greppable. +7. **Respect the user's switches:** `--color=never|always|auto`, `NO_COLOR`, + `FORCE_COLOR`, `TERM=dumb`. Color may follow `--color=always` into a pipe; + glyphs, boxes and motion never do. + +## Color roles + +| Role | Value | Use for | +|---|---|---| +| Accent | `#397DFF`, Voiceflow blue (creator-app, vfe) | the name or ID that matters, the selected row, the prompt | +| Muted | the terminal's faint attribute | hints, timestamps, counts, the version | +| Subtle | ANSI bright black | borders, rules, separators | +| Bold | bold | headings, labels | +| Success | ANSI green | it worked | +| Warning | ANSI yellow | it worked, but look | +| Error | ANSI red | it failed | + +State colors are the terminal's own ANSI colors, so the user's theme picks +shades that read on its background. Muted is the faint attribute for the same +reason: it dims whatever the foreground already is, light theme or dark. The one +fixed color, `#397DFF`, measures 3.8:1 against white and 5.5:1 against black, +enough for the short strings it is meant for (names, IDs) on either theme, but +not for paragraphs. Known weak spot: some light themes ship an unreadable +yellow, so Warning colors glyphs and short words, never sentences. + +## Glyphs + +| Glyph | Symbol | ASCII | Means | +|---|---|---|---| +| Action | `⏺` on macOS, `●` elsewhere | `*` | something vf did, or is doing | +| Result | `⎿` | `-` | what came back from the line above | +| Working | `✻` | `*` | in progress | +| Pointer | `❯` | `>` | the selected row; the prompt | +| Done | `✓` | `+` | it worked | +| Failed | `✗` | `x` | it failed | +| Warn | `⚠` | `!` | it worked, but look | +| Separator | `·` | `\|` | between inline items | +| Empty | `—` | `-` | a value that is not there | + +Action follows Claude Code: macOS fonts draw U+23FA as a clean dot, while +Windows and many Linux fonts draw it as an emoji or a box. + +## Status lines + +``` +✓ Published v12 Published v12 +⚠ Token expires in 2 days Warning: Token expires in 2 days +✗ Couldn't reach the Voiceflow API Error: Couldn't reach the Voiceflow API + at a terminal anywhere else +``` + +Only the glyph takes the state color; the message stays in the default color. + +## Layout (for the components that build on this) + +- **Inline, not full-screen.** One-shot commands print into the scrollback and + leave it there. Full-screen is only for sessions the user opens on purpose + (`vf explore`). That is why bare `vf` prints the home banner and opens the + home prompt under it, inline, rather than opening the explorer as it once + did. +- **Width** follows the terminal, between 80 and 100 columns. +- **Boxes** have rounded corners (`╭╮╰╯`) in Subtle, with the title set into the + top border: `╭─ Voiceflow CLI v0.2.349 ───╮`. The home banner is the one box + with an Accent border, as in vfe's and Claude Code's welcome boxes. +- **Tables** have no outer box: a bold header row, two-space gutters, IDs in + Accent, timestamps in Muted, empty cells as `—`. +- **Results** indent under the line that produced them: + `⏺ Running test suite` then ` ⎿ 38 passed · 2 failed`. +- **Errors** say what happened, why, and the fix: a `✗` line, a `⎿` line with + the cause, then the command that resolves it in Accent. +- **Motion**: anything that can take longer than about 300 ms shows `✻` with the + elapsed time and how to cancel. Never in a pipe. `ui.Spin` draws it, + animating Claude Code's frames (`· ✢ ✳ ✶ ✻ ✽`) on one line it erases when + done: `✻ Waiting for you to sign in in your browser… 12s · ctrl-c to cancel`. + Every API call gets one on stderr once it has run for 300 ms, saying what + the command does (`✻ List projects… 2s · ctrl-c to cancel`); a quicker + call draws nothing (`internal/client/spinner.go`). +- **Sign-in** (`vf auth login`, `signup`, `logout`, `whoami`) says who and + where, then only what needs attention: a session that will not renew, a + `VF_TOKEN` that outranks it, tokens in a file because there is no keychain. + Scopes, storage and expiry are in `vf whoami`, not on the main path. + +## Home banner + +What bare `vf` prints at a terminal (`internal/cli/home.go`, drawn by +`ui.Banner`), here at 80 columns. Off a terminal, in agent mode, or with +`TERM=dumb`, bare `vf` prints help, unchanged. + +``` +╭─ Voiceflow CLI v0.350.0 ─────────────────────────────────────────────────────╮ +│ │ +│ _ __ _ Get started │ +│ /\ /\___ (_) ___ ___ / _| | _____ __ vf workspace list │ +│ \ \ / / _ \| |/ __/ _ \ |_| |/ _ \ \ /\ / / your workspaces │ +│ \ V / (_) | | (_| __/ _| | (_) \ V V / vf explore │ +│ \_/ \___/|_|\___\___|_| |_|\___/ \_/\_/ browse every command │ +│ vf docs search │ +│ ✓ Using the access token from VF_TOKEN search the docs │ +│ │ +│ In a coding agent │ +│ Claude Code, Cursor and │ +│ Codex get agent mode │ +│ automatically: TOON output │ +│ and structured errors. │ +│ │ +╰──────────────────────────────────────────────────────────────────────────────╯ +``` + +- **Left:** the creator-app wordmark in Accent (the same lines as vfe's + banner and the browser console), then the sign-in line. +- **Right:** a Bold heading per section; commands in Accent, what they do in + Muted. Signed out, "Get started" offers `vf auth login` and `vf auth signup` + first. +- **Sign-in** names the credential the next request would send, in the + client's order: `--token`, `VF_TOKEN`, a browser session, then a token saved + by `vf configure`. It reads only local state and calls no API, so the banner + is instant and works offline. +- **Width:** two columns from 78 columns, so an 80-column terminal gets the + full layout. Narrower, the sections stack under the sign-in line, and below + 49 columns the wordmark is left out. Tips share one command column when every + tip fits on its row; otherwise each description drops under its command. + +## Home prompt + +Under the banner, when stdin is a terminal and `--no-interactive` is not set, +bare `vf` opens a prompt (`internal/prompt`, run by `internal/cli/home.go`). It +reads a line, runs it as a vf command with its output inline, and comes back, +like Claude Code's and vfe's prompts. Signed out, the placeholder suggests +`auth login`. + +``` +╭──────────────────────────────────────────────────────────────────────────────╮ +│ ❯ environment publish │ +╰──────────────────────────────────────────────────────────────────────────────╯ + ❯ --environment-alias required + --name required · The name of the release created by publishi… + --project-id required + --body Request body as JSON (alternative to individual flags)… + --description An optional description of what changed in this releas… +``` + +- **The box** is the banner's width with a Subtle border; the `❯` is Accent. +- **The menu** follows the word being typed: commands while the line names a + command (prefix matches, then names containing it, then, from three letters, + deeper commands: `publ` offers `environment publish`), then that command's + flags, required first. When nothing matches, the word is read as an + abbreviation, its letters in order and the first starting a word: `envpub` + offers `environment publish`, `--pid` offers `--project-id`. Global flags appear once a `-` is typed. Eight rows + at most, scrolling with the selection, with a `↓ N more` row. +- **Every command, from an empty line:** `/` (as in Claude Code) or Tab opens + the menu with all of them, then `exit` and `clear`; typing narrows it. The + `/` is not typed into the line, and a pasted `/project list` runs as + `project list`. +- **Keys:** Tab or Enter completes the word. Enter on a command that takes + nothing more runs it (`vers` runs `version`); a group or a command with flags + waits for the rest. +- **A group never runs bare**, since all it would do is print its help. Its + name typed in full opens it like a partial name, and with its commands in the + menu, Enter takes the one the `❯` is on. A command's flags in the menu do not + stop Enter running the command; they wait for Tab. With the menu hidden (Esc), + Enter runs the line as typed. +- **More keys:** ↑↓ move through the menu or, with no menu, through + history; Esc hides the menu; Ctrl-C clears the line, and twice on an empty + line exits, as does Ctrl-D or `exit`. `clear` clears the screen. A leading + `vf` is ignored. +- **History** outlives the session, as a shell's does: the newest 1,000 + lines in `~/.config/vf/history`, readable by its owner only. A line that + may hold a credential (a token, `vfp_`, a secret, a password, an API key) + is never written there. Ctrl-R searches it, newest first, showing the match + in the box and `search history: publ` under it; Ctrl-R again steps older, + Enter runs the match, Tab puts it on the line to edit, Esc goes back. +- **Long output folds,** as Claude Code folds long tool output: a result + taller than the screen prints a screenful, then one Muted line, + `… +182 lines · ctrl-o to show them`. Ctrl-O on an empty line, or `more`, + prints the rest. A few lines over never fold. Only inside the prompt and + at a terminal (`internal/output/fold.go`); a shell, a pipe and agent mode + always get every line. +- **The footer** is one muted line: `/ for commands · ? for shortcuts` on an + empty line, `enter to run · ctrl-c to clear` once there is text. `?` on an + empty line swaps it for the shortcuts, in two columns where they fit; any + other key puts it back: + +``` + / or tab all commands ctrl-c clear; twice exits + ↑ ↓ menu or history ctrl-d exit + ctrl-r search history ctrl-o show folded output + enter run, or finish a word clear clear the screen + esc hide the menu vf explore full-screen explorer +``` + +- **Group descriptions** are what the `/` menu and help list, so each group + has one written for it: what you do there, verb first, under 52 characters + ("Publish, clone, merge and compare environments"). Speakeasy's fallback, + "Operations for ", fails `TestEveryGroupHasADescription`; write the + description in the group's `root.go` (`Short` and `Long`), where persistent + edits keep it through regeneration. +- **The banner is not kept on screen.** It scrolls away with the output, as + Claude Code's and vfe's do; `clear` brings it back. +- **Each line runs as its own `vf`:** a fresh command tree, with config and + agent mode reloaded, so no flag leaks into the next line. Quoting follows the + shell (`--body '{"type":"end"}'`). Ctrl-C while a command runs cancels it + and brings the prompt back; a second one exits. +- **The scrollback** keeps a one-line echo, `❯ environment publish …` in Muted, + above each command's output, so a session reads like a shell's. +- **Help inside the prompt** (`internal/cli/prompt_help.go`) leaves out the + global flags, two dozen lines that are the same on every command. A group + lists its commands as the menu does, names in Accent and what they do in + Muted, then `workflow --help shows a command's flags`. A command + keeps Cobra's Usage, Examples and Required/Optional Flags, then one Muted + line pointing at the global flags. `--help` on its own lists every group and + the global flags. Outside the prompt, and in agent mode, help is Cobra's, + unchanged: agents read it to learn `--output-format`, `--jq` and + `--dry-run`. + +``` +❯ workflow --help +Build workflows: blocks, steps, branches and links + + add-actions Add port actions + add-blocks Add workflow blocks + … + update-step Update workflow step + +workflow --help shows a command's flags +``` + +## Aligning vfe + +`vfe` already shares the accent, the rounded banner with its title in the +border, and the green/yellow/red status mapping. Three differences to resolve +there: cyan as a second accent (IDs, the selected autocomplete row) should +become Accent; cli-table3's fully boxed tables should become the borderless +tables above; and its `Error: ` lines should become status lines. + +## Not decided yet + +- **Light and dark palettes.** Not needed while the only fixed color reads on + both; revisit if a second fixed color is ever added. +- **"What's new" in the banner.** vfe and Claude Code have one; vf needs a + changelog it can read offline before it can. diff --git a/internal/ui/banner.go b/internal/ui/banner.go new file mode 100644 index 00000000..d0dc131d --- /dev/null +++ b/internal/ui/banner.go @@ -0,0 +1,250 @@ +// This file is not generated by Speakeasy. + +package ui + +import ( + "strings" + + "github.com/charmbracelet/lipgloss" +) + +// Wordmark is Voiceflow's ASCII wordmark, verbatim from the browser-console +// banner in creator-app (apps/creator-app/src/setup.ts), the same one vfe's +// welcome banner uses. Keep the three in step. +var Wordmark = []string{ + ` _ __ _`, + `/\ /\___ (_) ___ ___ / _| | _____ __`, + `\ \ / / _ \| |/ __/ _ \ |_| |/ _ \ \ /\ / /`, + ` \ V / (_) | | (_| __/ _| | (_) \ V V /`, + ` \_/ \___/|_|\___\___|_| |_|\___/ \_/\_/`, +} + +// Banner is vf's home screen: the box bare `vf` prints at a terminal. It +// follows Claude Code's welcome box, as vfe's does: the product and version +// set into the top border, the wordmark and account state on the left, and +// what to do next on the right. +type Banner struct { + Product string // "Voiceflow CLI" + Version string // "0.350.0"; shown muted after the product + Account Line // the sign-in state, under the wordmark + Sections []Section +} + +// Line is a status line with an optional muted detail under it. +type Line struct { + Kind Status + Text string + Detail string +} + +// Section is a bold heading over commands to try, a muted note, or both. +type Section struct { + Heading string + Tips []Tip + Note string +} + +// Tip is a command and what it does. +type Tip struct { + Command string + Does string +} + +const ( + bannerMaxWidth = 100 // DESIGN.md: width follows the terminal, up to 100 + bannerMinWidth = 40 // narrower than this, the box wraps; it is still readable + bannerPadX = 2 // columns between the border and the content + bannerGap = 3 // columns between the two columns + bannerRightMin = 26 // the right column is never narrower than this + tipGap = 2 // columns between a command and what it does +) + +// Banner renders b for a terminal width columns wide. Every line it returns +// has the same display width, so the box closes on the right. +// +// From 78 columns the box has two columns, which keeps the common 80-column +// terminal on the full layout. Narrower, the sections stack under the account +// line, and below 49 columns the wordmark is left out because it would wrap. +func (u *UI) Banner(b Banner, width int) string { + w := BoxWidth(width) + inner := w - 2 - 2*bannerPadX + wordmarkWidth := blockWidth(Wordmark) + + var rows []string + if rightWidth := inner - wordmarkWidth - bannerGap; rightWidth >= bannerRightMin { + left := append(u.wordmark(), "") + left = append(left, u.account(b.Account, wordmarkWidth)...) + rows = joinColumns(left, wordmarkWidth, u.sections(b.Sections, rightWidth)) + } else { + if inner >= wordmarkWidth { + rows = append(u.wordmark(), "") + } + rows = append(rows, u.account(b.Account, inner)...) + rows = append(rows, "") + rows = append(rows, u.sections(b.Sections, inner)...) + } + + lines := []string{u.topBorder(b, w), u.boxRow("", inner)} + for _, r := range rows { + lines = append(lines, u.boxRow(r, inner)) + } + lines = append(lines, u.boxRow("", inner), u.Accent("╰"+strings.Repeat("─", w-2)+"╯")) + return strings.Join(lines, "\n") +} + +// BoxWidth is how wide a box is in a terminal columns wide: the terminal's +// width, between 40 and 100 columns. The home banner and the prompt under it +// share it, so their edges line up. +func BoxWidth(columns int) int { return min(max(columns, bannerMinWidth), bannerMaxWidth) } + +// topBorder sets the title into the border, the way Claude Code's welcome +// box does: ╭─ Voiceflow CLI v0.350.0 ──────╮. +func (u *UI) topBorder(b Banner, w int) string { + title := " " + b.Product + " " + styled := u.Accent(title) + if b.Version != "" { + title = " " + b.Product + " v" + b.Version + " " + styled = u.Accent(" "+b.Product+" ") + u.Muted("v"+b.Version) + " " + } + dashes := w - 3 - lipgloss.Width(title) + if dashes < 1 { + return u.Accent("╭" + strings.Repeat("─", w-2) + "╮") + } + return u.Accent("╭─") + styled + u.Accent(strings.Repeat("─", dashes)+"╮") +} + +func (u *UI) boxRow(content string, inner int) string { + pad := strings.Repeat(" ", bannerPadX) + return u.Accent("│") + pad + padRight(content, inner) + pad + u.Accent("│") +} + +func (u *UI) wordmark() []string { + rows := make([]string, len(Wordmark)) + for i, line := range Wordmark { + rows[i] = u.Accent(line) + } + return rows +} + +// account renders the sign-in line, with its detail indented under the text +// so it lines up past the glyph. +func (u *UI) account(l Line, width int) []string { + if l.Text == "" { + return nil + } + rows := wrap(l.Text, width-2) + rows[0] = u.Status(l.Kind, rows[0]) + for i := 1; i < len(rows); i++ { + rows[i] = " " + rows[i] + } + for _, d := range wrap(l.Detail, width-2) { + rows = append(rows, " "+u.Muted(d)) + } + return rows +} + +// sections renders each section in turn, a blank row between them. A +// section's tips share one command column when every tip fits on a line; +// otherwise each tip's description drops under its command. +func (u *UI) sections(ss []Section, width int) []string { + var rows []string + for i, s := range ss { + if i > 0 { + rows = append(rows, "") + } + if s.Heading != "" { + rows = append(rows, u.Bold(s.Heading)) + } + rows = append(rows, u.Tips(s.Tips, width)...) + for _, line := range wrap(s.Note, width) { + rows = append(rows, u.Muted(line)) + } + } + return rows +} + +// Tips renders commands to try, at most width columns wide: commands in +// Accent, what they do in Muted. They share one command column when every tip +// fits on its row; otherwise each description drops under its command. +func (u *UI) Tips(tips []Tip, width int) []string { + cmdWidth, inline := 0, true + for _, t := range tips { + cmdWidth = max(cmdWidth, lipgloss.Width(t.Command)) + } + for _, t := range tips { + if t.Does != "" && cmdWidth+tipGap+lipgloss.Width(t.Does) > width { + inline = false + } + } + var rows []string + for _, t := range tips { + switch { + case t.Does == "": + rows = append(rows, u.Accent(t.Command)) + case inline: + rows = append(rows, padRight(u.Accent(t.Command), cmdWidth+tipGap)+u.Muted(t.Does)) + default: + rows = append(rows, u.Accent(t.Command)) + for _, line := range wrap(t.Does, width-2) { + rows = append(rows, " "+u.Muted(line)) + } + } + } + return rows +} + +// joinColumns sets right beside left, left padded to leftWidth. +func joinColumns(left []string, leftWidth int, right []string) []string { + rows := make([]string, max(len(left), len(right))) + gap := strings.Repeat(" ", bannerGap) + for i := range rows { + var l, r string + if i < len(left) { + l = left[i] + } + if i < len(right) { + r = right[i] + } + rows[i] = padRight(l, leftWidth) + gap + r + } + return rows +} + +// padRight pads s with spaces to width display columns, ignoring the escape +// codes in it. +func padRight(s string, width int) string { + if n := width - lipgloss.Width(s); n > 0 { + return s + strings.Repeat(" ", n) + } + return s +} + +func blockWidth(lines []string) int { + w := 0 + for _, l := range lines { + w = max(w, lipgloss.Width(l)) + } + return w +} + +// wrap breaks plain text into lines at most width columns wide, at spaces. A +// single word longer than width gets a line of its own. +func wrap(s string, width int) []string { + if s == "" { + return nil + } + var lines []string + line := "" + for _, word := range strings.Fields(s) { + switch { + case line == "": + line = word + case lipgloss.Width(line)+1+lipgloss.Width(word) <= width: + line += " " + word + default: + lines = append(lines, line) + line = word + } + } + return append(lines, line) +} diff --git a/internal/ui/banner_test.go b/internal/ui/banner_test.go new file mode 100644 index 00000000..b7e822a3 --- /dev/null +++ b/internal/ui/banner_test.go @@ -0,0 +1,195 @@ +package ui + +import ( + "bytes" + "fmt" + "strings" + "testing" + + "github.com/charmbracelet/lipgloss" +) + +func sampleBanner() Banner { + return Banner{ + Product: "Voiceflow CLI", + Version: "1.2.3", + Account: Line{Kind: StatusDone, Text: "Using the access token in ~/.config/vf/config.yaml"}, + Sections: []Section{ + {Heading: "Get started", Tips: []Tip{ + {Command: "vf workspace list", Does: "your workspaces"}, + {Command: "vf explore", Does: "browse every command"}, + {Command: "vf docs search ", Does: "search the docs"}, + }}, + {Heading: "In a coding agent", Note: "Claude Code, Cursor and Codex get agent mode automatically: TOON output and structured errors."}, + }, + } +} + +func bannerPlain() *UI { return New(&bytes.Buffer{}, Options{Decorate: true}) } + +func bannerColored() *UI { return New(&bytes.Buffer{}, Options{Color: true, Decorate: true}) } + +// The box only reads as a box if every row is exactly as wide as the border, +// with or without the escape codes, at any terminal width. +func TestBannerClosesAtEveryWidth(t *testing.T) { + for _, u := range map[string]*UI{"plain": bannerPlain(), "color": bannerColored()} { + for _, width := range []int{20, 40, 48, 49, 60, 77, 78, 80, 100, 140} { + want := min(max(width, bannerMinWidth), bannerMaxWidth) + lines := strings.Split(u.Banner(sampleBanner(), width), "\n") + for i, line := range lines { + if got := lipgloss.Width(line); got != want { + t.Errorf("width %d, color %v: line %d is %d columns, want %d:\n%s", width, u.Colored(), i, got, want, line) + } + } + plain := stripped(lines) + if !strings.HasPrefix(plain[0], "╭─ Voiceflow CLI v1.2.3 ─") || !strings.HasSuffix(plain[0], "╮") { + t.Errorf("width %d: top border %q", width, plain[0]) + } + last := plain[len(plain)-1] + if !strings.HasPrefix(last, "╰─") || !strings.HasSuffix(last, "╯") { + t.Errorf("width %d: bottom border %q", width, last) + } + for _, line := range plain[1 : len(plain)-1] { + if !strings.HasPrefix(line, "│") || !strings.HasSuffix(line, "│") { + t.Errorf("width %d: side border missing on %q", width, line) + } + } + } + } +} + +func TestBannerLayoutFollowsWidth(t *testing.T) { + cases := []struct { + width int + twoColumns, wordmark bool + }{ + {100, true, true}, + {80, true, true}, + {78, true, true}, + {77, false, true}, + {49, false, true}, + {48, false, false}, + } + for _, c := range cases { + out := stripped(strings.Split(bannerPlain().Banner(sampleBanner(), c.width), "\n")) + text := strings.Join(out, "\n") + if got := strings.Contains(text, Wordmark[1]); got != c.wordmark { + t.Errorf("width %d: wordmark shown = %v, want %v", c.width, got, c.wordmark) + } + // In two columns the right column starts beside the wordmark's top row. + besideWordmark := strings.Contains(out[2], "Get started") + if besideWordmark != c.twoColumns { + t.Errorf("width %d: two columns = %v, want %v\n%s", c.width, besideWordmark, c.twoColumns, text) + } + } +} + +// Tips share one command column while every one fits on its row, and drop +// what they do onto the next row when one does not. +func TestBannerTipsAlignOrStack(t *testing.T) { + wide := stripped(strings.Split(bannerPlain().Banner(sampleBanner(), 100), "\n")) + row := find(t, wide, "vf explore") + if !strings.Contains(row, "vf explore browse every command") { + t.Errorf("at 100 columns the tip should sit on one aligned row: %q", row) + } + + narrow := stripped(strings.Split(bannerPlain().Banner(sampleBanner(), 80), "\n")) + for i, line := range narrow { + if strings.Contains(line, "vf explore") { + if strings.Contains(line, "browse every command") { + t.Errorf("at 80 columns the description should drop to the next row: %q", line) + } + if !strings.Contains(narrow[i+1], " browse every command") { + t.Errorf("at 80 columns the description should follow, indented: %q", narrow[i+1]) + } + return + } + } + t.Fatal("no vf explore row at 80 columns") +} + +func TestBannerColorRoles(t *testing.T) { + out := bannerColored().Banner(sampleBanner(), 100) + accent := bannerColored().Accent("vf explore") + if !strings.Contains(out, accent) { + t.Errorf("commands should be in Accent") + } + if !strings.Contains(out, bannerColored().Bold("Get started")) { + t.Errorf("headings should be bold") + } + if !strings.Contains(out, bannerColored().Success(Done.Symbol())) { + t.Errorf("the account line should carry a green ✓") + } + if strings.Contains(bannerPlain().Banner(sampleBanner(), 100), "\x1b[") { + t.Errorf("no escape codes without color") + } +} + +// A title that does not fit is dropped rather than breaking the border. +func TestBannerTitleTooLongForBorder(t *testing.T) { + b := sampleBanner() + b.Product = strings.Repeat("x", 60) + top := strings.Split(bannerPlain().Banner(b, 40), "\n")[0] + if top != "╭"+strings.Repeat("─", 38)+"╮" { + t.Errorf("top border = %q", top) + } +} + +func TestWrap(t *testing.T) { + cases := []struct { + in string + width int + want []string + }{ + {"", 10, nil}, + {"one two three", 7, []string{"one two", "three"}}, + {"supercalifragilistic word", 5, []string{"supercalifragilistic", "word"}}, + {" spaced out ", 20, []string{"spaced out"}}, + } + for _, c := range cases { + if got := wrap(c.in, c.width); fmt.Sprint(got) != fmt.Sprint(c.want) { + t.Errorf("wrap(%q, %d) = %q, want %q", c.in, c.width, got, c.want) + } + } +} + +func TestWordmarkWidth(t *testing.T) { + // The layout thresholds in Banner's doc comment assume this width. + if w := blockWidth(Wordmark); w != 43 { + t.Errorf("wordmark is %d columns wide; update the thresholds in Banner's doc comment", w) + } +} + +func stripped(lines []string) []string { + out := make([]string, len(lines)) + for i, l := range lines { + out[i] = stripANSI(l) + } + return out +} + +func stripANSI(s string) string { + var b strings.Builder + for i := 0; i < len(s); i++ { + if s[i] == 0x1b && i+1 < len(s) && s[i+1] == '[' { + i += 2 + for i < len(s) && (s[i] < 0x40 || s[i] > 0x7e) { + i++ + } + continue + } + b.WriteByte(s[i]) + } + return b.String() +} + +func find(t *testing.T, lines []string, needle string) string { + t.Helper() + for _, l := range lines { + if strings.Contains(l, needle) { + return l + } + } + t.Fatalf("no line contains %q", needle) + return "" +} diff --git a/internal/ui/lines.go b/internal/ui/lines.go new file mode 100644 index 00000000..87f6a405 --- /dev/null +++ b/internal/ui/lines.go @@ -0,0 +1,58 @@ +// This file is not generated by Speakeasy. + +package ui + +import ( + "io" + "os" + "strconv" + "strings" + + "golang.org/x/term" +) + +// Under renders lines beneath the line that produced them, the first behind +// ⎿ and the rest indented to match: +// +// ✓ Signed in +// ⎿ Workspaces: Acme, Support +// Saved to ~/.config/vf/oauth.json +func (u *UI) Under(lines ...string) string { + var b strings.Builder + for i, l := range lines { + if i == 0 { + b.WriteString(" " + u.Muted(u.Glyph(Result)) + " " + l) + continue + } + b.WriteString("\n " + l) + } + return b.String() +} + +// TerminalWidth is w's width in columns: the terminal's own, then $COLUMNS, +// then 80. +func TerminalWidth(w io.Writer) int { + if f, ok := w.(interface{ Fd() uintptr }); ok { + if cols, _, err := term.GetSize(int(f.Fd())); err == nil && cols > 0 { + return cols + } + } + if cols, err := strconv.Atoi(os.Getenv("COLUMNS")); err == nil && cols > 0 { + return cols + } + return 80 +} + +// TerminalHeight is w's height in rows: the terminal's own, then $LINES, +// then 24. +func TerminalHeight(w io.Writer) int { + if f, ok := w.(interface{ Fd() uintptr }); ok { + if _, rows, err := term.GetSize(int(f.Fd())); err == nil && rows > 0 { + return rows + } + } + if rows, err := strconv.Atoi(os.Getenv("LINES")); err == nil && rows > 0 { + return rows + } + return 24 +} diff --git a/internal/ui/path.go b/internal/ui/path.go new file mode 100644 index 00000000..605d5f9c --- /dev/null +++ b/internal/ui/path.go @@ -0,0 +1,18 @@ +// This file is not generated by Speakeasy. + +package ui + +import ( + "os" + "strings" +) + +// ShortPath shows a path under the home directory as ~/..., the way people +// write it. Anything else comes back unchanged. +func ShortPath(path string) string { + home, err := os.UserHomeDir() + if err != nil || home == "" || !strings.HasPrefix(path, home+string(os.PathSeparator)) { + return path + } + return "~" + path[len(home):] +} diff --git a/internal/ui/path_test.go b/internal/ui/path_test.go new file mode 100644 index 00000000..aeaee0a7 --- /dev/null +++ b/internal/ui/path_test.go @@ -0,0 +1,23 @@ +package ui + +import ( + "os" + "path/filepath" + "testing" +) + +func TestShortPath(t *testing.T) { + home := t.TempDir() + t.Setenv("HOME", home) + t.Setenv("USERPROFILE", home) + in := filepath.Join(home, ".config", "vf", "config.yaml") + if got, want := ShortPath(in), "~"+string(os.PathSeparator)+filepath.Join(".config", "vf", "config.yaml"); got != want { + t.Errorf("ShortPath(%q) = %q, want %q", in, got, want) + } + if got := ShortPath("/etc/vf.yaml"); got != "/etc/vf.yaml" { + t.Errorf("a path outside home should be unchanged, got %q", got) + } + if got := ShortPath(home + "other/x"); got != home+"other/x" { + t.Errorf("a sibling of home should be unchanged, got %q", got) + } +} diff --git a/internal/ui/spinner.go b/internal/ui/spinner.go new file mode 100644 index 00000000..2d90734b --- /dev/null +++ b/internal/ui/spinner.go @@ -0,0 +1,110 @@ +// This file is not generated by Speakeasy. + +package ui + +import ( + "fmt" + "io" + "sync" + "time" +) + +// SpinnerFrames are the Working glyph's animation, Claude Code's: a dot that +// grows into ✻ and back. The still glyph is ✻ (Working). +var SpinnerFrames = []string{"·", "✢", "✳", "✶", "✻", "✽", "✻", "✶", "✳", "✢"} + +const spinnerTick = 120 * time.Millisecond + +// Spinner is one line of motion: the Working glyph, a message, the elapsed +// time, and how to stop it, redrawn in place: +// +// ✻ Waiting for you to sign in in your browser… 12s · ctrl-c to cancel +// +// DESIGN.md: anything that can take longer than about 300 ms shows one, and +// never in a pipe. Off a terminal Spin returns a spinner that draws nothing, +// so callers print their own plain line instead. +type Spinner struct { + w io.Writer + u *UI + msg string + hint string + start time.Time + + stopOnce sync.Once + done chan struct{} + stopped chan struct{} +} + +// Spin starts a spinner on w, which must be the stream u was made for. hint +// follows the elapsed time, muted; "" leaves it out. +func (u *UI) Spin(w io.Writer, msg, hint string) *Spinner { + return u.SpinAfter(w, 0, msg, hint) +} + +// SpinAfter is Spin, but draws nothing until delay has passed, so something +// that finishes sooner leaves no trace: no flash of motion for a 100 ms API +// call. The elapsed time still counts from the start. +func (u *UI) SpinAfter(w io.Writer, delay time.Duration, msg, hint string) *Spinner { + s := &Spinner{w: w, u: u, msg: msg, hint: hint, start: time.Now(), + done: make(chan struct{}), stopped: make(chan struct{})} + if !u.Decorated() { + close(s.stopped) + return s + } + go s.run(delay) + return s +} + +// Active reports whether the spinner is drawing, which it does only at a +// terminal. +func (s *Spinner) Active() bool { return s.u.Decorated() } + +// Stop erases the spinner's line and leaves the cursor at its start, ready +// for whatever reports the outcome. It is safe to call more than once. +func (s *Spinner) Stop() { + s.stopOnce.Do(func() { close(s.done) }) + <-s.stopped +} + +func (s *Spinner) run(delay time.Duration) { + defer close(s.stopped) + if delay > 0 { + wait := time.NewTimer(delay) + defer wait.Stop() + select { + case <-s.done: + return // stopped before it was drawn: nothing to erase + case <-wait.C: + } + } + t := time.NewTicker(spinnerTick) + defer t.Stop() + for frame := 0; ; frame++ { + s.draw(frame) + select { + case <-s.done: + fmt.Fprint(s.w, "\r\x1b[2K") + return + case <-t.C: + } + } +} + +func (s *Spinner) draw(frame int) { + line := s.u.Accent(SpinnerFrames[frame%len(SpinnerFrames)]) + " " + s.msg + " " + + s.u.Muted(formatElapsed(time.Since(s.start))) + if s.hint != "" { + line += s.u.Muted(" " + Separator.Symbol() + " " + s.hint) + } + // Erase the line first, so a shorter redraw leaves nothing behind. + fmt.Fprint(s.w, "\r\x1b[2K"+line) +} + +// formatElapsed is 0s, 12s, 1m 05s: whole seconds, the way Claude Code counts. +func formatElapsed(d time.Duration) string { + sec := int(d.Seconds()) + if sec < 60 { + return fmt.Sprintf("%ds", sec) + } + return fmt.Sprintf("%dm %02ds", sec/60, sec%60) +} diff --git a/internal/ui/spinner_test.go b/internal/ui/spinner_test.go new file mode 100644 index 00000000..d8ddd727 --- /dev/null +++ b/internal/ui/spinner_test.go @@ -0,0 +1,89 @@ +package ui + +import ( + "bytes" + "strings" + "testing" + "time" +) + +func TestSpinnerDrawsThenErasesItsLine(t *testing.T) { + var out bytes.Buffer + s := New(&out, Options{Decorate: true}).Spin(&out, "Waiting for you…", "ctrl-c to cancel") + if !s.Active() { + t.Fatal("a spinner at a terminal should draw") + } + time.Sleep(3 * spinnerTick) + s.Stop() + s.Stop() // safe to call twice + + got := out.String() + if !strings.Contains(got, "· Waiting for you… 0s · ctrl-c to cancel") { + t.Errorf("first frame missing:\n%q", got) + } + if !strings.Contains(got, "✢ Waiting for you…") { + t.Errorf("the glyph should animate:\n%q", got) + } + if !strings.HasSuffix(got, "\r\x1b[2K") { + t.Errorf("Stop should leave the line erased, cursor at its start:\n%q", got) + } + if strings.Contains(got, "\n") { + t.Errorf("a spinner never moves to a new line:\n%q", got) + } +} + +// DESIGN.md: never in a pipe. +func TestSpinnerOffATerminalDrawsNothing(t *testing.T) { + var out bytes.Buffer + s := New(&out, Options{Color: true}).Spin(&out, "Waiting", "") + if s.Active() { + t.Error("Active should be false off a terminal") + } + time.Sleep(2 * spinnerTick) + s.Stop() + if out.Len() != 0 { + t.Errorf("wrote %q", out.String()) + } +} + +func TestFormatElapsed(t *testing.T) { + for d, want := range map[time.Duration]string{ + 0: "0s", 999 * time.Millisecond: "0s", 12 * time.Second: "12s", + 65 * time.Second: "1m 05s", 10*time.Minute + 3*time.Second: "10m 03s", + } { + if got := formatElapsed(d); got != want { + t.Errorf("formatElapsed(%s) = %q, want %q", d, got, want) + } + } +} + +func TestUnder(t *testing.T) { + u := New(&bytes.Buffer{}, Options{Decorate: true}) + if got, want := u.Under("first", "second"), " ⎿ first\n second"; got != want { + t.Errorf("Under = %q, want %q", got, want) + } + if got := u.Under(); got != "" { + t.Errorf("Under() = %q, want empty", got) + } +} + +func TestUntil(t *testing.T) { + now := time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC) + for d, want := range map[time.Duration]string{ + -time.Minute: "now", 20 * time.Second: "now", 15 * time.Minute: "in 15m", + 2*time.Hour + 5*time.Minute: "in 2h 05m", 30 * time.Hour: "in 30h 00m", + } { + if got := Until(now.Add(d), now); got != want { + t.Errorf("Until(+%s) = %q, want %q", d, got, want) + } + } +} + +// SpinAfter stopped before its delay has drawn nothing, so it erases nothing. +func TestSpinAfterStoppedEarlyDrawsNothing(t *testing.T) { + var out bytes.Buffer + New(&out, Options{Decorate: true}).SpinAfter(&out, time.Second, "Listing…", "").Stop() + if out.Len() != 0 { + t.Errorf("got %q", out.String()) + } +} diff --git a/internal/ui/time.go b/internal/ui/time.go new file mode 100644 index 00000000..c72b3ec8 --- /dev/null +++ b/internal/ui/time.go @@ -0,0 +1,21 @@ +// This file is not generated by Speakeasy. + +package ui + +import ( + "fmt" + "time" +) + +// Until says how far off t is, coarsely: "in 15m", "in 2h 05m", "now". +func Until(t, now time.Time) string { + d := t.Sub(now).Round(time.Minute) + switch { + case d <= 0: + return "now" + case d < time.Hour: + return fmt.Sprintf("in %dm", int(d.Minutes())) + default: + return fmt.Sprintf("in %dh %02dm", int(d.Hours()), int(d.Minutes())%60) + } +} diff --git a/internal/ui/ui.go b/internal/ui/ui.go new file mode 100644 index 00000000..ba2ab4b9 --- /dev/null +++ b/internal/ui/ui.go @@ -0,0 +1,248 @@ +// This file is not generated by Speakeasy. It is the design system for vf's +// human-facing terminal output; DESIGN.md next to it is the spec it follows. + +// Package ui renders vf's human-facing terminal output: the color roles, the +// glyph vocabulary, and the status lines built from them. +// +// It decides nothing about policy. Whether a stream gets color or decoration +// is resolved by the caller (output.UI does it from --color, NO_COLOR, +// FORCE_COLOR, agent mode and the stream itself) and handed in as Options. +// That keeps this package free of cobra and of the output package, so output +// can use it without an import cycle. +package ui + +import ( + "io" + "runtime" + "strings" + + "github.com/muesli/termenv" +) + +// AccentHex is Voiceflow blue. It is the only fixed color in the system, and +// the same value creator-app and the vfe CLI use. +const AccentHex = "#397DFF" + +// The state colors are the terminal's own ANSI colors rather than fixed +// values, so the user's theme picks shades that read on its background. Muted +// text is the faint attribute for the same reason: it dims whatever the +// terminal's foreground is, on light and dark themes alike. +const ( + ansiRed = "1" + ansiGreen = "2" + ansiYellow = "3" + ansiBrightBlack = "8" +) + +// Options is what the caller decided about one output stream. +type Options struct { + // Color allows ANSI color and text attributes. + Color bool + // Decorate allows glyphs, and later boxes and motion: a person is + // watching a terminal, not a script reading a pipe. + Decorate bool +} + +// UI renders text for one output stream. +type UI struct { + opts Options + profile termenv.Profile +} + +// New returns a UI for w. The color depth (true color, 256 or 16) is +// detected from the environment; w only matters for that detection. +func New(w io.Writer, opts Options) *UI { + return &UI{opts: opts, profile: profileFor(w, opts.Color)} +} + +// Plain returns a UI that emits neither color nor glyphs. +func Plain() *UI { + return New(io.Discard, Options{}) +} + +// profileFor detects color depth. The caller has already decided whether +// this stream gets color, including for a stream that is not a terminal +// (--color=always, FORCE_COLOR), so detection must not veto that decision: +// termenv is told to skip its own terminal check, and a terminal that reports +// no color support at all still gets the 16 basic colors. +func profileFor(w io.Writer, color bool) termenv.Profile { + if !color { + return termenv.Ascii + } + p := termenv.NewOutput(w, termenv.WithUnsafe()).ColorProfile() + if p == termenv.Ascii { + return termenv.ANSI + } + return p +} + +// Colored reports whether this UI emits ANSI color. +func (u *UI) Colored() bool { return u.opts.Color } + +// Decorated reports whether this UI emits glyphs. +func (u *UI) Decorated() bool { return u.opts.Decorate } + +// Accent marks the one thing on screen that matters most: a name, an ID, the +// selected row. Use it sparingly; if everything is accented, nothing is. +func (u *UI) Accent(s string) string { return u.style(s, u.fg(AccentHex)) } + +// Muted is secondary text: hints, timestamps, counts, the version. +func (u *UI) Muted(s string) string { return u.style(s, termenv.Style.Faint) } + +// Subtle is structure, not content: borders, rules, separators. +func (u *UI) Subtle(s string) string { return u.style(s, u.fg(ansiBrightBlack)) } + +// Bold is emphasis without color: headings, labels. +func (u *UI) Bold(s string) string { return u.style(s, termenv.Style.Bold) } + +// Success colors something that worked. +func (u *UI) Success(s string) string { return u.style(s, u.fg(ansiGreen)) } + +// Warning colors something that needs attention but did not fail. +func (u *UI) Warning(s string) string { return u.style(s, u.fg(ansiYellow)) } + +// Error colors something that failed. +func (u *UI) Error(s string) string { return u.style(s, u.fg(ansiRed)) } + +// fg takes a hex color or an ANSI index. termenv downsamples a hex color to +// the stream's depth and leaves an ANSI index as is, so the terminal's theme +// still decides what that index looks like. +func (u *UI) fg(color string) func(termenv.Style) termenv.Style { + return func(t termenv.Style) termenv.Style { return t.Foreground(u.profile.Color(color)) } +} + +// style applies a text attribute line by line, so a multi-line string never +// carries an open escape sequence across a newline (which bleeds into +// whatever the terminal prints next, and breaks line-based tools like less). +func (u *UI) style(s string, apply func(termenv.Style) termenv.Style) string { + if !u.opts.Color || s == "" { + return s + } + lines := strings.Split(s, "\n") + for i, line := range lines { + if line != "" { + lines[i] = apply(u.profile.String(line)).String() + } + } + return strings.Join(lines, "\n") +} + +// Glyph is one symbol in vf's visual vocabulary. Each has exactly one +// meaning; see DESIGN.md. +type Glyph int + +const ( + Action Glyph = iota // something vf did, or is doing + Result // what came back from the line above + Working // in progress + Pointer // the selected row; the prompt + Done // it worked + Failed // it did not + Warn // it worked, but look + Separator // between inline items + Empty // a value that is not there +) + +// Symbol returns the decorated form of g. +// +// Action follows Claude Code: macOS terminal fonts draw U+23FA as a clean +// dot, while Windows and many Linux fonts draw it as an emoji or a box, so +// elsewhere it is U+25CF. +func (g Glyph) Symbol() string { + switch g { + case Action: + if runtime.GOOS == "darwin" { + return "⏺" + } + return "●" + case Result: + return "⎿" + case Working: + return "✻" + case Pointer: + return "❯" + case Done: + return "✓" + case Failed: + return "✗" + case Warn: + return "⚠" + case Separator: + return "·" + case Empty: + return "—" + } + return "" +} + +// ASCII returns the plain-text stand-in for g. +func (g Glyph) ASCII() string { + switch g { + case Action, Working: + return "*" + case Result, Empty: + return "-" + case Pointer: + return ">" + case Done: + return "+" + case Failed: + return "x" + case Warn: + return "!" + case Separator: + return "|" + } + return "" +} + +// Glyph returns g's symbol when decorating, and its ASCII stand-in otherwise. +func (u *UI) Glyph(g Glyph) string { + if u.opts.Decorate { + return g.Symbol() + } + return g.ASCII() +} + +// Status is the kind of a one-line status message. +type Status int + +const ( + StatusInfo Status = iota + StatusDone + StatusWarn + StatusFailed +) + +// Status renders a one-line message of the given kind. +// +// At a terminal it leads with the kind's glyph in the kind's color: +// +// ✓ Published v12 +// ✗ Couldn't reach the Voiceflow API +// +// Anywhere else it uses the plain prefixes that logs and CI output have +// always used, so piped human output stays greppable: +// +// Published v12 +// Error: Couldn't reach the Voiceflow API +func (u *UI) Status(kind Status, msg string) string { + if !u.opts.Decorate { + switch kind { + case StatusFailed: + return "Error: " + msg + case StatusWarn: + return "Warning: " + msg + } + return msg + } + switch kind { + case StatusDone: + return u.Success(Done.Symbol()) + " " + msg + case StatusWarn: + return u.Warning(Warn.Symbol()) + " " + msg + case StatusFailed: + return u.Error(Failed.Symbol()) + " " + msg + } + return u.Accent(Action.Symbol()) + " " + msg +} diff --git a/internal/ui/ui_test.go b/internal/ui/ui_test.go new file mode 100644 index 00000000..8cbf49e4 --- /dev/null +++ b/internal/ui/ui_test.go @@ -0,0 +1,173 @@ +package ui + +import ( + "io" + "runtime" + "strings" + "testing" +) + +const esc = "\x1b[" + +// colored returns a UI that emits color at a fixed depth, whatever the +// environment the test runs in. +func colored(t *testing.T, colorterm string, decorate bool) *UI { + t.Helper() + t.Setenv("TERM", "xterm-256color") + t.Setenv("COLORTERM", colorterm) + return New(io.Discard, Options{Color: true, Decorate: decorate}) +} + +func TestPlainEmitsTheTextAndNothingElse(t *testing.T) { + u := Plain() + for name, render := range map[string]func(string) string{ + "Accent": u.Accent, "Muted": u.Muted, "Subtle": u.Subtle, "Bold": u.Bold, + "Success": u.Success, "Warning": u.Warning, "Error": u.Error, + } { + if got := render("proj_123"); got != "proj_123" { + t.Errorf("%s = %q, want the text unchanged", name, got) + } + } +} + +func TestAccentIsVoiceflowBlueAtTrueColor(t *testing.T) { + got := colored(t, "truecolor", false).Accent("proj_123") + // #397DFF is rgb(57, 125, 255). termenv emits red as 56: it converts the + // hex through floats and truncates instead of rounding. One step in 255 is + // invisible, so this asserts the channels it renders exactly. + if !strings.Contains(got, esc+"38;2;5") || !strings.Contains(got, ";125;255m") || !strings.Contains(got, "proj_123") { + t.Fatalf("Accent = %q, want #397DFF as a 24-bit foreground", got) + } +} + +func TestAccentDownsamplesWithoutTrueColor(t *testing.T) { + got := colored(t, "", false).Accent("proj_123") + if !strings.Contains(got, esc+"38;5;") { + t.Fatalf("Accent = %q, want a 256-color foreground on a 256-color terminal", got) + } +} + +func TestStateColorsUseTheTerminalsOwnPalette(t *testing.T) { + u := colored(t, "truecolor", false) + for name, c := range map[string]struct { + render func(string) string + sgr string + }{ + "Success": {u.Success, esc + "32m"}, + "Warning": {u.Warning, esc + "33m"}, + "Error": {u.Error, esc + "31m"}, + "Subtle": {u.Subtle, esc + "90m"}, + } { + if got := c.render("x"); !strings.HasPrefix(got, c.sgr) { + t.Errorf("%s = %q, want the ANSI color %q, not a fixed RGB value", name, got, c.sgr) + } + } +} + +func TestMutedIsFaintNotAFixedGray(t *testing.T) { + if got := colored(t, "truecolor", false).Muted("v0.2.349"); !strings.HasPrefix(got, esc+"2m") { + t.Fatalf("Muted = %q, want the faint attribute", got) + } +} + +func TestStylingNeverCrossesANewline(t *testing.T) { + got := colored(t, "truecolor", false).Error("first\n\nsecond") + lines := strings.Split(got, "\n") + if len(lines) != 3 { + t.Fatalf("Error = %q, want three lines", got) + } + if lines[1] != "" { + t.Errorf("empty line = %q, want it left empty", lines[1]) + } + for _, i := range []int{0, 2} { + if !strings.HasPrefix(lines[i], esc) || !strings.HasSuffix(lines[i], esc+"0m") { + t.Errorf("line %d = %q, want it to open and close its own style", i, lines[i]) + } + } +} + +func TestForcedColorSurvivesATerminalWithNoColorSupport(t *testing.T) { + t.Setenv("TERM", "dumb") + t.Setenv("COLORTERM", "") + got := New(io.Discard, Options{Color: true}).Error("x") + if !strings.HasPrefix(got, esc+"31m") { + t.Fatalf("Error = %q, want basic ANSI red when color was asked for", got) + } +} + +func TestGlyphsFallBackToASCIIWhenNotDecorating(t *testing.T) { + u := Plain() + for g := Action; g <= Empty; g++ { + got := u.Glyph(g) + if got == "" { + t.Errorf("glyph %d has no ASCII stand-in", g) + } + for _, r := range got { + if r > 127 { + t.Errorf("glyph %d stand-in %q is not ASCII", g, got) + } + } + } +} + +func TestEveryGlyphHasASymbol(t *testing.T) { + u := New(io.Discard, Options{Decorate: true}) + seen := map[string]Glyph{} + for g := Action; g <= Empty; g++ { + s := u.Glyph(g) + if s == "" { + t.Errorf("glyph %d has no symbol", g) + } + if prev, dup := seen[s]; dup { + t.Errorf("glyphs %d and %d share %q; each symbol means one thing", prev, g, s) + } + seen[s] = g + } +} + +func TestActionMatchesClaudeCodePerPlatform(t *testing.T) { + want := "●" + if runtime.GOOS == "darwin" { + want = "⏺" + } + if got := Action.Symbol(); got != want { + t.Fatalf("Action = %q on %s, want %q", got, runtime.GOOS, want) + } +} + +func TestStatusUsesWordsWhenNotDecorating(t *testing.T) { + u := Plain() + for kind, want := range map[Status]string{ + StatusInfo: "Published v12", + StatusDone: "Published v12", + StatusWarn: "Warning: Published v12", + StatusFailed: "Error: Published v12", + } { + if got := u.Status(kind, "Published v12"); got != want { + t.Errorf("Status(%d) = %q, want %q", kind, got, want) + } + } +} + +func TestStatusLeadsWithTheKindsGlyphWhenDecorating(t *testing.T) { + u := New(io.Discard, Options{Decorate: true}) + for kind, want := range map[Status]string{ + StatusInfo: Action.Symbol() + " Published v12", + StatusDone: "✓ Published v12", + StatusWarn: "⚠ Published v12", + StatusFailed: "✗ Published v12", + } { + if got := u.Status(kind, "Published v12"); got != want { + t.Errorf("Status(%d) = %q, want %q", kind, got, want) + } + } +} + +func TestStatusColorsOnlyTheGlyph(t *testing.T) { + t.Setenv("TERM", "xterm-256color") + t.Setenv("COLORTERM", "truecolor") + got := New(io.Discard, Options{Color: true, Decorate: true}).Status(StatusFailed, "Couldn't reach the API") + if !strings.HasPrefix(got, esc+"31m✗"+esc+"0m ") || !strings.HasSuffix(got, " Couldn't reach the API") { + t.Fatalf("Status = %q, want a red glyph followed by the message in the default color", got) + } +} diff --git a/internal/usage/schema.go b/internal/usage/schema.go index 13dcb309..bf8010b0 100644 --- a/internal/usage/schema.go +++ b/internal/usage/schema.go @@ -11,8 +11,8 @@ import ( ) var usageSchemas = map[string]string{ - "": "name \"vf\"\nbin \"vf\"\nabout \"Realtime: Realtime gateway API service\"\nversion \"0.2.349\"\nconfig {\n file \"~/.config/vf/config.yaml\"\n}\nflag \"--usage\" help=\"Print the CLI Usage schema in KDL format\" global=#true\nflag \"-o --output-format \" help=\"Specify the output format. Options: pretty, json, yaml, table, toon.\" global=#true config=\"output_format\" default=\"pretty\"\nflag \"--color \" help=\"Control colored output: auto (color when output is a TTY), always, or never. Respects NO_COLOR and FORCE_COLOR env vars.\" global=#true default=\"auto\"\nflag \"-q --jq \" help=\"Filter and transform output using a jq expression (e.g., '.name', '.items[] | .id')\" global=#true\nflag \"--server-url \" help=\"Override the default server URL\" global=#true\nflag \"--server \" help=\"Select a server by index (for indexed servers) or name (for named servers)\" global=#true\nflag \"-H --header \" help=\"Set a custom HTTP request header (format: \\\"Key: Value\\\"). Can be specified multiple times.\" global=#true var=#true\nflag \"--include-headers\" help=\"Include HTTP response headers in the output\" global=#true default=#false\nflag \"--timeout \" help=\"HTTP request timeout (e.g., 30s, 5m, 100ms)\" global=#true config=\"timeout\"\nflag \"--dry-run\" help=\"Preview the request that would be sent without executing it (output to stderr)\" global=#true default=#false\nflag \"-d --debug\" help=\"Log request and response diagnostics to stderr\" global=#true default=#false\nflag \"--agent-mode\" help=\"Enable structured errors and default TOON output for AI coding agents. Automatically enabled when a known agent environment is detected (CLAUDE_CODE, CURSOR_AGENT, etc.). Use --agent-mode=false to disable.\" global=#true default=#false\nflag \"--token \" help=\"Voiceflow bearer token\" global=#true env=\"VF_TOKEN\" config=\"security.token\"\ncmd \"agent\" help=\"Operations for agent\" {\n cmd \"get\" help=\"Get agent\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--include-instructions\" help=\"boolean flag\" default=#false\n flag \"--include-prompt\" help=\"boolean flag\" default=#false\n }\n cmd \"update\" help=\"Update agent\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--prompt \" help=\"string value\"\n flag \"--end-tool \" help=\"JSON object\"\n flag \"--card-tool \" help=\"JSON object\"\n flag \"--playbooks \" help=\"Playbooks available for the agent to invoke. This list REPLACES the registry: send the complete list you want, or omit the field to leave routing untouched. An agent with no playbooks AND no workflows registered cannot run - the runtime fails the conversation - so never send an empty list unless `workflows` still holds at least one.\"\n flag \"--workflows \" help=\"Workflows available for the agent to invoke. This list REPLACES the registry: send the complete list you want, or omit the field to leave routing untouched. An agent with no workflows AND no playbooks registered cannot run, so never send an empty list unless `playbooks` still holds at least one.\"\n flag \"--button-tool \" help=\"JSON object\"\n flag \"--carousel-tool \" help=\"JSON object\"\n flag \"--instructions \" help=\"string value\"\n flag \"--skip-turn-tool \" help=\"JSON object\"\n flag \"--path-tool-order \" help=\"The ordered list of path tool IDs that controls the order of the agent exit paths.\" var=#true\n flag \"--web-search-tool \" help=\"JSON object\"\n flag \"--call-forward-tool \" help=\"JSON object\"\n flag \"--knowledge-base-tool \" help=\"JSON object\"\n flag \"--include-guidelines\" help=\"Whether to append the default prompting guidelines to the global prompt.\"\n flag \"--llm \" help=\"JSON object\"\n flag \"--voice \" help=\"JSON object\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"add-workflow\" help=\"Add agent workflow\" {\n alias \"aw\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--condition \" help=\"The agent can run the workflow only while this condition holds. Leave it out for a workflow it can always run.\"\n flag \"--description \" help=\"When the agent should run this workflow. The agent reads it to choose between its playbooks and workflows. [required]\"\n flag \"--required-variables \" help=\"Variables the agent fills from the conversation before it runs the workflow, each with a description of what it holds.\"\n flag \"--workflow-id \" help=\"The workflow to add. Copy its ID from voiceflow_workflow.list. [required]\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"update-workflow\" help=\"Update agent workflow\" {\n alias \"uw\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--condition \" help=\"The agent can run the workflow only while this condition holds. Leave it out for a workflow it can always run.\"\n flag \"--description \" help=\"When the agent should run this workflow. The agent reads it to choose between its playbooks and workflows.\"\n flag \"--required-variables \" help=\"Replaces the stored list. Keep the id of each variable you keep, as read with voiceflow_agent.get. Leave the field out to keep the stored required variables.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"remove-workflow\" help=\"Remove agent workflow\" {\n alias \"rw\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"read-instructions\" help=\"Read agent instructions\" {\n alias \"ri\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--offset \" help=\"integer value\" default=1\n flag \"--limit \" help=\"integer value\" default=400\n }\n cmd \"patch-instructions\" help=\"Patch agent instructions\" {\n alias \"pi\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--old-string \" help=\"The exact text to replace, copied verbatim from a read or search result. Matching is literal — whitespace, punctuation and case must match. Do not include the line numbers a read adds. [required]\"\n flag \"--new-string \" help=\"The text to put in its place. May be empty to delete. [required]\"\n flag \"--replace-all\" help=\"Replace every occurrence. When false, more than one match is an error rather than a guess.\" default=#false\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"search-instructions\" help=\"Search agent instructions\" {\n alias \"si\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--pattern \" help=\"A JavaScript regular expression, evaluated against each line on its own. [required]\"\n flag \"--ignore-case\" help=\"Match case-insensitively. Defaults to false, like grep.\" default=#false\n flag \"--context-lines \" help=\"How many lines either side of each match to return.\" default=0\n flag \"--limit \" help=\"The maximum number of matching LINES to return. The reported totals cover the whole document.\" default=50\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"read-prompt\" help=\"Read the global prompt\" {\n alias \"rp\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--offset \" help=\"integer value\" default=1\n flag \"--limit \" help=\"integer value\" default=400\n }\n cmd \"patch-prompt\" help=\"Patch the global prompt\" {\n alias \"pp\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--old-string \" help=\"The exact text to replace, copied verbatim from a read or search result. Matching is literal — whitespace, punctuation and case must match. Do not include the line numbers a read adds. [required]\"\n flag \"--new-string \" help=\"The text to put in its place. May be empty to delete. [required]\"\n flag \"--replace-all\" help=\"Replace every occurrence. When false, more than one match is an error rather than a guess.\" default=#false\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"search-prompt\" help=\"Search the global prompt\" {\n alias \"sp\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--pattern \" help=\"A JavaScript regular expression, evaluated against each line on its own. [required]\"\n flag \"--ignore-case\" help=\"Match case-insensitively. Defaults to false, like grep.\" default=#false\n flag \"--context-lines \" help=\"How many lines either side of each match to return.\" default=0\n flag \"--limit \" help=\"The maximum number of matching LINES to return. The reported totals cover the whole document.\" default=50\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"add-tool-message\" help=\"Add agent tool message\" {\n alias \"atm\"\n flag \"--project-id \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. [required]\"\n flag \"--environment-alias \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. [required]\"\n flag \"--slot \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. (options: delay, failure, execution, completion) [required]\"\n flag \"--tool-id \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected.\"\n flag \"--native-tool \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. (options: endTool, cardTool, buttonTool, carouselTool, webSearchTool, callForwardTool, knowledgeBaseTool)\"\n flag \"--body-param \" help=\"{ type: string, examples: string[] } | { type: string, messageID: string }\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"update-tool-message\" help=\"Update agent tool message\" {\n alias \"utm\"\n flag \"--project-id \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. [required]\"\n flag \"--environment-alias \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. [required]\"\n flag \"--slot \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. (options: delay, failure, execution, completion) [required]\"\n flag \"--tool-id \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected.\"\n flag \"--native-tool \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. (options: endTool, cardTool, buttonTool, carouselTool, webSearchTool, callForwardTool, knowledgeBaseTool)\"\n flag \"--body-param \" help=\"{ type: string, examples: string[] } | { type: string, messageID: string }\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete-tool-message\" help=\"Delete agent tool message\" {\n alias \"dtm\"\n flag \"--project-id \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. [required]\"\n flag \"--environment-alias \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. [required]\"\n flag \"--slot \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. (options: delay, failure, execution, completion) [required]\"\n flag \"--tool-id \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected.\"\n flag \"--native-tool \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. (options: endTool, cardTool, buttonTool, carouselTool, webSearchTool, callForwardTool, knowledgeBaseTool)\"\n }\n cmd \"patch-pronunciation\" help=\"Patch pronunciation dictionary\" {\n alias \"ppr\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--set \" help=\"Words to add, or to change when the dictionary already has them. `from` is the written word and `to` is how the voice says it; an empty `to` makes the voice skip the word.\"\n flag \"--remove \" help=\"Written words whose entries to delete.\" var=#true\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"search-voices\" help=\"Search voices\" {\n alias \"sv\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--search \" help=\"string value\"\n flag \"--language \" help=\"string value\"\n flag \"--provider \" help=\"A TTS provider whose voices are in the voice catalog. (options: elevenlabs, cartesia)\"\n flag \"--gender \" help=\"How the vendor describes the voice. (options: male, female, neutral)\"\n flag \"--limit \" help=\"integer value\" default=10\n flag \"--offset \" help=\"integer value\" default=0\n }\n cmd \"patch-voices\" help=\"Patch voices\" {\n alias \"pv\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--primary \" help=\"The default voice: the one a conversation speaks with unless a language voice matches its locale.\"\n flag \"--set-overrides \" help=\"Language voices to add, or to change when the agent already has one for that locale.\"\n flag \"--remove-overrides \" help=\"Locales whose language voice to delete, as stored. They match ignoring case and _, as the runtime matches them.\" var=#true\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get-initialization-workflow\" help=\"Get initialization workflow\" {\n alias \"giw\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"set-initialization-workflow\" help=\"Set initialization workflow\" {\n alias \"siw\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--workflow-id \" help=\"The workflow to run before the user's first turn, or null to run none. [required]\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n}\ncmd \"workflow\" help=\"Operations for workflow\" {\n cmd \"list\" help=\"List workflows\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--folder-id \" help=\"string value\"\n flag \"--cursor \" help=\"string value\"\n flag \"--limit \" help=\"integer value\"\n }\n cmd \"create\" help=\"Create workflow\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"[required]\"\n flag \"--description \" help=\"string value\"\n flag \"--folder-id \" help=\"string value\"\n flag \"--entry \" help=\"string value\"\n flag \"--blocks \" help=\"list of values\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get\" help=\"Get workflow\" {\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--cursor \" help=\"string value\"\n }\n cmd \"update\" help=\"Update workflow\" {\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"string value\"\n flag \"--description \" help=\"string value\"\n flag \"--folder-id \" help=\"A workflow folder in this environment, or null for the top level.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete\" help=\"Delete workflow\" {\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"get-step\" help=\"Get workflow step\" {\n alias \"gs\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--step-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"update-step\" help=\"Update workflow step\" {\n alias \"us\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--step-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--body-param \" help=\"{ kind: string, content: object }\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete-step\" help=\"Delete workflow step\" {\n alias \"ds\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--step-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--expected-steps \" help=\"[required]\" var=#true\n }\n cmd \"get-raw\" help=\"Get raw workflow\" {\n alias \"gr\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--block-ids \" help=\"list of values\" var=#true\n }\n cmd \"duplicate\" help=\"Duplicate workflow\" {\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"The name of the copy. [required]\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"link\" help=\"Link a port\" {\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--step-id \" help=\"[required]\"\n flag \"--port-key \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--to-block-id \" help=\"The block the port will lead to. Links point at blocks, never at a step inside one. [required]\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"unlink\" help=\"Unlink a port\" {\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--step-id \" help=\"[required]\"\n flag \"--port-key \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"link-many\" help=\"Link many ports\" {\n alias \"lm\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--links \" help=\"1 to 50 ports to link, each once. [required]\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"create-block\" help=\"Create block\" {\n alias \"cb\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"[required]\"\n flag \"--color-param \" help=\"string value\"\n flag \"--placement \" help=\"Place the new block to the right of this block. Without it, the block goes next to the block of from.stepID, or right of the right-most block.\"\n flag \"--from \" help=\"Also link this port to the new block in the same call, with the same checks as voiceflow_workflow.link.\"\n flag \"--steps \" help=\"[required]\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"add-blocks\" help=\"Add workflow blocks\" {\n alias \"ab\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--blocks \" help=\"The new blocks. A step's links and a branch's to name a block key from this call or an existing block ID. [required]\"\n flag \"--from \" help=\"Existing ports to link to new blocks in the same call, with the same checks as voiceflow_workflow.link.\"\n flag \"--placement \" help=\"Place the new blocks to the right of this block. Without it, they go right of the block of the first from step, or right of the right-most block.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"update-block\" help=\"Update block\" {\n alias \"ub\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--block-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"string value\"\n flag \"--color-param \" help=\"string value\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete-block\" help=\"Delete workflow block\" {\n alias \"db\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--block-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--expected-steps \" help=\"[required]\" var=#true\n }\n cmd \"arrange-blocks\" help=\"Arrange workflow blocks\" {\n alias \"abl\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--block-ids \" help=\"Move only these blocks, as a group laid out by the links between them. Leave it out to arrange every block from the Start.\" var=#true\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"split-block\" help=\"Split workflow block\" {\n alias \"sb\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--block-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--at-step-id \" help=\"The step that starts the new block. It and every step below it move there, and the step above it becomes the last step of the block. To make step X the last step, so that its fail and path ports run, send the step below X. It must not be the first step. [required]\"\n flag \"--name \" help=\"The new block name. Default: the block name with \\\" (continued)\\\".\"\n flag \"--expected-steps \" help=\"The block's step IDs exactly as your last read returned them. If the block changed, nothing is written. [required]\" var=#true\n flag \"--acknowledge-rewire\" help=\"Required when the step that becomes the last step has hidden links or actions. The split keeps them, so they start to run. An action list on its next exit is deleted, because next links to the new block.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"insert-step\" help=\"Insert workflow step\" {\n alias \"is\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--block-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--after-step-id \" help=\"Insert right after this step of the block. Send this or atStart.\"\n flag \"--step \" help=\"{ kind: string, key: string, content: value, links: object } | { kind: string, key: string, content: object, links: object }\"\n flag \"--expected-steps \" help=\"The block's step IDs exactly as your last read returned them. If the block changed, nothing is written. [required]\" var=#true\n flag \"--acknowledge-rewire\" help=\"Required when the insert makes the last step stop being last and that step has exits that would stop running: a Tool or Code fail or path link is cleared, and actions on such an exit are deleted. Also required when you append a step that has no next port, such as End or Go to block: the old last step's next link cannot move to it, so it is cleared.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"add-branch\" help=\"Add workflow branch\" {\n alias \"abr\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--step-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--body-param \" help=\"{ label: string, matchAll: boolean, assertions: object[], to: string, ... } | { label: string, url: string, to: string, kind: string } | { label: string, url: string, to: string, kind: string, ... } | { label: string, to: string, kind: string } | { name: string, description: string, requiredVariables: object[], messages: object, ... }\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"update-branch\" help=\"Update workflow branch\" {\n alias \"ubr\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--step-id \" help=\"[required]\"\n flag \"--branch-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--body-param \" help=\"{ label: string, matchAll: boolean, assertions: object[], kind: string } | { label: string, url: string, kind: string } | { label: string, kind: string } | { name: string, description: string, requiredVariables: object[], kind: string }\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete-branch\" help=\"Delete workflow branch\" {\n alias \"dbr\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--step-id \" help=\"[required]\"\n flag \"--branch-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"add-actions\" help=\"Add port actions\" {\n alias \"aa\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--step-id \" help=\"[required]\"\n flag \"--port-key \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--actions \" help=\"1 to 10 actions to add, in run order. [required]\"\n flag \"--after-action-id \" help=\"Add them after this action. Leave out afterActionID and atStart to add them at the end, before an action that ends the path.\"\n flag \"--expected-actions \" help=\"The IDs in this exit's actions from your last read, in order. Send [] when it has none. [required]\" var=#true\n flag \"--to \" help=\"The block the path goes to after the actions. Leave it out to keep the current one. Send null to clear it.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"reorder-actions\" help=\"Reorder port actions\" {\n alias \"ra\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--step-id \" help=\"[required]\"\n flag \"--port-key \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--order \" help=\"Every action ID of this exit, in the new order. [required]\" var=#true\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"replace-action\" help=\"Replace port action\" {\n alias \"rac\"\n flag \"--workflow-id \" help=\"[required]\"\n flag \"--action-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--action \" help=\"{ kind: string, content: object }\"\n flag \"--expected-actions \" help=\"The IDs in this exit's actions from your last read, in order. [required]\" var=#true\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n}\ncmd \"playbook\" help=\"Operations for playbook\" {\n cmd \"list\" help=\"List playbooks\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--include-instructions\" help=\"boolean flag\" default=#false\n }\n cmd \"create\" help=\"Create playbook\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"[required]\"\n flag \"--description \" help=\"A human-readable description of what the playbook does.\"\n flag \"--instructions \" help=\"string value\"\n flag \"--end-tool \" help=\"JSON object\"\n flag \"--card-tool \" help=\"JSON object\"\n flag \"--button-tool \" help=\"JSON object\"\n flag \"--carousel-tool \" help=\"JSON object\"\n flag \"--skip-turn-tool \" help=\"JSON object\"\n flag \"--web-search-tool \" help=\"JSON object\"\n flag \"--call-forward-tool \" help=\"JSON object\"\n flag \"--knowledge-base-tool \" help=\"JSON object\"\n flag \"--settings \" help=\"JSON object\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get\" help=\"Get playbook\" {\n flag \"--playbook-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--include-instructions\" help=\"boolean flag\" default=#false\n }\n cmd \"update\" help=\"Update playbook\" {\n flag \"--playbook-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"string value\"\n flag \"--settings \" help=\"JSON object\"\n flag \"--description \" help=\"A human-readable description of what the playbook does.\"\n flag \"--instructions \" help=\"string value\"\n flag \"--end-tool \" help=\"JSON object\"\n flag \"--card-tool \" help=\"JSON object\"\n flag \"--button-tool \" help=\"JSON object\"\n flag \"--carousel-tool \" help=\"JSON object\"\n flag \"--skip-turn-tool \" help=\"JSON object\"\n flag \"--web-search-tool \" help=\"JSON object\"\n flag \"--call-forward-tool \" help=\"JSON object\"\n flag \"--knowledge-base-tool \" help=\"JSON object\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete\" help=\"Delete playbook\" {\n flag \"--playbook-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"read-instructions\" help=\"Read playbook instructions\" {\n alias \"ri\"\n flag \"--playbook-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--offset \" help=\"integer value\" default=1\n flag \"--limit \" help=\"integer value\" default=400\n }\n cmd \"patch-instructions\" help=\"Patch playbook instructions\" {\n alias \"pi\"\n flag \"--playbook-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--old-string \" help=\"The exact text to replace, copied verbatim from a read or search result. Matching is literal — whitespace, punctuation and case must match. Do not include the line numbers a read adds. [required]\"\n flag \"--new-string \" help=\"The text to put in its place. May be empty to delete. [required]\"\n flag \"--replace-all\" help=\"Replace every occurrence. When false, more than one match is an error rather than a guess.\" default=#false\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"search-instructions\" help=\"Search playbook instructions\" {\n alias \"si\"\n flag \"--playbook-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--pattern \" help=\"A JavaScript regular expression, evaluated against each line on its own. [required]\"\n flag \"--ignore-case\" help=\"Match case-insensitively. Defaults to false, like grep.\" default=#false\n flag \"--context-lines \" help=\"How many lines either side of each match to return.\" default=0\n flag \"--limit \" help=\"The maximum number of matching LINES to return. The reported totals cover the whole document.\" default=50\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"duplicate\" help=\"Duplicate playbook\" {\n flag \"--playbook-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"The name of the copy. Leave it out to use the original's name with \\\" copy\\\" added.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"add-tool-message\" help=\"Add playbook tool message\" {\n alias \"atm\"\n flag \"--playbook-id \" help=\"[required]\"\n flag \"--project-id \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. [required]\"\n flag \"--environment-alias \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. [required]\"\n flag \"--slot \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. (options: delay, failure, execution, completion) [required]\"\n flag \"--tool-id \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected.\"\n flag \"--native-tool \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. (options: endTool, cardTool, buttonTool, carouselTool, webSearchTool, callForwardTool, knowledgeBaseTool)\"\n flag \"--body-param \" help=\"{ type: string, examples: string[] } | { type: string, messageID: string }\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"update-tool-message\" help=\"Update playbook tool message\" {\n alias \"utm\"\n flag \"--playbook-id \" help=\"[required]\"\n flag \"--project-id \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. [required]\"\n flag \"--environment-alias \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. [required]\"\n flag \"--slot \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. (options: delay, failure, execution, completion) [required]\"\n flag \"--tool-id \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected.\"\n flag \"--native-tool \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. (options: endTool, cardTool, buttonTool, carouselTool, webSearchTool, callForwardTool, knowledgeBaseTool)\"\n flag \"--body-param \" help=\"{ type: string, examples: string[] } | { type: string, messageID: string }\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete-tool-message\" help=\"Delete playbook tool message\" {\n alias \"dtm\"\n flag \"--playbook-id \" help=\"[required]\"\n flag \"--project-id \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. [required]\"\n flag \"--environment-alias \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. [required]\"\n flag \"--slot \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. (options: delay, failure, execution, completion) [required]\"\n flag \"--tool-id \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected.\"\n flag \"--native-tool \" help=\"Addresses one message on one tool. Exactly one of toolID and nativeTool is required; sending neither or both is rejected. (options: endTool, cardTool, buttonTool, carouselTool, webSearchTool, callForwardTool, knowledgeBaseTool)\"\n }\n cmd \"path\" help=\"Operations for playbook-path\" {\n cmd \"list\" help=\"List exit paths\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--playbook-id \" help=\"[required]\"\n }\n cmd \"create\" help=\"Create exit path\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--playbook-id \" help=\"The ID of the playbook to add the exit path to. [required]\"\n flag \"--name \" help=\"The name of the exit path, trimmed. Use Latin letters, digits, spaces, hyphens and underscores, as the editor does: the runtime turns the name into the snake_case name of the exit tool the model calls. [required]\"\n flag \"--description \" help=\"The exit condition: the model reads it to decide when to leave the playbook through this path.\"\n flag \"--required-variables \" help=\"The variables or entities the model must fill before it can leave through this path, in order.\"\n flag \"--messages \" help=\"What the agent says as it leaves through this path. Send only a message ID that nothing else uses: no other step in any workflow, no reprompt, no agent and no playbook. For the same words in a second place, create a new message with that text.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"update\" help=\"Update exit path\" {\n flag \"--path-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--playbook-id \" help=\"[required]\"\n flag \"--name \" help=\"The name of the exit path, trimmed. Use Latin letters, digits, spaces, hyphens and underscores, as the editor does: the runtime turns the name into the snake_case name of the exit tool the model calls.\"\n flag \"--description \" help=\"The exit condition: the model reads it to decide when to leave the playbook through this path.\"\n flag \"--required-variables \" help=\"Replaces the stored list, in order. Leave it out to keep it; send [] to remove every one.\"\n flag \"--messages \" help=\"Replaces the stored messages whole. Send null to remove them; leave it out to keep them. Send only a message ID that nothing else uses: no other step in any workflow, no reprompt, no agent and no playbook. For the same words in a second place, create a new message with that text.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete\" help=\"Delete exit path\" {\n flag \"--path-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--playbook-id \" help=\"[required]\"\n }\n }\n}\ncmd \"tool\" help=\"Operations for tool\" {\n cmd \"list\" help=\"List tools\" {\n flag \"--global\" help=\"boolean flag\"\n flag \"--playbook-id \" help=\"string value\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--type \" help=\"When provided, only tools of this type are returned. `workflow` returns the workflow tools. (options: api, mcp, function, integration, workflow)\"\n }\n cmd \"create\" help=\"Create tool\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--body-param \" help=\"{ description: string, target: object, messages: object, captureInputVariables: object, ... }\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get\" help=\"Get tool\" {\n flag \"--tool-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--type \" help=\"The type of the tool to fetch. (options: api, mcp, function, integration, workflow) [required]\"\n }\n cmd \"update\" help=\"Update tool\" {\n flag \"--tool-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--body-param \" help=\"{ description: string, messages: object, toolSound: object, captureInputVariables: object, ... }\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete\" help=\"Delete tool\" {\n flag \"--tool-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--type \" help=\"The type of the tool to delete. `workflow` removes a workflow tool; the workflow stays. (options: api, mcp, function, integration, workflow) [required]\"\n }\n cmd \"move\" help=\"Move tool\" {\n flag \"--tool-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--type \" help=\"The type of the tool to move. `workflow` is refused: a workflow tool is never moved. (options: api, mcp, function, integration, workflow) [required]\"\n flag \"--target \" help=\"[required]\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n}\ncmd \"workspace\" help=\"Operations for workspace\" {\n cmd \"list\" help=\"List workspaces\"\n cmd \"create\" help=\"Create workspace\" {\n flag \"--name \" help=\"[required]\"\n flag \"--organization-id \" help=\"The ID of the organization the workspace belongs to. [required]\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get\" help=\"Get workspace\" {\n flag \"--workspace-id \" help=\"[required]\"\n }\n cmd \"update\" help=\"Update workspace\" {\n flag \"--workspace-id \" help=\"[required]\"\n flag \"--name \" help=\"string value\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete\" help=\"Delete workspace\" {\n flag \"--workspace-id \" help=\"[required]\"\n }\n}\ncmd \"project\" help=\"Operations for project\" {\n cmd \"list\" help=\"List projects\" {\n flag \"--workspace-id \" help=\"[required]\"\n }\n cmd \"create\" help=\"Create project\" {\n flag \"--name \" help=\"[required]\"\n flag \"--workspace-id \" help=\"The ID of the workspace the project belongs to. [required]\"\n flag \"--type \" help=\"The channel type of the project to create. (options: webchat, phone-call) [required]\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get\" help=\"Get project\" {\n flag \"--project-id \" help=\"[required]\"\n }\n cmd \"update\" help=\"Update project\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--name \" help=\"string value\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete\" help=\"Delete project\" {\n flag \"--project-id \" help=\"[required]\"\n }\n}\ncmd \"environment\" help=\"Operations for environment\" {\n cmd \"list\" help=\"List environments\" {\n flag \"--project-id \" help=\"[required]\"\n }\n cmd \"merge\" help=\"Merge environments\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--source-environment-alias \" help=\"The alias of the environment whose changes are merged. [required]\"\n flag \"--target-environment-alias \" help=\"The alias of the environment that receives the merged changes. [required]\"\n flag \"--remove-source-environment\" help=\"If true, the source environment is deleted after the merge.\" default=#false\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"update-traffic-split\" help=\"Update traffic split\" {\n alias \"uts\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--traffic \" help=\"Map of environmentAlias → traffic percentage (0-100). Values must sum to 100. [required]\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get\" help=\"Get environment\" {\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n }\n cmd \"update\" help=\"Update environment\" {\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--name \" help=\"string value\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete\" help=\"Delete environment\" {\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n }\n cmd \"diff\" help=\"Diff environment\" {\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n }\n cmd \"audit-wiring\" help=\"Audit environment wiring\" {\n alias \"aw\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n }\n cmd \"search-text\" help=\"Search project text\" {\n alias \"st\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--pattern \" help=\"The word, phrase or ID to find. With regex, a JavaScript regular expression. [required]\"\n flag \"--regex\" help=\"Read pattern as a regular expression. Default false: literal text.\"\n flag \"--ignore-case\" help=\"Ignore case. Default true.\"\n flag \"--whole-word\" help=\"Match only where no letter, digit or underscore touches the match on either side. Default false.\"\n flag \"--resource-types \" help=\"Search only these kinds of resource. Default: all of them.\" var=#true\n flag \"--limit \" help=\"Hits per page. Default 50.\"\n flag \"--offset \" help=\"Hits to skip: nextOffset from the previous page.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"compile\" help=\"Compile environment\" {\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n }\n cmd \"clone\" help=\"Clone environment\" {\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--name \" help=\"The display name of the new environment. [required]\"\n flag \"--alias \" help=\"Short URL-safe identifier; cannot be 'main' (reserved). [required]\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"publish\" help=\"Publish environment\" {\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--name \" help=\"The name of the release created by publishing. [required]\"\n flag \"--description \" help=\"An optional description of what changed in this release.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n}\ncmd \"message\" help=\"Operations for message\" {\n cmd \"get-many\" help=\"Get many messages\" {\n alias \"gm\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--ids \" help=\"Message IDs to read. Duplicates are ignored; at most 50 distinct IDs. [required]\" var=#true\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get\" help=\"Get message\" {\n flag \"--message-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"delete\" help=\"Delete message\" {\n flag \"--message-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"update\" help=\"Reorder message variants\" {\n flag \"--message-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--variant-order \" help=\"Every variant ID of the message, each exactly once, in the new order. [required]\" var=#true\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"create\" help=\"Create message\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--variants \" help=\"The variants, in stored order. They are alternatives: the runtime says one of them each time. The first variant cannot carry a condition. [required]\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"add-variant\" help=\"Add message variant\" {\n alias \"av\"\n flag \"--message-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--text \" help=\"Message text shown to the end user. Limited markdown: **bold**, _italic_, underline, ~~strikethrough~~, [label](url). {variable_name} inserts a variable or entity, {variable_name.path} a field of a variable. Escape a literal { or \\\\ with a backslash. A name matching neither is stored as literal text and reported in unresolvedReferences; secrets are not available here. [required]\"\n flag \"--delay \" help=\"Milliseconds to wait before this variant is sent.\"\n flag \"--condition \" help=\"{ type: string, matchAll: boolean, assertions: object[] } | { type: string, code: string }\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"update-variant\" help=\"Update message variant\" {\n alias \"uv\"\n flag \"--message-id \" help=\"[required]\"\n flag \"--variant-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--text \" help=\"string value\"\n flag \"--delay \" help=\"Milliseconds to wait before this variant is sent. null removes the delay.\"\n flag \"--condition \" help=\"{ type: string, matchAll: boolean, assertions: object[] } | { type: string, code: string }\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete-variant\" help=\"Delete message variant\" {\n alias \"dv\"\n flag \"--message-id \" help=\"[required]\"\n flag \"--variant-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n}\ncmd \"prompt\" help=\"Operations for prompt\" {\n cmd \"get-many\" help=\"Get many prompts\" {\n alias \"gm\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--ids \" help=\"Prompt IDs to read. Duplicates are ignored; at most 50 distinct IDs. [required]\" var=#true\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get\" help=\"Get prompt\" {\n flag \"--prompt-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"update\" help=\"Update prompt\" {\n flag \"--prompt-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"string value\"\n flag \"--system \" help=\"string value\"\n flag \"--settings \" help=\"JSON object\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete\" help=\"Delete prompt\" {\n flag \"--prompt-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"create\" help=\"Create prompt\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"Defaults to \\\"Untitled prompt\\\", as the editor names one.\"\n flag \"--system \" help=\"Plain text; markdown is not interpreted. {variable_name} inserts a variable or entity, {variable_name.path} a field of a variable. Escape a literal { or \\\\ with a backslash. A name matching neither is stored as literal text and reported in unresolvedReferences; secrets are not available here. [required]\"\n flag \"--settings \" help=\"JSON object\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"update-settings\" help=\"Update prompt settings\" {\n alias \"us\"\n flag \"--prompt-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--model \" help=\"options: gpt-3.5-turbo-1106, gpt-3.5-turbo, gpt-4, gpt-4o, gpt-4o-mini, gpt-4.1-2025-04-14, gpt-4.1-mini-2025-04-14, gpt-4.1-nano-2025-04-14, gpt-o3-mini, o3-2025-04-16, o4-mini-2025-04-16, gpt-5, gpt-5-mini, gpt-5-nano, gpt-5.2, gpt-5.4, gpt-5.4-mini, gpt-5.5, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-6-sol, gpt-6-luna, gpt-6.1-sol, gpt-realtime, gpt-live-1, claude-4-opus, claude-4-sonnet, claude-4.5-sonnet, claude-4.6-sonnet, claude-4.5-haiku, claude-4.5-opus, claude-4.7-opus, bedrock-claude-4-sonnet, bedrock-claude-4.5-sonnet, bedrock-claude-4.6-sonnet, bedrock-claude-5-sonnet, bedrock-claude-5.5-sonnet, bedrock-claude-4.5-haiku, bedrock-claude-5.5-haiku, bedrock-claude-4.5-opus, bedrock-claude-4.7-opus, bedrock-claude-4.8-opus, voiceflow-core-4.0, voiceflow-core-4.1, voiceflow-core-4.2, voiceflow-flash-4.2, gemini-2.5-pro, gemini-2.5-flash, gemini-live-2.5-flash, gemini-3-flash, gemini-3.5-flash, gemini-3.1-pro, gpt-oss-20b, gpt-oss-120b, llama-guard-4, llama-3.1-instant, llama-3.3-versatile, qwen3.6-27b, grok-4.6, voiceflow-flash-4.1, kimi-k3, gemini-flash-2, gpt-4-turbo, claude-3.5-haiku, claude-3-opus, claude-3.7-sonnet, claude-v2, llama-3.2-1b-preview, gemini-pro-1.5, claude-3-haiku, claude-3-sonnet, text-davinci-003, claude-v1, claude-instant-v1, deep-seek-r1-distill-llama-70B, claude-3.5-sonnet\"\n flag \"--max-tokens \" help=\"number value\"\n flag \"--temperature \" help=\"number value\"\n flag \"--response-format \" help=\"string value\"\n flag \"--reasoning-effort \" help=\"options: off, adaptive, minimal, low, medium, high\"\n flag \"--service-tier \" help=\"options: default, flex, priority\"\n flag \"--use-structured-output\" help=\"boolean flag\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n}\ncmd \"variable\" help=\"Operations for variable\" {\n cmd \"list\" help=\"List variables\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"create\" help=\"Create variable\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"The name of the variable. Letters, digits and underscores only, at most 64 characters — this is what a {token} in a text field binds to. Must not already be used by a variable or an entity in this environment. When updating, omit this field unless you are renaming: a variable stored before this rule can hold a name outside the grammar, and echoing that name back would be rejected. [required]\"\n flag \"--color-param \" help=\"The display color of the variable in the Voiceflow editor, as a hex code from the editor's color picker. Use #515A63 (the editor's default) unless the user asks for a color; otherwise pick the closest of #5B9FD7, #CB627B, #56B365, #DC8879, #9A63BC. Do not invent other hex codes. [required]\"\n flag \"--description \" help=\"A short description of what the variable stores.\"\n flag \"--default-value \" help=\"The initial value of the variable at the start of a conversation.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get\" help=\"Get variable\" {\n flag \"--variable-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"update\" help=\"Update variable\" {\n flag \"--variable-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"The name of the variable. Letters, digits and underscores only, at most 64 characters — this is what a {token} in a text field binds to. Must not already be used by a variable or an entity in this environment. When updating, omit this field unless you are renaming: a variable stored before this rule can hold a name outside the grammar, and echoing that name back would be rejected.\"\n flag \"--color-param \" help=\"The display color of the variable in the Voiceflow editor, as a hex code from the editor's color picker. Use #515A63 (the editor's default) unless the user asks for a color; otherwise pick the closest of #5B9FD7, #CB627B, #56B365, #DC8879, #9A63BC. Do not invent other hex codes.\"\n flag \"--description \" help=\"A short description of what the variable stores.\"\n flag \"--default-value \" help=\"The initial value of the variable at the start of a conversation.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete\" help=\"Delete variable\" {\n flag \"--variable-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n}\ncmd \"api-tool\" help=\"Operations for api-tool\" {\n alias \"at\"\n cmd \"list\" help=\"List API tools\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"create\" help=\"Create API tool\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--url \" help=\"string value\"\n flag \"--name \" help=\"[required]\"\n flag \"--body-param \" help=\"{ type: string, contentType: string, content: string } | { type: string, formData: object[] } | { type: string, params: object[] }\"\n flag \"--settings \" help=\"JSON object\"\n flag \"--http-method \" help=\"options: get, put, post, patch, delete [required]\"\n flag \"--description \" help=\"A description of what the API tool does, used by the agent to decide when to call it.\"\n flag \"--headers \" help=\"list of values\"\n flag \"--query-parameters \" help=\"list of values\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get\" help=\"Get API tool\" {\n flag \"--tool-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"update\" help=\"Update API tool\" {\n flag \"--tool-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--url \" help=\"string value\"\n flag \"--name \" help=\"string value\"\n flag \"--body-param \" help=\"{ type: string, contentType: string, content: string } | { type: string, formData: object[] } | { type: string, params: object[] }\"\n flag \"--headers \" help=\"list of values\"\n flag \"--settings \" help=\"JSON object\"\n flag \"--http-method \" help=\"options: get, put, post, patch, delete\"\n flag \"--description \" help=\"A description of what the API tool does, used by the agent to decide when to call it.\"\n flag \"--query-parameters \" help=\"list of values\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete\" help=\"Delete API tool\" {\n flag \"--tool-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"get-schema\" help=\"Get API tool schema\" {\n alias \"gs\"\n flag \"--tool-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"execute\" help=\"Execute API tool\" {\n flag \"--tool-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--inputs \" help=\"A value for each of the API tool's input variables, keyed by input name. Each value replaces the tool's {input_name} placeholder in the URL, headers, query and body. Every declared input needs a value, and a name the tool does not declare is refused. List them with get_schema.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"variable\" help=\"Operations for api-tool-variable\" {\n cmd \"list\" help=\"List variables\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--api-tool-id \" help=\"[required]\"\n }\n cmd \"create\" help=\"Create variable\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"The name of the variable, referenced within the API tool request as {name}. Letters, digits and underscores only, at most 64 characters. [required]\"\n flag \"--api-tool-id \" help=\"The ID of the API tool this variable belongs to. [required]\"\n flag \"--description \" help=\"A description of the variable, used by the agent to determine what value to provide.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get\" help=\"Get variable\" {\n flag \"--variable-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"update\" help=\"Update variable\" {\n flag \"--variable-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"The name of the variable, referenced within the API tool request as {name}. Letters, digits and underscores only, at most 64 characters.\"\n flag \"--description \" help=\"A description of the variable, used by the agent to determine what value to provide.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete\" help=\"Delete variable\" {\n flag \"--variable-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n }\n}\ncmd \"transcript\" help=\"Operations for transcript\" {\n cmd \"search\" help=\"Search transcripts\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--take \" help=\"Page size, 1 to 50. There is no `limit`. Page with `skip` while `hasMore` is true.\" default=20\n flag \"--skip \" help=\"The number of results to skip, used for pagination.\" default=0\n flag \"--start-date \" help=\"Only transcripts created at or after this day (`2026-06-01`, from 00:00 UTC) or ISO 8601 timestamp.\"\n flag \"--end-date \" help=\"Only transcripts created at or before this day (`2026-06-30`, to 23:59:59.999 UTC) or ISO 8601 timestamp.\"\n flag \"--version-param \" help=\"When provided, only transcripts from the draft or published version of the environment are returned. `published` covers the current release and every past release. Applies within a single environment; the main environment is used when `environmentAlias` is omitted. (options: draft, published)\"\n flag \"--filters \" help=\"list of values\"\n flag \"--session-id \" help=\"When provided, only transcripts from this conversation session are returned.\"\n flag \"--environment-alias \" help=\"When provided, only transcripts from the environment with this alias are returned.\"\n flag \"--release-name \" help=\"When provided, only transcripts from the release with this exact name (e.g. `V1.02`) are returned, as listed in the `releases` of the environment. When several releases share the name, transcripts from all of them are returned. Applies within a single environment; the main environment is used when `environmentAlias` is omitted. Cannot be combined with `version: \\\"draft\\\"`.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"grep\" help=\"Grep transcripts\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--pattern \" help=\"Regex (case-insensitive) or plain text to find in the dialogue. A pattern may hold one open quantifier (*, +, ?, {n,} or {n,m}), no backreference and no alternation inside a group. Use exact counts such as \\\\d{3}, or put the alternation at the top level: refund|return. Any other pattern runs as plain text, and the result says so. [required]\"\n flag \"--transcript-ids \" help=\"Transcripts to scan. Leave it out to scan the newest transcripts in the date range.\" var=#true\n flag \"--start-date \" help=\"Lower bound when no transcriptIDs are given: a day or a timestamp.\"\n flag \"--end-date \" help=\"Upper bound when no transcriptIDs are given: a day or a timestamp.\"\n flag \"--environment-alias \" help=\"Only transcripts from this environment, when no transcriptIDs are given.\"\n flag \"--limit \" help=\"How many transcripts to scan at most, 1 to 60.\" default=25\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get\" help=\"Get transcript\" {\n flag \"--transcript-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--format-param \" help=\"`summary` (default): the turns, the tool calls and a turn count. `formatted`: every turn with the debug traces and the first system prompt of each agent. `logs`: the raw log entries, which can be very large. (options: summary, formatted, logs)\" default=\"summary\"\n flag \"--filter-conversation\" help=\"boolean flag\"\n flag \"--custom-trace-types \" help=\"string | array of string\"\n }\n cmd \"files\" help=\"List transcript files\" {\n flag \"--transcript-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n }\n cmd \"query-logs\" help=\"Query transcript logs\" {\n alias \"ql\"\n flag \"--transcript-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--kinds \" help=\"Keep only entries of these kinds. Omit to keep every kind.\" var=#true\n flag \"--levels \" help=\"Keep only entries at these levels, for example [\\\"fatal\\\", \\\"error\\\", \\\"warn\\\"] for what went wrong.\" var=#true\n flag \"--debug-kinds \" help=\"Keep only debug entries of these kinds. Setting it leaves out every entry that is not a debug log.\" var=#true\n flag \"--turns \" help=\"Keep only entries of these turns. Turn 0 holds anything logged before the first input.\"\n flag \"--search \" help=\"Keep only entries whose message or recorded data contains this text, ignoring case. It is plain text, not a regular expression. Separate alternatives with |, as in \\\"timeout|denied\\\", to keep entries that contain any of them.\"\n flag \"--detail \" help=\"options: summary, full\" default=\"summary\"\n flag \"--limit \" help=\"The most entries to return in one page.\" default=50\n flag \"--offset \" help=\"How many matching entries to skip, for paging.\" default=0\n flag \"--order \" help=\"options: asc, desc\" default=\"asc\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"property\" help=\"Operations for property\" {\n cmd \"list\" help=\"List properties\" {\n flag \"--project-id \" help=\"[required]\"\n }\n cmd \"create\" help=\"Create property\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--name \" help=\"[required]\"\n flag \"--type \" help=\"The type of value the property holds. (options: boolean, number, string) [required]\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get\" help=\"Get property\" {\n flag \"--property-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n }\n cmd \"update\" help=\"Update property\" {\n flag \"--property-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--name \" help=\"string value\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete\" help=\"Delete property\" {\n flag \"--property-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n }\n cmd \"set-value\" help=\"Set property value\" {\n alias \"sv\"\n flag \"--property-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--value \" help=\"The value to set for the property on the transcript. [required]\"\n flag \"--transcript-id \" help=\"The ID of the transcript to set the property value on. [required]\"\n flag \"--metadata \" help=\"Additional structured data to record alongside the value. Omit or pass `null` to record none.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n }\n}\ncmd \"function\" help=\"Operations for function\" {\n cmd \"list\" help=\"List functions\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"create\" help=\"Create function\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"[required]\"\n flag \"--code \" help=\"The JavaScript source code executed when the function runs. [required]\"\n flag \"--settings \" help=\"JSON object\"\n flag \"--description \" help=\"A human-readable description of what the function does.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get\" help=\"Get function\" {\n flag \"--function-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"update\" help=\"Update function\" {\n flag \"--function-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"string value\"\n flag \"--code \" help=\"The JavaScript source code executed when the function runs.\"\n flag \"--settings \" help=\"JSON object\"\n flag \"--path-order \" help=\"An ordered list of path IDs controlling the display order of the function's exit paths.\" var=#true\n flag \"--description \" help=\"A human-readable description of what the function does.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete\" help=\"Delete function\" {\n flag \"--function-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"patch-code\" help=\"Patch function code\" {\n alias \"pc\"\n flag \"--function-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--old-string \" help=\"The exact code to replace, copied verbatim from the function's code as a get returned it. Matching is literal: whitespace, indentation, quotes and case must match. Include enough neighbouring code that it occurs once. [required]\"\n flag \"--new-string \" help=\"The code to put in its place. May be empty to delete. [required]\"\n flag \"--replace-all\" help=\"Replace every occurrence. When false, more than one match is an error rather than a guess.\" default=#false\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get-schema\" help=\"Get function schema\" {\n alias \"gs\"\n flag \"--function-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"execute\" help=\"Execute function\" {\n flag \"--function-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--inputs \" help=\"A value for each of the function's input variables, keyed by input name. Every declared input needs a value, and a name the function does not declare is refused. List them with get_schema.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"check\" help=\"Check function\" {\n flag \"--function-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--cases \" help=\"[required]\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"variable\" help=\"Operations for function-variable\" {\n cmd \"list\" help=\"List variables\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--function-id \" help=\"[required]\"\n }\n cmd \"create\" help=\"Create variable\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"The name used to reference the variable in the function code. [required]\"\n flag \"--type \" help=\"options: input, output [required]\"\n flag \"--function-id \" help=\"The ID of the function this variable belongs to. [required]\"\n flag \"--description \" help=\"A human-readable description of what the variable holds.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"get\" help=\"Get variable\" {\n flag \"--variable-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n cmd \"update\" help=\"Update variable\" {\n flag \"--variable-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"The name used to reference the variable in the function code.\"\n flag \"--description \" help=\"A human-readable description of what the variable holds.\"\n flag \"--body \" help=\"Request body as JSON (alternative to individual flags). Can also be provided via stdin.\"\n }\n cmd \"delete\" help=\"Delete variable\" {\n flag \"--variable-id \" help=\"[required]\"\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n }\n }\n cmd \"path\" help=\"Operations for function-path\" {\n cmd \"list\" help=\"List paths\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--function-id \" help=\"[required]\"\n }\n cmd \"create\" help=\"Create path\" {\n flag \"--project-id \" help=\"[required]\"\n flag \"--environment-alias \" help=\"[required]\"\n flag \"--name \" help=\"The name of the exit path, referenced by the function code when returning which path to take. [required]\"\n flag \"--function-id \" help=\"The ID of the function this path belongs to. [required]\"\n flag \"--label