From e5547c4faa8ffccc82e945f89ecf256f972adce0 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 29 Jul 2025 08:28:51 +0000 Subject: [PATCH] Update documentation and README files - Update main README.md with comprehensive CLI commands table - Add non-interactive mode documentation - Reorganize environment variables into required vs optional - Update Python version requirement to 3.12+ - Create comprehensive CLI documentation for new modules: - docs/cli/proposals.md for governance proposal evaluation - docs/cli/memory.md for memory management operations - docs/cli/arbiscan.md for Arbitrum contract source retrieval - Update src/talos/cli/README.md with all CLI commands and examples - Expand CONTRIBUTING.md with detailed development guidelines - Update docs/cli/overview.md with missing commands - Update docs/getting-started/installation.md with ARBISCAN_API_KEY - Add comprehensive usage examples and error handling documentation Co-Authored-By: talosgma@gmail.com --- CONTRIBUTING.md | 143 ++++++++++++++++++++++- README.md | 37 +++++- docs/cli/arbiscan.md | 164 ++++++++++++++++++++++++++ docs/cli/memory.md | 159 +++++++++++++++++++++++++ docs/cli/overview.md | 8 +- docs/cli/proposals.md | 90 ++++++++++++++ docs/getting-started/installation.md | 5 +- src/talos/cli/README.md | 168 +++++++++++++++++++++++---- 8 files changed, 743 insertions(+), 31 deletions(-) create mode 100644 docs/cli/arbiscan.md create mode 100644 docs/cli/memory.md create mode 100644 docs/cli/proposals.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7408dccb..7595dd30 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,9 +1,142 @@ # Contributing -When contributing to this repository, please ensure that your code passes all checks before submitting a pull request. +Thank you for your interest in contributing to Talos! This document provides guidelines for contributing to the project. -## Checks +## Development Setup -- `mypy`: Run `mypy .` to check for type errors. -- `pytest`: Run `pytest` to run all tests. -- `ruff`: Run `ruff .` to check for linting errors. +1. **Clone the repository**: + ```bash + git clone https://github.com/talos-agent/talos.git + cd talos + ``` + +2. **Set up the development environment**: + ```bash + uv venv + source .venv/bin/activate + ./scripts/install_deps.sh + ``` + +3. **Set up environment variables**: + ```bash + export OPENAI_API_KEY="your-openai-api-key" + export PINATA_API_KEY="your-pinata-api-key" + export PINATA_SECRET_API_KEY="your-pinata-secret-api-key" + # Optional for full functionality + export GITHUB_API_TOKEN="your-github-token" + export TWITTER_BEARER_TOKEN="your-twitter-bearer-token" + export ARBISCAN_API_KEY="your-arbiscan-api-key" + ``` + +## Code Quality Checks + +Before submitting a pull request, ensure your code passes all checks: + +### Linting and Formatting +```bash +uv run ruff check . +uv run ruff format . +``` + +### Type Checking +```bash +uv run mypy src +``` + +### Testing +```bash +uv run pytest +``` + +### Run All Checks +```bash +./scripts/run_checks.sh +``` + +## Code Style Guidelines + +- Follow [PEP 8](https://www.python.org/dev/peps/pep-0008/) for Python code +- Use modern Python type hints (`list` and `dict` instead of `List` and `Dict`) +- Never use quotes around type hints +- Use type hints for all function signatures +- Write clear and concise docstrings for modules, classes, and functions +- Keep lines under 88 characters long +- Use `model_post_init` for Pydantic `BaseModel` post-initialization logic +- Organize imports: standard library, third-party, first-party +- Use `ConfigDict` for Pydantic model configuration + +## Documentation Standards + +- Update documentation when adding new features +- Include usage examples in CLI documentation +- Ensure README files are accurate and up-to-date +- Add docstrings to all public functions and classes +- Update environment variable documentation when adding new requirements + +## Testing Guidelines + +- Write tests for all new functionality +- Ensure existing tests continue to pass +- Include both unit tests and integration tests where appropriate +- Test error handling and edge cases +- Mock external API calls in tests + +## Pull Request Process + +1. **Create a feature branch**: + ```bash + git checkout -b feature/your-feature-name + ``` + +2. **Make your changes** following the guidelines above + +3. **Run all checks** to ensure code quality + +4. **Commit your changes** with clear, descriptive commit messages + +5. **Push your branch** and create a pull request + +6. **Ensure CI passes** and address any feedback + +## Commit Message Guidelines + +- Use clear, descriptive commit messages +- Start with a verb in the imperative mood +- Keep the first line under 50 characters +- Include additional details in the body if needed + +Examples: +``` +Add memory search functionality to CLI + +Implement semantic search for agent memories with user filtering +and configurable result limits. Includes both database and file +backend support. +``` + +## Issue Reporting + +When reporting issues: +- Use the issue templates when available +- Provide clear reproduction steps +- Include relevant environment information +- Add logs or error messages when applicable + +## Feature Requests + +For feature requests: +- Clearly describe the proposed functionality +- Explain the use case and benefits +- Consider implementation complexity +- Discuss potential alternatives + +## Getting Help + +- Check existing documentation first +- Search existing issues and discussions +- Join our community channels for questions +- Tag maintainers for urgent issues + +## License + +By contributing to Talos, you agree that your contributions will be licensed under the MIT License. diff --git a/README.md b/README.md index 714a1d8d..2a312e6a 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Talos provides a set of services for interacting with various platforms: ## Development -This project uses `uv` for dependency management. +This project uses `uv` for dependency management and requires Python 3.12+. 1. Create a virtual environment: @@ -95,6 +95,14 @@ uv run talos You can then interact with the agent in a continuous conversation. To exit, type `exit`. +### Non-Interactive Mode + +Run a single query and exit: + +```bash +uv run talos "your query here" +``` + ### Daemon Mode To run the agent in daemon mode for continuous operation with scheduled jobs: @@ -110,6 +118,25 @@ uv run talos daemon The daemon will run continuously, executing scheduled jobs and can be gracefully shutdown with SIGTERM or SIGINT. +### Available CLI Commands + +| Command | Description | +|---------|-------------| +| `twitter` | Twitter-related operations and sentiment analysis | +| `github` | GitHub repository management and PR reviews | +| `proposals` | Governance proposal evaluation | +| `memory` | Memory management and search operations | +| `arbiscan` | Arbitrum blockchain contract source code retrieval | +| `generate-keys` | Generate RSA key pairs for encryption | +| `get-public-key` | Retrieve the current public key | +| `encrypt` | Encrypt data using public key | +| `decrypt` | Decrypt data using private key | +| `daemon` | Run in continuous daemon mode | +| `cleanup-users` | Clean up temporary users and conversation data | +| `db-stats` | Show database statistics | + +For detailed command usage, see the [CLI Documentation](https://docs.talos.is/cli/overview/). + ### Docker Usage #### Building and Running with Docker @@ -170,11 +197,15 @@ The daemon will run continuously, executing scheduled jobs and can be gracefully #### Required Environment Variables - `OPENAI_API_KEY`: Required for AI functionality -- `GITHUB_API_TOKEN`: Required for GitHub operations -- `TWITTER_BEARER_TOKEN`: Required for Twitter functionality - `PINATA_API_KEY`: Required for IPFS operations - `PINATA_SECRET_API_KEY`: Required for IPFS operations +#### Optional Environment Variables + +- `GITHUB_API_TOKEN`: Required for GitHub operations +- `TWITTER_BEARER_TOKEN`: Required for Twitter functionality +- `ARBISCAN_API_KEY`: Optional for higher rate limits when accessing Arbitrum contract data + #### Graceful Shutdown The Docker container supports graceful shutdown. When you run `docker stop`, it sends a SIGTERM signal to the process, which triggers: diff --git a/docs/cli/arbiscan.md b/docs/cli/arbiscan.md new file mode 100644 index 00000000..d61fffa2 --- /dev/null +++ b/docs/cli/arbiscan.md @@ -0,0 +1,164 @@ +# Arbiscan CLI + +The Arbiscan CLI module provides commands for retrieving smart contract source code from Arbitrum blockchain networks. + +## Commands + +### `get-source-code` - Retrieve Contract Source Code + +Gets the source code of a verified smart contract from Arbiscan. + +```bash +uv run talos arbiscan get-source-code [options] +``` + +**Arguments:** +- `contract_address`: The contract address to get source code for (required) + +**Options:** +- `--api-key, -k`: Optional API key for higher rate limits +- `--chain-id, -c`: Chain ID (default: 42161 for Arbitrum One) +- `--format, -f`: Output format - 'formatted', 'json', or 'source-only' (default: 'formatted') + +## Supported Networks + +| Chain ID | Network | Description | +|----------|---------|-------------| +| 42161 | Arbitrum One | Main Arbitrum network | +| 42170 | Arbitrum Nova | Arbitrum Nova network | +| 421614 | Arbitrum Sepolia | Arbitrum testnet | + +## Usage Examples + +### Basic Usage + +```bash +# Get source code for a contract on Arbitrum One +uv run talos arbiscan get-source-code 0x1234567890abcdef1234567890abcdef12345678 + +# Get source code with API key for higher rate limits +uv run talos arbiscan get-source-code 0x1234567890abcdef1234567890abcdef12345678 --api-key your_api_key +``` + +### Different Networks + +```bash +# Get source code from Arbitrum Nova +uv run talos arbiscan get-source-code 0x1234567890abcdef1234567890abcdef12345678 --chain-id 42170 + +# Get source code from Arbitrum Sepolia testnet +uv run talos arbiscan get-source-code 0x1234567890abcdef1234567890abcdef12345678 --chain-id 421614 +``` + +### Output Formats + +```bash +# Formatted output (default) - human-readable with contract details +uv run talos arbiscan get-source-code 0x1234567890abcdef1234567890abcdef12345678 --format formatted + +# JSON output - structured data format +uv run talos arbiscan get-source-code 0x1234567890abcdef1234567890abcdef12345678 --format json + +# Source code only - just the contract source code +uv run talos arbiscan get-source-code 0x1234567890abcdef1234567890abcdef12345678 --format source-only +``` + +## Output Information + +### Formatted Output + +The formatted output includes: +- **Contract Name**: Name of the smart contract +- **Compiler Version**: Solidity compiler version used +- **Optimization Used**: Whether compiler optimization was enabled +- **Optimization Runs**: Number of optimization runs (if enabled) +- **License Type**: Contract license information +- **Proxy Implementation**: Implementation address (for proxy contracts) +- **Source Code**: Complete contract source code + +### JSON Output + +The JSON output provides structured data with all contract information in a machine-readable format. + +### Source-Only Output + +Returns only the contract source code without additional metadata. + +## API Key Setup + +### Environment Variable + +Set your Arbiscan API key as an environment variable: + +```bash +export ARBISCAN_API_KEY=your_api_key_here +``` + +### Command Line Option + +Alternatively, provide the API key directly: + +```bash +uv run talos arbiscan get-source-code 0x1234... --api-key your_api_key_here +``` + +### Getting an API Key + +1. Visit [https://arbiscan.io/apis](https://arbiscan.io/apis) +2. Create a free account +3. Generate an API key +4. Use the key for higher rate limits and better reliability + +## Rate Limits + +- **Without API Key**: Limited requests per minute +- **With API Key**: Higher rate limits and better reliability +- **Free Tier**: Sufficient for most use cases +- **Paid Tiers**: Available for high-volume usage + +## Error Handling + +The command includes comprehensive error handling for: + +### API Errors +- Missing or invalid API key +- Rate limit exceeded +- Invalid contract address +- Contract not verified +- Network connectivity issues + +### Input Validation +- Invalid contract address format +- Unsupported chain ID +- Invalid output format + +### Example Error Messages + +```bash +# Missing API key error +Error: Arbiscan API key is required to get contract source code. +Please provide an API key using the --api-key option. +You can get a free API key from https://arbiscan.io/apis + +# Invalid contract address +Error: Invalid contract address format + +# Contract not verified +Error: Contract source code not verified on Arbiscan +``` + +## Integration + +The Arbiscan CLI integrates with: +- Smart contract analysis workflows +- Security audit processes +- Development and debugging tools +- Automated contract verification systems + +## Use Cases + +- **Security Analysis**: Review contract source code for vulnerabilities +- **Development**: Study implementation patterns and best practices +- **Auditing**: Verify contract functionality and security +- **Research**: Analyze DeFi protocols and smart contract architectures +- **Integration**: Retrieve contract ABIs and interfaces for development diff --git a/docs/cli/memory.md b/docs/cli/memory.md new file mode 100644 index 00000000..56dd290c --- /dev/null +++ b/docs/cli/memory.md @@ -0,0 +1,159 @@ +# Memory CLI + +The memory CLI module provides commands for managing and searching the agent's persistent memory system. + +## Commands + +### `list` - List Memories + +List all memories with optional user filtering. + +```bash +uv run talos memory list [options] +``` + +**Options:** +- `--user-id, -u`: User ID to filter memories by +- `--filter-user`: Filter memories by a different user +- `--use-database`: Use database backend instead of files (default: true) +- `--verbose, -v`: Enable verbose output + +### `search` - Search Memories + +Search memories using semantic similarity with optional user filtering. + +```bash +uv run talos memory search [options] +``` + +**Arguments:** +- `query`: Search query for memories (required) + +**Options:** +- `--user-id, -u`: User ID to search memories for +- `--filter-user`: Filter memories by a different user +- `--limit, -l`: Maximum number of results to return (default: 5) +- `--use-database`: Use database backend instead of files (default: true) +- `--verbose, -v`: Enable verbose output + +### `flush` - Flush Memories + +Flush unsaved memories to disk or delete user memories from database. + +```bash +uv run talos memory flush [options] +``` + +**Options:** +- `--user-id, -u`: User ID for database backend (if not provided with database backend, flushes ALL memories after confirmation) +- `--use-database`: Use database backend instead of files (default: true) +- `--verbose, -v`: Enable verbose output + +## Usage Examples + +### Listing Memories + +```bash +# List all memories +uv run talos memory list + +# List memories for a specific user +uv run talos memory list --user-id user123 + +# List memories with verbose output +uv run talos memory list --verbose + +# Use file-based backend +uv run talos memory list --no-use-database +``` + +### Searching Memories + +```bash +# Basic semantic search +uv run talos memory search "governance proposal" + +# Search with custom limit +uv run talos memory search "twitter sentiment" --limit 10 + +# Search for specific user's memories +uv run talos memory search "market analysis" --user-id user123 + +# Search with verbose output +uv run talos memory search "protocol upgrade" --verbose +``` + +### Managing Memory Storage + +```bash +# Flush unsaved memories for a specific user +uv run talos memory flush --user-id user123 + +# Flush all memories (requires confirmation) +uv run talos memory flush + +# Flush with file-based backend +uv run talos memory flush --no-use-database +``` + +## Memory Backends + +### Database Backend (Default) + +The database backend provides: +- Multi-user support with user isolation +- Persistent storage across sessions +- Efficient semantic search using vector embeddings +- User management and cleanup capabilities + +### File Backend + +The file backend provides: +- Simple file-based storage +- Single-user operation +- Local memory and history files +- No user isolation + +## Memory Structure + +Each memory contains: +- **Description**: Text content of the memory +- **Timestamp**: When the memory was created +- **Metadata**: Additional context and tags +- **Embeddings**: Vector representations for semantic search + +## Environment Variables + +- `OPENAI_API_KEY`: Required for generating embeddings for semantic search + +## Database Operations + +### User Management + +When using the database backend: +- Temporary user IDs are generated if not provided +- User memories are isolated from each other +- Cleanup operations can remove old temporary users + +### Memory Persistence + +- Memories are automatically saved to the database +- Unsaved memories can be flushed manually +- Search operations use vector similarity matching + +## Error Handling + +The memory CLI includes comprehensive error handling for: +- Database connection issues +- Missing user IDs +- Invalid search queries +- File system permissions (file backend) +- API connectivity for embeddings + +## Integration + +The memory system integrates with: +- Main Talos agent for conversation history +- All CLI modules for persistent context +- Database cleanup operations +- User management system diff --git a/docs/cli/overview.md b/docs/cli/overview.md index 5308bfa7..d5f09b3b 100644 --- a/docs/cli/overview.md +++ b/docs/cli/overview.md @@ -85,13 +85,18 @@ talos [global-options] [command-options] [arguments] | Command | Description | |---------|-------------| -| `twitter` | Twitter-related operations and analysis | +| `twitter` | Twitter-related operations and sentiment analysis | | `github` | GitHub repository management and PR reviews | +| `proposals` | Governance proposal evaluation | +| `memory` | Memory management and search operations | +| `arbiscan` | Arbitrum blockchain contract source code retrieval | | `generate-keys` | Generate RSA key pairs for encryption | | `get-public-key` | Retrieve the current public key | | `encrypt` | Encrypt data using public key | | `decrypt` | Decrypt data using private key | | `daemon` | Run in continuous daemon mode | +| `cleanup-users` | Clean up temporary users and conversation data | +| `db-stats` | Show database statistics | ## Environment Variables @@ -109,6 +114,7 @@ export PINATA_SECRET_API_KEY="your-pinata-secret-api-key" export GITHUB_API_TOKEN="your-github-token" # For GitHub operations export TWITTER_BEARER_TOKEN="your-twitter-token" # For Twitter analysis export GITHUB_REPO="owner/repo" # Default repository +export ARBISCAN_API_KEY="your-arbiscan-key" # For higher rate limits on Arbitrum data ``` ## Configuration diff --git a/docs/cli/proposals.md b/docs/cli/proposals.md new file mode 100644 index 00000000..f330c1ed --- /dev/null +++ b/docs/cli/proposals.md @@ -0,0 +1,90 @@ +# Proposals CLI + +The proposals CLI module provides commands for evaluating governance proposals using AI analysis. + +## Commands + +### `eval` - Evaluate Proposal + +Evaluates a governance proposal from a file using AI analysis. + +```bash +uv run talos proposals eval --file +``` + +**Arguments:** +- `--file, -f`: Path to the proposal file (required) + +**Options:** +- `--model-name`: LLM model to use (default: "gpt-4o") +- `--temperature`: Temperature for LLM generation (default: 0.0) + +## Usage Examples + +### Basic Proposal Evaluation + +```bash +# Evaluate a proposal from a text file +uv run talos proposals eval --file governance_proposal.txt + +# Use a different model +uv run talos proposals eval --file proposal.md --model-name gpt-4o --temperature 0.1 +``` + +### Proposal File Format + +The proposal file should contain the full text of the governance proposal. Supported formats include: + +- Plain text (.txt) +- Markdown (.md) +- Any text-based format + +Example proposal file content: +``` +# Governance Proposal: Treasury Allocation + +## Summary +This proposal requests allocation of 100,000 tokens from the treasury for development funding. + +## Details +The funds will be used for: +1. Core development team salaries +2. Security audits +3. Infrastructure costs + +## Timeline +- Phase 1: 30 days +- Phase 2: 60 days +- Phase 3: 90 days + +## Budget Breakdown +- Development: 60,000 tokens +- Security: 25,000 tokens +- Infrastructure: 15,000 tokens +``` + +## Output + +The command provides a comprehensive analysis including: + +- **Summary**: Brief overview of the proposal +- **Risk Assessment**: Potential risks and concerns +- **Benefits Analysis**: Expected benefits and outcomes +- **Recommendation**: AI-generated recommendation (approve/reject/modify) +- **Reasoning**: Detailed explanation of the recommendation + +## Environment Variables + +- `OPENAI_API_KEY`: Required for AI analysis functionality + +## Error Handling + +The command includes error handling for: +- Missing or invalid file paths +- File reading permissions +- API connectivity issues +- Invalid proposal formats + +## Integration + +The proposals CLI integrates with the main Talos agent system and can be used as part of automated governance workflows or manual proposal review processes. diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 3c124a71..3c472be5 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -4,7 +4,7 @@ This guide will help you install and set up Talos on your system. ## Prerequisites -- Python 3.8 or higher +- Python 3.12 or higher - `uv` package manager (recommended) or `pip` - Git @@ -77,6 +77,7 @@ export PINATA_SECRET_API_KEY="your-pinata-secret-api-key" ```bash export GITHUB_API_TOKEN="your-github-token" export TWITTER_BEARER_TOKEN="your-twitter-bearer-token" +export ARBISCAN_API_KEY="your-arbiscan-api-key" ``` !!! tip "Environment File" @@ -87,6 +88,7 @@ export TWITTER_BEARER_TOKEN="your-twitter-bearer-token" PINATA_SECRET_API_KEY=your-pinata-secret-api-key GITHUB_API_TOKEN=your-github-token TWITTER_BEARER_TOKEN=your-twitter-bearer-token + ARBISCAN_API_KEY=your-arbiscan-api-key ``` ## Docker Installation @@ -106,6 +108,7 @@ export TWITTER_BEARER_TOKEN="your-twitter-bearer-token" -e TWITTER_BEARER_TOKEN="your-twitter-bearer-token" \ -e PINATA_API_KEY="your-pinata-api-key" \ -e PINATA_SECRET_API_KEY="your-pinata-secret-api-key" \ + -e ARBISCAN_API_KEY="your-arbiscan-api-key" \ --name talos-agent \ talos-agent ``` diff --git a/src/talos/cli/README.md b/src/talos/cli/README.md index cfc149fc..57b1faff 100644 --- a/src/talos/cli/README.md +++ b/src/talos/cli/README.md @@ -8,77 +8,203 @@ The CLI is installed as part of the `talos` package. ## Usage -The CLI can be run in two modes: interactive and non-interactive. +The CLI can be run in multiple modes: interactive, non-interactive, and daemon mode. + +### Interactive Mode + +To enter interactive mode, run `talos` without any arguments: + +```bash +uv run talos +>> your query +``` ### Non-Interactive Mode -In non-interactive mode, you can run a single query and the agent will exit. +In non-interactive mode, you can run a single query and the agent will exit: ```bash -talos "your query" +uv run talos "your query" ``` -### Interactive Mode +### Daemon Mode -To enter interactive mode, run `talos` without any arguments. +Run the agent continuously for scheduled operations: ```bash -talos ->> your query +uv run talos daemon ``` ## Commands -The Talos CLI has the following commands: +The Talos CLI has the following commands and subcommands: ### `twitter` -This command has subcommands for interacting with Twitter. +Twitter-related operations and analysis. #### `get-user-prompt ` -Gets the general voice of a user as a prompt. +Gets the general voice of a user as a structured persona analysis. ```bash -talos twitter get-user-prompt +uv run talos twitter get-user-prompt ``` -#### `get-query-sentiment ` +#### `get-query-sentiment [--start-time]` Gets the general sentiment/report on a specific query. ```bash -talos twitter get-query-sentiment +uv run talos twitter get-query-sentiment +uv run talos twitter get-query-sentiment --start-time "2023-01-01T00:00:00Z" +``` + +#### `integrate-voice [--username]` + +Integrate Twitter voice analysis into agent communication. + +```bash +uv run talos twitter integrate-voice +uv run talos twitter integrate-voice --username talos_is +``` + +### `github` + +GitHub repository management and PR reviews. See [GitHub CLI Commands](../CLI_GITHUB_COMMANDS.md) for detailed documentation. + +### `proposals` + +Governance proposal evaluation. + +#### `eval --file ` + +Evaluates a proposal from a file. + +```bash +uv run talos proposals eval --file proposal.txt +``` + +### `memory` + +Memory management and search operations. + +#### `list [--user-id] [--filter-user] [--use-database] [--verbose]` + +List all memories with optional user filtering. + +```bash +uv run talos memory list +uv run talos memory list --user-id user123 --verbose +``` + +#### `search [--user-id] [--limit] [--use-database]` + +Search memories using semantic similarity. + +```bash +uv run talos memory search "governance proposal" +uv run talos memory search "twitter sentiment" --limit 10 ``` -### `generate-keys` +#### `flush [--user-id] [--use-database]` + +Flush unsaved memories to disk or delete user memories. + +```bash +uv run talos memory flush --user-id user123 +``` + +### `arbiscan` + +Arbitrum blockchain contract source code retrieval. + +#### `get-source-code [--api-key] [--chain-id] [--format]` + +Gets the source code of a verified smart contract from Arbiscan. + +```bash +uv run talos arbiscan get-source-code 0x1234... +uv run talos arbiscan get-source-code 0x1234... --format json +uv run talos arbiscan get-source-code 0x1234... --chain-id 42170 +``` + +### Core Commands + +#### `generate-keys [--key-dir]` Generates a new RSA key pair. ```bash -talos generate-keys +uv run talos generate-keys +uv run talos generate-keys --key-dir /path/to/keys ``` -### `get-public-key` +#### `get-public-key [--key-dir]` Gets the public key. ```bash -talos get-public-key +uv run talos get-public-key ``` -### `encrypt ` +#### `encrypt ` Encrypts a message. ```bash -talos encrypt +uv run talos encrypt "secret message" public_key.pem ``` -### `decrypt ` +#### `decrypt [--key-dir]` Decrypts a message. ```bash -talos decrypt +uv run talos decrypt +``` + +#### `daemon [--prompts-dir] [--model-name] [--temperature]` + +Run the Talos agent in daemon mode for continuous operation. + +```bash +uv run talos daemon +uv run talos daemon --model-name gpt-4o --temperature 0.1 ``` + +#### `cleanup-users [--older-than] [--dry-run]` + +Clean up temporary users and their conversation data. + +```bash +uv run talos cleanup-users --older-than 24 --dry-run +uv run talos cleanup-users --older-than 48 +``` + +#### `db-stats` + +Show database statistics. + +```bash +uv run talos db-stats +``` + +## Global Options + +- `--verbose, -v`: Enable verbose output +- `--user-id, -u`: User identifier for conversation tracking +- `--use-database`: Use database for conversation storage instead of files +- `--help`: Show help information + +## Environment Variables + +### Required +- `OPENAI_API_KEY`: OpenAI API key for AI functionality +- `PINATA_API_KEY`: Pinata API key for IPFS operations +- `PINATA_SECRET_API_KEY`: Pinata secret API key for IPFS operations + +### Optional +- `GITHUB_API_TOKEN`: GitHub API token for repository operations +- `TWITTER_BEARER_TOKEN`: Twitter Bearer token for social media analysis +- `ARBISCAN_API_KEY`: Arbiscan API key for higher rate limits