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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llama_cli_llamasearch-0.1.0.tar.gz (27.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llama_cli_llamasearch-0.1.0-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

Details for the file llama_cli_llamasearch-0.1.0.tar.gz.

File metadata

  • Download URL: llama_cli_llamasearch-0.1.0.tar.gz
  • Upload date:
  • Size: 27.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for llama_cli_llamasearch-0.1.0.tar.gz
Algorithm Hash digest
SHA256 20971dffb9400b2db23d2cd1b06d852e04ebf90080d1e5ae9d5b219e656c833b
MD5 6df21ca5ca78be7f4274ca7015ba9879
BLAKE2b-256 3dbf0d591530b6272126602d727b39da201e71173fc95f04f5976ccabcb0e7e4

See more details on using hashes here.

File details

Details for the file llama_cli_llamasearch-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_cli_llamasearch-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5b489d69bd2bd070a208fe46c6db7467d19be4c9f64fe238e0fcabd63a5dcb13
MD5 dc9fc610c3c9ed9e3a9ece75a881d93e
BLAKE2b-256 939046fef89f1cfdbc3484066f2735d25f6b29abe0261770fbe916fcb9a4bcd0

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page