Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f2051f2
feat(client): let a request say what the spinner is waiting for
Bradenream Nov 29, 2026
4db9f7e
feat(interactive): pick a missing ID from a list
Bradenream Nov 29, 2026
13ba88f
feat: list organizations, workspaces, projects and environments
Bradenream Nov 29, 2026
f933b1f
feat(output): explain every API and connection error, with next steps
Bradenream Nov 29, 2026
413553b
fix(output): check --output-format and --jq before sending the request
Bradenream Nov 29, 2026
8a97d7c
feat(cli): explain usage errors with a cause and next steps
Bradenream Nov 29, 2026
a7f3c76
docs: specify how errors read, and call personal keys by their name
Bradenream Nov 29, 2026
05090d0
feat(output): name the organization or workspace a refusal targeted
Bradenream Nov 29, 2026
94ab4db
feat(home): carry the current workspace and project to the next command
Bradenream Nov 29, 2026
4a11312
feat(home): suggest the next command for what is current
Bradenream Nov 29, 2026
e426421
feat(home): make creating a project the default first step
Bradenream Nov 29, 2026
4eeba3a
feat(home): lead with creating a project, in the banner and the prompt
Bradenream Nov 29, 2026
eafeca3
fix(interactive): offer optional fields only on commands that make or…
Bradenream Nov 29, 2026
0f33fe4
feat(home): take the main environment, and let flags wait until asked
Bradenream Nov 29, 2026
6ae782f
feat(output): show a prompt's page as a document
Bradenream Nov 29, 2026
e90370c
fix(interactive): name what was picked, and explain older projects
Bradenream Nov 29, 2026
34f1a54
fix(client): --timeout no longer prints nothing and exits 0
Bradenream Nov 30, 2026
dfed2e1
fix(flagutil): variant flags on optional unions no longer panic
Bradenream Nov 30, 2026
dc33dce
fix(interactive): type a secret's value unseen
Bradenream Nov 30, 2026
df52ad0
fix(flagutil): give a script's own input back, and read --body -
Bradenream Nov 30, 2026
8d5df87
fix(document): upload a .md file as Markdown
Bradenream Nov 30, 2026
c83e668
fix(output): Ctrl-C during a request says Canceled
Bradenream Nov 30, 2026
60bd620
fix(ui): stop the 5s terminal query on every command
Bradenream Nov 30, 2026
a1d6892
fix(sdk): escape an ID that goes in the URL path
Bradenream Nov 30, 2026
f7206d1
fix(flagutil)!: body flags turn off reading stdin
Bradenream Nov 30, 2026
df865fd
fix(flagutil): say when body flags left a piped body unread
Bradenream Nov 30, 2026
d2fe400
fix(output): name the field a request body is missing
Bradenream Nov 30, 2026
bca9e5e
fix(home): keep a secret's value out of the prompt's history
Bradenream Nov 30, 2026
ce35548
fix(output): redact credentials in --include-headers
Bradenream Nov 30, 2026
1e96047
style(output): format two returns the same under every gofmt
Bradenream Nov 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Download pre-built binaries for your platform from the [releases page](https://g

## Quickstart: zero to a talking agent

Runnable end to end by a person or by a coding agent. You need credentials and [`jq`](https://jqlang.org) (used only to pull IDs out of the JSON responses). At a terminal, `vf auth login` signs you in through the browser and stores the session for you (see [Browser sign-in](#browser-sign-in-oauth2)). For scripts, CI, and coding agents, create a **personal access token** in Voiceflow under **Settings → Access tokens** (tokens start with `vfp_`; they expire, default 30 days), then:
Runnable end to end by a person or by a coding agent. You need credentials and [`jq`](https://jqlang.org) (used only to pull IDs out of the JSON responses). At a terminal, `vf auth login` signs you in through the browser and stores the session for you (see [Browser sign-in](#browser-sign-in-oauth2)). For scripts, CI, and coding agents, create a **personal key** in Voiceflow under **Settings → Personal keys** (keys start with `vfp_`; they expire, default 30 days), then:

```bash
export VF_TOKEN=vfp_... # every command also accepts --token
Expand Down Expand Up @@ -764,29 +764,32 @@ Individual flags override `--body` values:
vf <command> --body '{"name": "John", "age": 30}' --name "Jane"
```

### Stdin piping (lowest priority)
### Stdin

Pipe JSON into any command that accepts a request body:
With no body flags, piped JSON is the body:

```bash
echo '{"name": "John", "age": 30}' | vf <command>

# Read body from a file
vf <command> < request.json

# Pipe from another command
curl -s https://example.com/data.json | vf <command>
```

Individual flags override stdin values:
Body flags turn stdin off, so a command run from a script or a loop never takes input that wasn't meant for it:

```bash
# Result: {name: "Jane", age: 30}
echo '{"name": "John", "age": 30}' | vf <command> --name "Jane"
# Each pass gets its own line; vf leaves the rest for the loop
cat names.txt | while read -r name; do vf <command> --name "$name"; done
```

This is useful for chaining commands, reading from files, or scripting:
To merge piped JSON with flags, read it with `--body -`. Individual flags still win:

```bash
# Read body from a file
vf <command> < request.json

# Pipe from another command
curl -s https://example.com/data.json | vf <command>
# Result: {name: "Jane", age: 30}
echo '{"name": "John", "age": 30}' | vf <command> --body - --name "Jane"
```

### Priority
Expand All @@ -796,8 +799,8 @@ When multiple input methods are used, the priority is:
| Priority | Source | Description |
|----------|--------|-------------|
| 1 (highest) | Individual flags | `--name "Jane"` always wins |
| 2 | `--body` flag | Whole-body JSON via flag |
| 3 (lowest) | Stdin | Piped JSON input |
| 2 | `--body` flag | Whole-body JSON via flag, or stdin with `--body -` |
| 3 (lowest) | Stdin | Piped JSON, read only when no body flag is given |
<!-- End Request Body Input [stdinpiping] -->

<!-- Start Server Selection [server] -->
Expand Down
4 changes: 3 additions & 1 deletion internal/cli/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/voiceflow/cli/internal/config"
"github.com/voiceflow/cli/internal/oauth"
"github.com/voiceflow/cli/internal/output"
"github.com/voiceflow/cli/internal/termbg"
"golang.org/x/term"
"os"
)
Expand Down Expand Up @@ -117,7 +118,7 @@ func runAuthLoginCmd(cmd *cobra.Command, args []string) error {
[]string{
fmt.Sprintf("Run '%s auth login' without --manual/--no-interactive to get a browser sign-in URL to give the user", "vf"),
fmt.Sprintf("Pass the token directly: '%s auth login --token <token>'", "vf"),
fmt.Sprintf("Set credentials via environment variables (prefix: %s_)", "VF"),
"Or set VF_TOKEN to a personal key the user creates under Settings → Personal keys", // errors.go: concrete next steps
fmt.Sprintf("Run '%s auth whoami' to verify current authentication", "vf"),
},
)
Expand Down Expand Up @@ -243,6 +244,7 @@ func authIsInteractive(cmd *cobra.Command) bool {

// authFormTheme builds the form theme for auth login.
func authFormTheme() *huh.Theme {
termbg.Detect() // ../termbg: ask the terminal's background before the form takes the terminal
t := *huh.ThemeBase()

accent := lipgloss.Color("#397DFF")
Expand Down
31 changes: 31 additions & 0 deletions internal/cli/bodyhelp.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// This file is not generated by Speakeasy. It has every --body flag say how
// stdin is read.
//
// The generated help said the body "can also be provided via stdin", which was
// true of any non-terminal stdin, merged with the flags. Now body flags turn
// stdin off and `--body -` reads it (flagutil/stdin.go), and the help says so.

package cli

import (
"strings"

"github.com/spf13/cobra"
)

// bodyFlagHelp is what --body says on every command that takes a body.
const bodyFlagHelp = "Request body as JSON (alternative to individual flags). --body - reads it from stdin; piped stdin is read on its own only when no body flag is given."

// describeBodyFlags gives every generated --body flag bodyFlagHelp.
func describeBodyFlags(root *cobra.Command) {
var walk func(c *cobra.Command)
walk = func(c *cobra.Command) {
if f := c.LocalFlags().Lookup("body"); f != nil && strings.HasPrefix(f.Usage, "Request body as JSON") {
f.Usage = bodyFlagHelp
}
for _, sub := range c.Commands() {
walk(sub)
}
}
walk(root)
}
34 changes: 34 additions & 0 deletions internal/cli/bodyhelp_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// This file is not generated by Speakeasy. It covers bodyhelp.go.

package cli

import (
"testing"

"github.com/spf13/cobra"
)

// Every --body flag says that `--body -` reads stdin.
func TestEveryBodyFlagSaysHowStdinIsRead(t *testing.T) {
root, err := NewRootCommand()
if err != nil {
t.Fatal(err)
}
found := 0
var walk func(c *cobra.Command)
walk = func(c *cobra.Command) {
if f := c.LocalFlags().Lookup("body"); f != nil {
found++
if f.Usage != bodyFlagHelp {
t.Errorf("vf %s --body: %q", c.CommandPath(), f.Usage)
}
}
for _, sub := range c.Commands() {
walk(sub)
}
}
walk(root)
if found < 100 {
t.Fatalf("only %d --body flags found; the walk is broken", found)
}
}
8 changes: 5 additions & 3 deletions internal/cli/configure.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/spf13/cobra"
"github.com/voiceflow/cli/internal/config"
"github.com/voiceflow/cli/internal/output"
"github.com/voiceflow/cli/internal/termbg"
"github.com/voiceflow/cli/internal/usage"
"golang.org/x/term"
"os"
Expand Down Expand Up @@ -45,9 +46,9 @@ func runConfigureCmd(cmd *cobra.Command, args []string) error {
"configure_blocked",
"the 'configure' command is interactive and cannot be used in agent mode",
[]string{
fmt.Sprintf("Set credentials via environment variables (prefix: %s_)", "VF"),
"Pass credentials directly as CLI flags for each command",
fmt.Sprintf("Run '%s whoami' to verify current authentication", "vf"),
"Sign in with 'vf auth login': in agent mode it prints a URL to give the user, then waits for them", // errors.go: concrete next steps
"Or set VF_TOKEN to a personal key the user creates under Settings → Personal keys; every command also accepts --token",
"'vf auth whoami' shows what is configured, without a network call",
},
)
}
Expand Down Expand Up @@ -158,6 +159,7 @@ func configureIsInteractive(cmd *cobra.Command) bool {

// configureFormTheme builds the form theme for the configure command.
func configureFormTheme() *huh.Theme {
termbg.Detect() // ../termbg: ask the terminal's background before the form takes the terminal
t := *huh.ThemeBase()

accent := lipgloss.Color("#397DFF")
Expand Down
Loading
Loading