CLI Installation
Install and configure the LanOnasis CLI tool for command-line memory management and automation.
Installation
Using npm (Recommended)
npm install -g @lanonasis/cli
Using pip
pip install lanonasis-cli
Using Homebrew (macOS)
brew install lanonasis/tap/lanonasis-cli
Using curl (Linux/macOS)
curl -sSL https://install.lanonasis.com/cli | bash
Using PowerShell (Windows)
Invoke-WebRequest -Uri "https://install.lanonasis.com/cli.ps1" -UseBasicParsing | Invoke-Expression
Verify Installation
Check that the CLI is installed correctly:
lanonasis --version
You should see output like:
lanonasis-cli/1.0.0
Configuration
Initial Setup
Run the setup command to configure your API key:
lanonasis setup
This will prompt you for:
- API Key
- Base URL (optional, defaults to production)
- Default output format (json, yaml, table)
Environment Variables
You can also set configuration via environment variables:
export LANONASIS_API_KEY="your-api-key-here"
export LANONASIS_BASE_URL="https://api.lanonasis.com"
export LANONASIS_OUTPUT_FORMAT="json"
Configuration File
The CLI stores configuration in ~/.lanonasis/config.yaml:
api_key: "your-api-key-here"
base_url: "https://api.lanonasis.com"
output_format: "json"
timeout: 30
max_retries: 3
Quick Start
Test your installation with a simple command:
# List your memories
lanonasis memory list
# Create a new memory
lanonasis memory create "Hello from CLI!"
# Search memories
lanonasis memory search "hello"
Authentication
API Key
The CLI uses API key authentication. You can provide it via:
-
Setup command (recommended):
lanonasis setup -
Environment variable:
export LANONASIS_API_KEY="your-api-key" -
Command line flag:
lanonasis --api-key "your-api-key" memory list -
Configuration file:
# ~/.lanonasis/config.yaml
api_key: "your-api-key"
API Key Management
View your current configuration:
lanonasis config show
Update your API key:
lanonasis config set api-key "new-api-key"
Reset configuration:
lanonasis config reset
Output Formats
The CLI supports multiple output formats:
JSON (Default)
lanonasis memory list --format json
YAML
lanonasis memory list --format yaml
Table
lanonasis memory list --format table
Custom Format
lanonasis memory list --format "{{.ID}}\t{{.Content}}\t{{.CreatedAt}}"
Shell Completion
Enable shell completion for better user experience:
Bash
# Add to ~/.bashrc
eval "$(lanonasis completion bash)"
Zsh
# Add to ~/.zshrc
eval "$(lanonasis completion zsh)"
Fish
# Add to ~/.config/fish/config.fish
lanonasis completion fish | source
PowerShell
# Add to PowerShell profile
lanonasis completion powershell | Out-String | Invoke-Expression
Proxy Configuration
If you're behind a corporate proxy:
export HTTP_PROXY="http://proxy.company.com:8080"
export HTTPS_PROXY="http://proxy.company.com:8080"
export NO_PROXY="localhost,127.0.0.1"
Or configure in the config file:
# ~/.lanonasis/config.yaml
proxy:
http: "http://proxy.company.com:8080"
https: "http://proxy.company.com:8080"
no_proxy: "localhost,127.0.0.1"
Troubleshooting
Common Issues
Command not found
# Check if CLI is in PATH
which lanonasis
# If not found, add to PATH
export PATH="$PATH:/path/to/lanonasis/bin"
Authentication errors
# Check API key
lanonasis config show
# Test connection
lanonasis auth test
Permission errors
# Fix permissions
chmod +x /path/to/lanonasis
# Or reinstall with proper permissions
sudo npm install -g @lanonasis/cli
Debug Mode
Enable debug logging:
export LANONASIS_DEBUG=1
lanonasis memory list
Or use the debug flag:
lanonasis --debug memory list
Logs
View CLI logs:
# macOS/Linux
cat ~/.lanonasis/logs/cli.log
# Windows
type %USERPROFILE%\.lanonasis\logs\cli.log
Updating
Update to the latest version:
# Using npm
npm update -g @lanonasis/cli
# Using pip
pip install --upgrade lanonasis-cli
# Using Homebrew
brew upgrade lanonasis-cli
Uninstalling
Remove the CLI:
# Using npm
npm uninstall -g @lanonasis/cli
# Using pip
pip uninstall lanonasis-cli
# Using Homebrew
brew uninstall lanonasis-cli
# Remove configuration
rm -rf ~/.lanonasis
Next Steps
Now that you have the CLI installed:
- Commands Reference - Complete command documentation
- Automation Guide - Scripting and automation
- Examples - Real-world usage examples
Need Help?
- Documentation: Browse our comprehensive guides
- Community: Join our Discord community
- Support: Contact our support team
- GitHub: View source code and report issues