Loading...

Global Options

Learn the global flags supported by the Tambo CLI and how to use them in CI, automation, and common workflows.

All Tambo CLI commands support these global options. You can use them with any command to modify behavior, skip prompts, or handle common scenarios.

Available Options

--version

Shows the current version of the Tambo CLI.

npx tambo --version
# Output: 1.2.3

--yes, -y

Auto-answers "yes" to all confirmation prompts. Required for non-interactive environments like CI/CD.

Examples:

# Skip all prompts during setup
npx tambo init --yes

# Install components without confirmation
npx tambo add form graph --yes

# Update all components without asking
npx tambo update installed --yes

# Migrate components automatically
npx tambo migrate --yes

# Upgrade in CI/CD (required for non-interactive)
npx tambo upgrade --yes

Use cases:

  • CI/CD pipelines (required for upgrade command)
  • Automated deployments
  • Docker builds
  • Batch operations
  • When you're confident about the changes

--legacy-peer-deps

Installs dependencies using npm's --legacy-peer-deps flag. This resolves common dependency conflicts.

Examples:

# Install with legacy peer deps
npx tambo init --legacy-peer-deps

# Add components with legacy peer deps
npx tambo add message-thread-full --legacy-peer-deps

# Upgrade project with legacy peer deps
npx tambo upgrade --legacy-peer-deps

When to use:

  • Getting peer dependency warnings
  • Working with older React versions
  • Complex dependency trees
  • Corporate environments with strict package policies

Dependency Conflicts

If you see errors like "unable to resolve dependency tree" or peer dependency warnings, try adding --legacy-peer-deps to your command.

--prefix <path>

Specifies a custom directory for components instead of the default components/tambo.

Examples:

# Install components in src/components/ui
npx tambo add form --prefix=src/components/ui

# List components in custom directory
npx tambo list --prefix=src/components/ui

# Update components in custom location
npx tambo update installed --prefix=src/components/custom

# Migrate from custom source to custom destination
npx tambo migrate --prefix=src/components/tambo

Common prefix patterns:

  • src/components/ui - Traditional UI components directory
  • src/components/tambo - Dedicated Tambo directory in src
  • app/components/ui - App router components
  • lib/components - Library-style organization

--dry-run

Preview changes before applying them. Currently only available for the migrate command.

Examples:

# Preview migration changes
npx tambo migrate --dry-run

Output example:

🔍 Dry run mode - no changes will be made

The following changes would be applied:
  📁 Move: components/ui/form.tsx → components/tambo/form.tsx
  📁 Move: components/ui/graph.tsx → components/tambo/graph.tsx
  📝 Update: lib/tambo.ts (import paths)

Run without --dry-run to apply these changes.

Combining Options

You can combine multiple options in a single command:

# Install components with custom prefix, skip prompts, and handle conflicts
npx tambo add form graph --prefix=src/components/ui --yes --legacy-peer-deps

# Upgrade with custom prefix
npx tambo upgrade --yes --prefix=src/components/ui

# Migrate automatically with custom paths
npx tambo migrate --yes --prefix=src/components/custom

Command-Specific Options

Some commands have additional options beyond these global ones:

create-app specific options

# Initialize git repository
npx tambo create-app my-app --init-git

# Use specific template
npx tambo create-app my-app --template=standard

add specific options

# Install multiple components
npx tambo add form graph canvas-space

Best Practices

For Development

# Safe exploration - preview migration first
npx tambo migrate --dry-run

# Quick iterations
npx tambo add form --yes
npx tambo update form --yes

Troubleshooting

Common Issues

Issue: Command not found

# Check CLI version
npx tambo --version

# Update to latest
npm install -g @tambo-ai/cli@latest

Issue: Permission errors

# Use npx instead of global install
npx tambo init --yes

Issue: Dependency conflicts

# Use legacy peer deps
npx tambo add form --legacy-peer-deps

Issue: Wrong directory

# Check current components
npx tambo list

# Use correct prefix
npx tambo list --prefix=src/components/ui

Exit Codes

The Tambo CLI uses standard exit codes for shell integration and CI/CD:

Exit CodeMeaningCommon Causes
0SuccessCommand completed successfully
1FailureCommand failed, error details in output

Usage in scripts:

# Check if command succeeded
if npx tambo add form --yes; then
  echo "Component installed successfully"
else
  echo "Component installation failed"
  exit 1
fi

# CI/CD example
npx tambo upgrade --yes || exit 1
npm run build || exit 1

Common failure scenarios:

  • Missing required files (package.json, tsconfig.json)
  • Invalid component names
  • Network errors during installation
  • User cancellation (Ctrl+C or answering "No" to prompts)
  • Non-interactive environment without --yes flag
  • File system permission errors