Skip to main content

Llama CLI

A powerful command-line interface for interacting with the LlamaSearch.ai ecosystem of tools.

Features

  • Unified Interface: Access all LlamaSearch.ai tools through a single, consistent CLI
  • Advanced Command Structure: Organized command hierarchy with intuitive subcommands
  • Configuration Management: Save and manage profiles for different environments
  • Interactive Mode: Terminal UI for exploring available commands and options
  • Shell Completion: Tab completion for commands, options, and arguments
  • Plugin System: Extensible architecture for adding custom commands
  • Authentication: Secure authentication with different LlamaSearch.ai services
  • Batch Processing: Run commands in batch mode with input/output redirection

Installation

Using pip

pip install llama-cli

From source

git clone https://llamasearch.ai
cd llama-cli
pip install -e .

Quick Start

After installation, you can use the llama command to access all functionality:

# Show help and available commands
llama --help

# Show version information
llama --version

# Initialize configuration
llama init

# Authenticate with LlamaSearch.ai services
llama auth login

Command Structure

The CLI is organized into categories of commands:

llama
├── auth          # Authentication commands
│   ├── login     # Log in to LlamaSearch.ai services
│   ├── logout    # Log out from current session
│   └── status    # Show current authentication status
├── config        # Configuration management
│   ├── get       # Get configuration values
│   ├── set       # Set configuration values
│   └── list      # List available configurations
├── search        # Search commands
│   ├── query     # Perform a search query
│   ├── index     # Manage search indices
│   └── vector    # Vector search operations
├── db            # Database operations
│   ├── query     # Run database queries
│   ├── migrate   # Run database migrations
│   └── backup    # Backup and restore operations
├── kv            # Key-value store operations
│   ├── get       # Get values from key-value store
│   ├── set       # Set values in key-value store
│   └── delete    # Delete keys from key-value store
├── api           # API client operations
│   ├── request   # Make API requests
│   ├── describe  # Describe API endpoints
│   └── generate  # Generate API client code
├── pdf           # PDF processing tools
│   ├── convert   # Convert PDFs to other formats
│   ├── extract   # Extract content from PDFs
│   └── search    # Search within PDF documents
└── analytics     # Analytics tools
    ├── track     # Track events and metrics
    ├── report    # Generate analytics reports
    └── visualize # Visualize analytics data

Configuration

Llama CLI uses a configuration file located at ~/.config/llama/config.yaml by default. You can also specify a custom configuration file using the --config option.

Example configuration:

# Global configuration
default_profile: prod
output_format: json
verbose: false

# Profiles
profiles:
  dev:
    api_url: https://dev.api.llamasearch.ai
    api_key: your_dev_api_key
  prod:
    api_url: https://api.llamasearch.ai
    api_key: your_prod_api_key

# Tool-specific configurations
search:
  default_index: main
  max_results: 50

db:
  connection_string: "sqlite:///data.db"
  timeout: 30

Interactive Mode

Llama CLI includes an interactive shell mode that you can use to explore and run commands:

llama shell

In interactive mode, you can:

  • Browse available commands with tab completion
  • View inline help and examples
  • Execute commands with history and editing
  • Use context-aware autocompletion

Shell Completion

You can enable shell completion for bash, zsh, or fish:

# For bash
llama completion bash >> ~/.bashrc

# For zsh
llama completion zsh >> ~/.zshrc

# For fish
llama completion fish > ~/.config/fish/completions/llama.fish

Plugin System

Llama CLI can be extended with plugins. Plugins can add new commands or modify existing ones.

To install a plugin:

llama plugins install llamasearch-plugin-name

To create a plugin, use the plugin template:

llama plugins create my-plugin

Examples

Search Operations

# Perform a search query
llama search query "machine learning frameworks" --index docs --limit 10 --format json

# Create a new search index
llama search index create my-index --schema schema.yaml

# Perform vector search
llama search vector "semantic query" --model text-embedding-ada-002 --top 5

Database Operations

# Execute a SQL query
llama db query "SELECT * FROM users LIMIT 10" --connection prod

# Run database migrations
llama db migrate up --target latest

# Export database data
llama db export users.csv --table users --format csv

Key-Value Store Operations

# Get a value
llama kv get my-key --store default

# Set a value
llama kv set my-key my-value --ttl 3600

# Delete a key
llama kv delete my-key

API Operations

# Make a GET request
llama api request get /users/123 --format json

# Generate an API client
llama api generate python --output ./client --spec openapi.yaml

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT

Metadata

Release files for llama-cli-llamasearch 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llama-cli-llamasearch 0.1.0
File Size Uploaded
llama_cli_llamasearch-0.1.0.tar.gz 27.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for llama-cli-llamasearch 0.1.0
File Interpreter ABI Platform
llama_cli_llamasearch-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 59.4 kB

Release files / llama_cli_llamasearch-0.1.0.tar.gz

Download URL llama_cli_llamasearch-0.1.0.tar.gz
Size 27.9 kB
Tags Source
SHA-256 checksum
How to use checksums
20971dffb9400b2db23d2cd1b06d852e04ebf90080d1e5ae9d5b219e656c833b
BLAKE2b-256 checksum
How to use checksums
3dbf0d591530b6272126602d727b39da201e71173fc95f04f5976ccabcb0e7e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / llama_cli_llamasearch-0.1.0-py3-none-any.whl

Download URL llama_cli_llamasearch-0.1.0-py3-none-any.whl
Size 31.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b489d69bd2bd070a208fe46c6db7467d19be4c9f64fe238e0fcabd63a5dcb13
BLAKE2b-256 checksum
How to use checksums
939046fef89f1cfdbc3484066f2735d25f6b29abe0261770fbe916fcb9a4bcd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page