Skip to content

Commit 7cb7fee

Browse files
committed
v0.1.7: Enhanced user experience and help system
- Enhanced version command with comprehensive system information - Improved help text with better command descriptions and getting started guides - Better root command with clear usage examples and resource links - Enhanced login command with security information and alternative authentication - Updated MCP setup examples with more relevant queries - Improved MCP tool messages for better user guidance
1 parent a9f6d1f commit 7cb7fee

File tree

18 files changed

+1026
-519
lines changed

18 files changed

+1026
-519
lines changed

β€ŽVERSIONβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.1.6
1+
0.1.7

β€Žcmd/init.goβ€Ž

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -371,36 +371,43 @@ func runInitCommand(cmd *cobra.Command, args []string) error {
371371
}
372372

373373
// Framework-specific instructions
374-
switch project.ProjectType {
375-
case integrations.ProjectTypeWeb:
376-
fmt.Printf("%d. Import and use Vapi in your application\n", stepNum)
377-
fmt.Println(" - Check the generated components in your project")
378-
fmt.Println(" - Use the VapiButton component or useVapi hook")
379-
case integrations.ProjectTypeBackend:
380-
fmt.Printf("%d. Run the example code:\n", stepNum)
374+
if project.ProjectType != integrations.ProjectTypeUnknown {
375+
fmt.Printf("%d. Framework-specific setup:\n", stepNum)
376+
381377
switch project.Framework {
382-
case integrations.FrameworkPython:
383-
fmt.Println(" python vapi_examples/basic_example.py")
384-
case integrations.FrameworkGolang:
385-
fmt.Println(" go run examples/vapi/basic_example.go")
378+
case integrations.FrameworkReact:
379+
fmt.Println(" - Add the Vapi component to your app")
380+
fmt.Println(" - Configure the voice interface in your main component")
381+
case integrations.FrameworkNext:
382+
fmt.Println(" - Add Vapi to your Next.js pages or components")
383+
fmt.Println(" - Consider using the useVapi hook for state management")
386384
case integrations.FrameworkNode:
387-
if project.IsTypeScript {
388-
fmt.Println(" npx tsx vapi-examples/basic-example.ts")
389-
} else {
390-
fmt.Println(" node vapi-examples/basic-example.js")
391-
}
392-
case integrations.FrameworkReact, integrations.FrameworkVue, integrations.FrameworkAngular,
393-
integrations.FrameworkSvelte, integrations.FrameworkNext, integrations.FrameworkNuxt,
394-
integrations.FrameworkRemix, integrations.FrameworkVanilla, integrations.FrameworkReactNative,
395-
integrations.FrameworkFlutter, integrations.FrameworkRuby, integrations.FrameworkJava,
396-
integrations.FrameworkCSharp, integrations.FrameworkUnknown:
397-
fmt.Println(" Check the generated example code")
385+
fmt.Println(" - Set up webhook endpoints for call events")
386+
fmt.Println(" - Create assistant configuration and call management routes")
387+
case integrations.FrameworkPython:
388+
fmt.Println(" - Configure webhook handlers for call events")
389+
fmt.Println(" - Set up assistant and call management endpoints")
398390
}
399-
case integrations.ProjectTypeMobile:
400-
fmt.Printf("%d. Check the generated example code\n", stepNum)
401-
case integrations.ProjectTypeUnknown:
402-
fmt.Printf("%d. Check the Vapi documentation for integration instructions\n", stepNum)
391+
fmt.Println()
392+
stepNum++
403393
}
394+
395+
// MCP Integration recommendation (v0.1.9 feature)
396+
fmt.Printf("%d. 🧠 Set up IDE Integration (Recommended):\n", stepNum)
397+
fmt.Println(" vapi mcp setup")
398+
fmt.Println(" This turns your IDE into a Vapi expert with:")
399+
fmt.Println(" β€’ Real-time access to 138+ documentation pages")
400+
fmt.Println(" β€’ Smart code suggestions and examples")
401+
fmt.Println(" β€’ No more hallucinated API information")
402+
fmt.Println(" β€’ Works with Cursor, Windsurf, and VSCode")
403+
fmt.Println()
404+
stepNum++
405+
406+
// Testing and deployment
407+
fmt.Printf("%d. Test and deploy:\n", stepNum)
408+
fmt.Println(" - Test your voice integration locally")
409+
fmt.Println(" - Set up webhooks for production")
410+
fmt.Println(" - Deploy with your API keys configured")
404411
fmt.Println()
405412

406413
// Offer to open documentation

β€Žcmd/login.goβ€Ž

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,28 @@ import (
2727
"github.com/VapiAI/cli/pkg/auth"
2828
)
2929

30-
// Authenticate with Vapi via browser-based OAuth flow (alias for 'vapi auth login')
30+
// Authenticate with Vapi using browser-based login flow
3131
var loginCmd = &cobra.Command{
3232
Use: "login",
33-
Short: "Authenticate with Vapi using browser-based login",
34-
Long: `Opens your browser to authenticate with Vapi.
33+
Short: "Authenticate with Vapi using secure browser login",
34+
Long: `πŸ” Authenticate with Vapi using secure browser-based login
3535
36-
This secure authentication flow:
37-
1. Opens dashboard.vapi.ai in your browser
38-
2. Runs a local server to receive the auth token
39-
3. Saves your API key for future CLI commands
36+
This command will:
37+
1. Open your default browser to the Vapi authentication page
38+
2. Allow you to sign in with your existing Vapi account
39+
3. Automatically save your authentication credentials locally
40+
4. Enable access to all Vapi CLI features
4041
41-
Note: This is an alias for 'vapi auth login'. For more authentication commands,
42-
see 'vapi auth --help'.`,
42+
πŸ†• New to Vapi?
43+
Sign up for free at: https://dashboard.vapi.ai
44+
45+
πŸ”‘ Alternative Authentication:
46+
You can also set your API key directly:
47+
export VAPI_API_KEY=your_api_key_here
48+
49+
πŸ›‘οΈ Security:
50+
Your credentials are stored securely in your system's credential store
51+
and are only used to authenticate with Vapi's APIs.`,
4352
RunE: analytics.TrackCommandWrapper("auth", "login", func(cmd *cobra.Command, args []string) error {
4453
fmt.Println("πŸ” Authenticating with Vapi...")
4554
fmt.Println()
@@ -50,12 +59,15 @@ see 'vapi auth --help'.`,
5059
return err
5160
}
5261

53-
fmt.Println("\nYou can now use all Vapi CLI commands.")
62+
fmt.Println("\nβœ… Authentication successful!")
63+
fmt.Println()
64+
fmt.Println("🎯 Next steps:")
5465
fmt.Println("β€’ List assistants: vapi assistant list")
5566
fmt.Println("β€’ View call history: vapi call list")
56-
fmt.Println("β€’ Integrate with projects: vapi init")
67+
fmt.Println("β€’ Initialize project: vapi init")
68+
fmt.Println("β€’ Set up IDE integration: vapi mcp setup")
5769
fmt.Println()
58-
fmt.Println("πŸ’‘ For more auth commands, try: vapi auth --help")
70+
fmt.Println("πŸ’‘ For more commands, try: vapi --help")
5971

6072
return nil
6173
}),

β€Žcmd/manual.goβ€Ž

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ import (
2727
"github.com/spf13/cobra"
2828
"github.com/spf13/cobra/doc"
2929

30+
"os/exec"
31+
3032
versionpkg "github.com/VapiAI/cli/pkg/version"
3133
)
3234

@@ -41,6 +43,184 @@ var manualCmd = &cobra.Command{
4143

4244
var manualOutputDir string
4345

46+
// installManPagesCmd installs manual pages for the current user
47+
var installManPagesCmd = &cobra.Command{
48+
Use: "install-man-pages",
49+
Short: "Install manual pages for the Vapi CLI",
50+
Long: `Install Unix manual pages for the Vapi CLI to enable 'man vapi' command.
51+
52+
This command will:
53+
1. Generate the latest manual pages for all commands
54+
2. Install them to the appropriate system location
55+
3. Update the manual database
56+
57+
Requires administrative privileges for system-wide installation.`,
58+
RunE: installManualPages,
59+
}
60+
61+
func installManualPages(cmd *cobra.Command, args []string) error {
62+
fmt.Printf("πŸ“– Installing Vapi CLI manual pages...\n")
63+
64+
// Create a temporary directory for generated pages
65+
tmpDir := filepath.Join(os.TempDir(), "vapi-man-pages")
66+
if err := os.MkdirAll(tmpDir, 0o750); err != nil {
67+
return fmt.Errorf("failed to create temporary directory: %w", err)
68+
}
69+
defer os.RemoveAll(tmpDir) // Clean up temp directory
70+
71+
// Generate man pages
72+
fmt.Printf(" πŸ“ Generating manual pages...\n")
73+
74+
header := &doc.GenManHeader{
75+
Title: "VAPI",
76+
Section: "1",
77+
Source: fmt.Sprintf("Vapi CLI %s", versionpkg.Get()),
78+
Manual: "Vapi CLI Manual",
79+
Date: &[]time.Time{time.Now()}[0],
80+
}
81+
82+
if err := doc.GenManTree(rootCmd, header, tmpDir); err != nil {
83+
return fmt.Errorf("failed to generate man pages: %w", err)
84+
}
85+
86+
// Find appropriate installation directory
87+
manDir := getManPageInstallDir()
88+
if manDir == "" {
89+
return fmt.Errorf("could not find suitable man page directory")
90+
}
91+
92+
// Check if directory exists and is writable
93+
if err := ensureManDirWritable(manDir); err != nil {
94+
fmt.Printf(" ⚠️ Need administrative privileges to install to %s\n", manDir)
95+
fmt.Printf(" πŸ’‘ Suggestions:\n")
96+
fmt.Printf(" β€’ Run with sudo: sudo vapi install-man-pages\n")
97+
fmt.Printf(" β€’ Or manually copy files from %s to %s\n", tmpDir, manDir)
98+
return err
99+
}
100+
101+
// Copy man pages to installation directory
102+
fmt.Printf(" πŸ“‹ Installing to %s...\n", manDir)
103+
104+
files, err := filepath.Glob(filepath.Join(tmpDir, "*.1"))
105+
if err != nil {
106+
return fmt.Errorf("failed to find generated man pages: %w", err)
107+
}
108+
109+
for _, file := range files {
110+
fileName := filepath.Base(file)
111+
destPath := filepath.Join(manDir, fileName)
112+
113+
if err := copyFile(file, destPath); err != nil {
114+
return fmt.Errorf("failed to copy %s: %w", fileName, err)
115+
}
116+
117+
// Set appropriate permissions
118+
if err := os.Chmod(destPath, 0o644); err != nil {
119+
fmt.Printf(" ⚠️ Warning: failed to set permissions on %s\n", fileName)
120+
}
121+
}
122+
123+
// Update man database
124+
fmt.Printf(" πŸ”„ Updating manual database...\n")
125+
if err := updateManDatabase(); err != nil {
126+
fmt.Printf(" ⚠️ Warning: failed to update man database: %v\n", err)
127+
fmt.Printf(" πŸ’‘ You may need to run 'sudo mandb' manually\n")
128+
}
129+
130+
fmt.Printf(" βœ… Installed %d manual page(s)\n", len(files))
131+
fmt.Println()
132+
fmt.Println("πŸ“š Manual pages installed successfully!")
133+
fmt.Println()
134+
fmt.Println("πŸ” Usage:")
135+
fmt.Println(" man vapi # Main CLI manual")
136+
fmt.Println(" man vapi-call # Call management")
137+
fmt.Println(" man vapi-mcp # MCP integration")
138+
fmt.Println(" man vapi-assistant# Assistant management")
139+
fmt.Println()
140+
fmt.Println("πŸ’‘ Try 'man vapi' to test the installation!")
141+
142+
return nil
143+
}
144+
145+
func getManPageInstallDir() string {
146+
// Check common man page directories in order of preference
147+
candidates := []string{
148+
"/usr/local/share/man/man1", // Most common for user-installed tools
149+
"/opt/homebrew/share/man/man1", // Homebrew on Apple Silicon
150+
"/usr/share/man/man1", // System-wide
151+
}
152+
153+
for _, dir := range candidates {
154+
if stat, err := os.Stat(dir); err == nil && stat.IsDir() {
155+
return dir
156+
}
157+
}
158+
159+
return ""
160+
}
161+
162+
func ensureManDirWritable(dir string) error {
163+
// Check if directory exists
164+
stat, err := os.Stat(dir)
165+
if err != nil {
166+
// Try to create the directory
167+
if err := os.MkdirAll(dir, 0o755); err != nil {
168+
return fmt.Errorf("directory does not exist and cannot be created: %w", err)
169+
}
170+
return nil
171+
}
172+
173+
if !stat.IsDir() {
174+
return fmt.Errorf("path exists but is not a directory")
175+
}
176+
177+
// Test write permissions by creating a temporary file
178+
testFile := filepath.Join(dir, ".vapi-test-write")
179+
if file, err := os.Create(testFile); err != nil {
180+
return fmt.Errorf("directory is not writable: %w", err)
181+
} else {
182+
file.Close()
183+
os.Remove(testFile) // Clean up test file
184+
}
185+
186+
return nil
187+
}
188+
189+
func copyFile(src, dst string) error {
190+
srcFile, err := os.Open(src)
191+
if err != nil {
192+
return err
193+
}
194+
defer srcFile.Close()
195+
196+
dstFile, err := os.Create(dst)
197+
if err != nil {
198+
return err
199+
}
200+
defer dstFile.Close()
201+
202+
_, err = srcFile.WriteTo(dstFile)
203+
return err
204+
}
205+
206+
func updateManDatabase() error {
207+
// Try to update the man database
208+
commands := [][]string{
209+
{"mandb"}, // Most common
210+
{"makewhatis"}, // Some systems
211+
{"catman", "-w"}, // Alternative
212+
}
213+
214+
for _, cmdArgs := range commands {
215+
cmd := exec.Command(cmdArgs[0], cmdArgs[1:]...)
216+
if err := cmd.Run(); err == nil {
217+
return nil // Success
218+
}
219+
}
220+
221+
return fmt.Errorf("no suitable man database update command found")
222+
}
223+
44224
func generateManualPages(cmd *cobra.Command, args []string) error {
45225
fmt.Printf("πŸ“– Generating manual pages for Vapi CLI v%s...\n", versionpkg.Get())
46226

@@ -95,4 +275,5 @@ func init() {
95275
"Output directory for generated manual pages")
96276

97277
rootCmd.AddCommand(manualCmd)
278+
rootCmd.AddCommand(installManPagesCmd)
98279
}

β€Žcmd/mcp.goβ€Ž

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -541,17 +541,22 @@ func displayPostSetupInstructions() {
541541
fmt.Println("4. Start a new chat and ask your AI assistant about Vapi!")
542542
fmt.Println()
543543
fmt.Println("Try asking your AI:")
544-
fmt.Println("β€’ \"How do I create a voice assistant with Vapi?\"")
545-
fmt.Println("β€’ \"Show me Vapi examples for phone calls\"")
546-
fmt.Println("β€’ \"What are the latest Vapi features?\"")
544+
fmt.Println("β€’ \"Find MCP server documentation for Claude Desktop configuration\"")
545+
fmt.Println("β€’ \"Show me Vapi examples for creating voice assistants\"")
546+
fmt.Println("β€’ \"How do I set up phone numbers and make outbound calls?\"")
547+
fmt.Println("β€’ \"What's the difference between function tools and MCP tools?\"")
548+
fmt.Println("β€’ \"Show me webhook configuration examples\"")
549+
fmt.Println("β€’ \"Find the latest Vapi API reference for assistants\"")
547550
fmt.Println()
548551
fmt.Println("Your IDE AI assistant now has access to:")
549-
fmt.Println("β€’ Complete Vapi documentation")
550-
fmt.Println("β€’ Code examples and templates")
551-
fmt.Println("β€’ Best practices and guides")
552-
fmt.Println("β€’ API reference and troubleshooting")
552+
fmt.Println("β€’ 138+ real documentation pages with actual content")
553+
fmt.Println("β€’ MCP server setup guides and Claude Desktop configuration")
554+
fmt.Println("β€’ Complete API reference with request/response examples")
555+
fmt.Println("β€’ Voice provider configurations (ElevenLabs, OpenAI, etc.)")
556+
fmt.Println("β€’ Real code examples from the official documentation")
557+
fmt.Println("β€’ Integration guides for tools, webhooks, and workflows")
553558
fmt.Println()
554-
fmt.Println("πŸ’‘ Pro tip: Your AI will no longer hallucinate Vapi information!")
559+
fmt.Println("πŸ’‘ Pro tip: Use 'Find Vapi examples for [feature]' to get real code samples!")
555560
fmt.Println()
556561
fmt.Println("Need help? Check 'vapi mcp status' or visit https://docs.vapi.ai")
557562
}

β€Žcmd/root.goβ€Ž

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,30 @@ func displayBanner() {
8484
fmt.Println()
8585
}
8686

87-
// The main CLI command that displays help when run without subcommands
87+
// rootCmd represents the base command when called without any subcommands
8888
var rootCmd = &cobra.Command{
8989
Use: "vapi",
90-
Short: "Voice AI for developers - Vapi CLI",
91-
Long: `The official CLI for Vapi - build voice AI agents that make phone calls`,
90+
Short: "Official Vapi CLI - Build voice AI applications with ease",
91+
Long: `🎀 Vapi CLI - The official command-line interface for Vapi
92+
93+
Build, deploy, and manage voice AI applications with the power of Vapi's platform.
94+
From simple voice assistants to complex phone call workflows, the Vapi CLI provides
95+
everything you need to create production-ready voice AI solutions.
96+
97+
πŸš€ Getting Started:
98+
vapi login # Authenticate with your Vapi account
99+
vapi init # Initialize Vapi in your project
100+
vapi mcp setup # Set up IDE integration for better development
101+
102+
🎯 Common Tasks:
103+
vapi assistant list # View your voice assistants
104+
vapi call create # Make outbound calls programmatically
105+
vapi phone list # Manage phone numbers
106+
vapi logs # View call logs and system events
107+
108+
πŸ“š Documentation: https://docs.vapi.ai
109+
πŸ’¬ Community: https://discord.gg/vapi
110+
πŸ› Issues: https://github.com/VapiAI/cli/issues`,
92111
RunE: func(cmd *cobra.Command, args []string) error {
93112
// Track command execution
94113
startTime := time.Now()

0 commit comments

Comments
Β (0)