{"id":42113624,"url":"https://github.com/sl-mar/quantcoder-cli","last_synced_at":"2026-01-26T14:01:07.814Z","repository":{"id":259668727,"uuid":"865952589","full_name":"SL-Mar/quantcoder-cli","owner":"SL-Mar","description":"AI-powered CLI tool: Transform trading research papers into QuantConnect algorithms using GPT-4","archived":false,"fork":false,"pushed_at":"2026-01-25T06:59:24.000Z","size":4761,"stargazers_count":85,"open_issues_count":1,"forks_count":22,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-25T08:34:04.790Z","etag":null,"topics":["llm","openai","pair-programming","quantconnect","trading","trading-algorithms","trading-strategies"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SL-Mar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-10-01T11:56:38.000Z","updated_at":"2025-12-16T14:52:26.000Z","dependencies_parsed_at":"2024-10-27T08:19:28.372Z","dependency_job_id":"208cd323-f03c-4034-a1da-ae137dac76a9","html_url":"https://github.com/SL-Mar/quantcoder-cli","commit_stats":null,"previous_names":["sl-mar/pair-programming_from_articles","sl-mar/quant_coder","sl-mar/quantcoder","sl-mar/quantcoder-fs","sl-mar/quantcoder-legacy","sl-mar/quantcoder-cli"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/SL-Mar/quantcoder-cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SL-Mar%2Fquantcoder-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SL-Mar%2Fquantcoder-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SL-Mar%2Fquantcoder-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SL-Mar%2Fquantcoder-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SL-Mar","download_url":"https://codeload.github.com/SL-Mar/quantcoder-cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SL-Mar%2Fquantcoder-cli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28780011,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["llm","openai","pair-programming","quantconnect","trading","trading-algorithms","trading-strategies"],"created_at":"2026-01-26T14:01:06.812Z","updated_at":"2026-01-26T14:01:07.804Z","avatar_url":"https://github.com/SL-Mar.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QuantCoder 2.0.0\n\n[![Version](https://img.shields.io/badge/version-2.0.0-green)](https://github.com/SL-Mar/quantcoder-cli)\n[![Python](https://img.shields.io/badge/python-3.10+-blue)](https://python.org)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue)](LICENSE)\n\n\u003e **AI-powered CLI for generating QuantConnect trading algorithms from research articles**\n\n\u003e **Note**\n\u003e This version (v2.0.0) has not been systematically tested yet.\n\u003e It represents a complete architectural rewrite from the legacy v1.x codebase.\n\u003e Use with caution and report any issues.\n\nFeatures: Multi-agent system, AlphaEvolve-inspired evolution, autonomous learning, MCP integration.\n\n---\n\nQuantCoder is a command-line tool that allows users to generate QuantConnect trading algorithms from research articles using natural language processing and large language models (LLMs). It was initiated in November 2023 and based on a cognitive architecture inspired by the article [\"Dual Agent Chatbots and Expert Systems Design\"](https://towardsdev.com/dual-agent-chatbots-and-expert-systems-design-25e2cba434e9)\n\nThe initial version successfully coded a blended momentum and mean-reversion strategy as described in [\"Outperforming the Market (1000% in 10 years)\"](https://medium.com/coinmonks/how-to-outperform-the-market-fe151b944c77?sk=7066045abe12d5cf88c7edc80ec2679c), which received over 10,000 impressions on LinkedIn.\n\n## 🌟 Version 2.0 - Complete Refactoring\n\n**Refactored in December 2025** - Inspired by [Mistral's Vibe CLI](https://github.com/mistralai/mistral-vibe) architecture.\n\n### New Features:\n- 🤖 **Interactive Chat Interface** with conversational AI\n- 🛠️ **Tool-Based Architecture** for modularity and extensibility\n- ⚙️ **Configuration System** with TOML support\n- 🎨 **Modern Terminal UI** with Rich library\n- 📝 **Programmable Mode** via `--prompt` flag\n- 💾 **Persistent Context** and conversation history\n\n📖 **[Architecture](docs/AGENTIC_WORKFLOW.md)** | **[Autonomous Mode](docs/AUTONOMOUS_MODE.md)** | **[Changelog](CHANGELOG.md)**\n\n---\n\n## 🚀 Installation (v2.0)\n\n\u003e ✅ Requires **Python 3.10 or later**\n\n### Quick Start\n\n```bash\n# Clone the repository\ngit clone https://github.com/SL-Mar/quantcoder-cli.git\ncd quantcoder-cli\n\n# Create and activate virtual environment\npython -m venv .venv\nsource .venv/bin/activate  # On Windows: .venv\\Scripts\\activate\n\n# Install the package\npip install -e .\n\n# Download SpaCy model\npython -m spacy download en_core_web_sm\n```\n\n### First Run\n\n```bash\n# Launch interactive mode\nquantcoder\n\n# Or use the short alias\nqc\n```\n\nOn first run, you'll be prompted for your OpenAI API key.\n\n---\n\n## 💡 Usage (v2.0)\n\nQuantCoder offers multiple modes of operation to suit different workflows.\n\n### Interactive Mode\n\nLaunch the interactive chat interface for a conversational experience:\n\n```bash\n# Start interactive mode\nquantcoder\n\n# Or use the short alias\nqc\n```\n\nIn interactive mode, you can use natural language or direct commands:\n\n```bash\nquantcoder\u003e search \"momentum trading strategies\"\nquantcoder\u003e download 1\nquantcoder\u003e summarize 1\nquantcoder\u003e generate 1\n```\n\n### Programmatic Mode\n\nRun commands non-interactively using the `--prompt` flag:\n\n```bash\nquantcoder --prompt \"Find articles about mean reversion\"\n```\n\n---\n\n## 📖 CLI Commands Reference\n\n### Core Commands\n\n#### `search` - Search for Academic Articles\n\nSearch for research articles on CrossRef using keywords.\n\n```bash\nquantcoder search \"algorithmic trading\" --num 5\n```\n\n**Arguments:**\n- `query` - Search query string (required)\n\n**Options:**\n- `--num` - Number of results to return (default: 5)\n\n**Example:**\n```bash\nquantcoder search \"momentum trading strategies\" --num 10\n```\n\n---\n\n#### `download` - Download Article PDF\n\nDownload a research article PDF by its ID from the search results.\n\n```bash\nquantcoder download 1\n```\n\n**Arguments:**\n- `article_id` - ID of the article from search results (required)\n\n**Example:**\n```bash\nquantcoder download 3\n```\n\n---\n\n#### `summarize` - Summarize Article\n\nAnalyze and summarize a downloaded article using AI.\n\n```bash\nquantcoder summarize 1\n```\n\n**Arguments:**\n- `article_id` - ID of the downloaded article (required)\n\n**Example:**\n```bash\nquantcoder summarize 1\n```\n\n---\n\n#### `generate` - Generate QuantConnect Code\n\nGenerate trading algorithm code from a research article.\n\n```bash\nquantcoder generate 1\nquantcoder generate 1 --open-in-editor\nquantcoder generate 1 --open-in-editor --editor code\n```\n\n**Arguments:**\n- `article_id` - ID of the article to generate code from (required)\n\n**Options:**\n- `--max-attempts` - Maximum refinement attempts (default: 6)\n- `--open-in-editor` - Open generated code in editor (default: false)\n- `--editor` - Editor to use (e.g., zed, code, vim)\n\n**Example:**\n```bash\nquantcoder generate 2 --open-in-editor --editor zed\n```\n\n---\n\n#### `validate` - Validate Algorithm Code\n\nValidate algorithm code locally and optionally on QuantConnect.\n\n```bash\nquantcoder validate generated_code/algorithm_1.py\nquantcoder validate my_algo.py --local-only\n```\n\n**Arguments:**\n- `file_path` - Path to the algorithm file (required)\n\n**Options:**\n- `--local-only` - Only run local syntax check, skip QuantConnect validation\n\n**Example:**\n```bash\nquantcoder validate generated_code/algorithm_1.py\n```\n\n---\n\n#### `backtest` - Run Backtest on QuantConnect\n\nExecute a backtest on QuantConnect with the specified algorithm.\n\n**Requirements:** Set `QUANTCONNECT_API_KEY` and `QUANTCONNECT_USER_ID` in `~/.quantcoder/.env`\n\n```bash\nquantcoder backtest generated_code/algorithm_1.py\nquantcoder backtest my_algo.py --start 2022-01-01 --end 2024-01-01\n```\n\n**Arguments:**\n- `file_path` - Path to the algorithm file (required)\n\n**Options:**\n- `--start` - Backtest start date in YYYY-MM-DD format (default: 2020-01-01)\n- `--end` - Backtest end date in YYYY-MM-DD format (default: 2024-01-01)\n- `--name` - Name for the backtest\n\n**Example:**\n```bash\nquantcoder backtest my_algo.py --start 2023-01-01 --end 2024-01-01 --name \"My Strategy v1\"\n```\n\n---\n\n### Autonomous Mode Commands\n\nAutonomous mode runs continuously, learning from errors and self-improving strategies over time.\n\n#### `auto start` - Start Autonomous Strategy Generation\n\n```bash\nquantcoder auto start --query \"momentum trading\" --max-iterations 50\n```\n\n**Options:**\n- `--query` - Strategy query (e.g., \"momentum trading\") (required)\n- `--max-iterations` - Maximum iterations to run (default: 50)\n- `--min-sharpe` - Minimum Sharpe ratio threshold (default: 0.5)\n- `--output` - Output directory for strategies\n- `--demo` - Run in demo mode (no real API calls)\n\n**Example:**\n```bash\nquantcoder auto start --query \"mean reversion\" --max-iterations 100 --min-sharpe 1.0\n```\n\n---\n\n#### `auto status` - Show Autonomous Mode Status\n\nDisplay statistics and learning progress from autonomous mode.\n\n```bash\nquantcoder auto status\n```\n\nShows:\n- Total strategies generated\n- Success rate\n- Average Sharpe ratio\n- Common errors and fix rates\n\n---\n\n#### `auto report` - Generate Learning Report\n\nGenerate a comprehensive report from autonomous mode runs.\n\n```bash\nquantcoder auto report --format text\nquantcoder auto report --format json\n```\n\n**Options:**\n- `--format` - Report format: text or json (default: text)\n\n---\n\n### Library Builder Commands\n\nLibrary builder mode systematically generates strategies across all major categories.\n\n#### `library build` - Build Strategy Library\n\nBuild a comprehensive library of trading strategies.\n\n```bash\nquantcoder library build --comprehensive --max-hours 24\nquantcoder library build --categories momentum,mean_reversion\n```\n\n**Options:**\n- `--comprehensive` - Build all categories\n- `--max-hours` - Maximum build time in hours (default: 24)\n- `--output` - Output directory for library\n- `--min-sharpe` - Minimum Sharpe ratio threshold (default: 0.5)\n- `--categories` - Comma-separated list of categories to build\n- `--demo` - Run in demo mode (no real API calls)\n\n**Example:**\n```bash\nquantcoder library build --categories momentum,arbitrage --max-hours 12\n```\n\n---\n\n#### `library status` - Show Library Build Progress\n\nDisplay the current progress of library building.\n\n```bash\nquantcoder library status\n```\n\n---\n\n#### `library resume` - Resume Library Build\n\nResume an interrupted library build from checkpoint.\n\n```bash\nquantcoder library resume\n```\n\n---\n\n#### `library export` - Export Completed Library\n\nExport the completed strategy library.\n\n```bash\nquantcoder library export --format zip --output library.zip\nquantcoder library export --format json --output library.json\n```\n\n**Options:**\n- `--format` - Export format: zip or json (default: zip)\n- `--output` - Output file path\n\n---\n\n### Evolution Mode Commands (AlphaEvolve-Inspired)\n\nEvolution mode uses LLM-generated variations to optimize trading algorithms through structural changes.\n\n#### `evolve start` - Start Strategy Evolution\n\nEvolve a trading algorithm through multiple generations of variations.\n\n```bash\nquantcoder evolve start 1\nquantcoder evolve start 1 --gens 5\nquantcoder evolve start --code algo.py\nquantcoder evolve start --resume abc123\n```\n\n**Arguments:**\n- `article_id` - Article number to evolve (optional if using --code or --resume)\n\n**Options:**\n- `--code` - Path to algorithm file to evolve\n- `--resume` - Resume a previous evolution by ID\n- `--gens` - Maximum generations to run (default: 10)\n- `--variants` - Variants per generation (default: 5)\n- `--elite` - Elite pool size (default: 3)\n- `--patience` - Stop after N generations without improvement (default: 3)\n- `--qc-user` - QuantConnect user ID (or set QC_USER_ID env var)\n- `--qc-token` - QuantConnect API token (or set QC_API_TOKEN env var)\n- `--qc-project` - QuantConnect project ID (or set QC_PROJECT_ID env var)\n\n**Example:**\n```bash\nquantcoder evolve start 1 --gens 20 --variants 10 --qc-user 123456 --qc-token abc123 --qc-project 789\n```\n\n**Note:** Evolution explores structural variations like:\n- Indicator changes (SMA → EMA, adding RSI, etc.)\n- Risk management modifications\n- Entry/exit logic changes\n- Universe selection tweaks\n\n---\n\n#### `evolve list` - List Saved Evolutions\n\nShow all saved evolution runs with their status and performance.\n\n```bash\nquantcoder evolve list\n```\n\n---\n\n#### `evolve show` - Show Evolution Details\n\nDisplay detailed information about a specific evolution.\n\n```bash\nquantcoder evolve show abc123\n```\n\n**Arguments:**\n- `evolution_id` - The evolution ID to show (required)\n\n---\n\n#### `evolve export` - Export Best Algorithm\n\nExport the best algorithm from an evolution run.\n\n```bash\nquantcoder evolve export abc123\nquantcoder evolve export abc123 --output my_best_algo.py\n```\n\n**Arguments:**\n- `evolution_id` - The evolution ID to export from (required)\n\n**Options:**\n- `--output` - Output file path\n\n---\n\n### Utility Commands\n\n#### `config-show` - Show Current Configuration\n\nDisplay the current QuantCoder configuration.\n\n```bash\nquantcoder config-show\n```\n\nShows:\n- Model configuration (provider, model, temperature, max tokens)\n- UI configuration (theme, auto-approve, token usage display)\n- Tools configuration (directories, enabled tools)\n- Paths (home directory, config file)\n\n---\n\n#### `version` - Show Version Information\n\nDisplay the current version of QuantCoder.\n\n```bash\nquantcoder version\n```\n\n---\n\n### Global Options\n\nThese options can be used with any command:\n\n- `--verbose` or `-v` - Enable verbose logging\n- `--config` - Path to custom config file\n- `--prompt` or `-p` - Run in non-interactive mode with a prompt\n\n**Example:**\n```bash\nquantcoder --verbose search \"algorithmic trading\"\nquantcoder --config my_config.toml generate 1\n```\n\n---\n\n## 📁 Articles and Strategies\n\nThe folder 'Strategies and publications' contains articles and trading strategies generated using this CLI tool. These strategies may have been manually refined or enhanced using LLM-based methods. Use them at your own discretion — conduct thorough research and validate before live use.\n\n---\n\n## 📜 License\n\nThis project is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for details.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsl-mar%2Fquantcoder-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsl-mar%2Fquantcoder-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsl-mar%2Fquantcoder-cli/lists"}