mfcli 0.2.5__tar.gz → 0.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mfcli-0.2.5 → mfcli-0.2.6}/PKG-INFO +83 -19
- {mfcli-0.2.5 → mfcli-0.2.6}/README.md +82 -18
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/.env.example +11 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/agents/controller/agent.py +2 -2
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/agents/controller/config.yaml +1 -1
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/cli/main.py +18 -3
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/crud/project.py +64 -19
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/pipeline.py +190 -21
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/cline_rules.py +2 -2
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/configurator.py +74 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/data_cleaner.py +0 -1
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/directory_manager.py +4 -7
- {mfcli-0.2.5 → mfcli-0.2.6}/pyproject.toml +1 -1
- {mfcli-0.2.5 → mfcli-0.2.6}/BUILD.md +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/CONFIGURATION.md +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/INSTALL.md +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/LICENSE +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/MANIFEST.in +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/MCP_SETUP.md +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/install.ps1 +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/install.sh +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/agents/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/agents/controller/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/agents/controller/tools.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/agents/tools/general.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/alembic/env.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/alembic/script.py.mako +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/alembic/versions/6ccc0c7c397c_added_fields_to_pdf_parts_model.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/alembic/versions/769019ef4870_added_gemini_file_path_to_pdf_part_model.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/alembic/versions/7a2e3a779fdc_added_functional_block_and_component_.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/alembic/versions/7d5adb2a47a7_added_pdf_parts_model.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/alembic/versions/7fcb7d6a5836_init.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/alembic/versions/e0f2b5765c72_added_cascade_delete_for_models_that_.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/alembic/versions/f1234567890a_make_bom_description_nullable.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/alembic.ini +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/cli/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/cli/dependencies.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/client/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/client/chroma_db.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/client/docling.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/client/gemini.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/client/llama_parse.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/client/vector_db.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/constants/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/constants/base_enum.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/constants/directory_names.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/constants/file_types.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/constants/gemini.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/constants/openai.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/constants/pipeline_run_status.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/crud/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/crud/file.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/crud/functional_blocks.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/crud/netlist.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/crud/pipeline_run.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/digikey/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/digikey/digikey.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/main.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/mcp/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/mcp/configs/cline_mcp_settings.json +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/mcp/configs/mfcli.mcp.json +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/mcp/mcp_instance.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/mcp/server.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/mcp/state_manager.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/mcp/tools/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/mcp/tools/query_knowledgebase.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/base.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/bom.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/datasheet.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/debug_setup.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/file.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/file_docket.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/file_metadata.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/functional_blocks.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/llm_response.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/mcu.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/mcu_errata.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/netlist.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/pdf_parts.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/pipeline_run.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/project.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/project_metadata.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/models/schematic_cheatsheet.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/bom_netlist_mapper.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/bom/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/bom/bom.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/debug_setup/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/debug_setup/debug_setup.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/debug_setup/instructions.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/functional_blocks/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/functional_blocks/functional_blocks.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/functional_blocks/instructions.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/functional_blocks/validator.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/generator.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/generator_base.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/mcu/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/mcu/instructions.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/mcu/mcu.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/mcu_errata/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/mcu_errata/instructions.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/mcu_errata/mcu_errata.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/schematic/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/schematic/instructions.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/schematic/schematic.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/summary/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/analysis/generators/summary/summary.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/classifier.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/data_enricher.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/extractor.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/extractors/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/extractors/pdf.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/parser.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/parsers/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/parsers/netlist/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/parsers/netlist/edif.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/parsers/netlist/kicad_legacy_net.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/parsers/netlist/kicad_spice.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/parsers/netlist/pads.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/parsers/netlist/protel.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/parsers/netlist/protel_detector.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/parsers/schematic/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/parsers/schematic/kicad_sch_detector.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/preprocessors/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/preprocessors/user_guide.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/run_context.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/schema_mapper.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/pipeline/sub_classifier.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/__init__.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/config.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/datasheet_vectorizer.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/file_upload.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/files.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/http_requests.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/kb_lister.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/kb_remover.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/logger.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/mcp_configurator.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/migrations.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/orm.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/pdf_splitter.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/pre_uninstall.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/query_service.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/ssl_installer.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/system_check.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/tools.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli/utils/vectorizer.py +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/mfcli.egg-info/SOURCES.txt +0 -0
- {mfcli-0.2.5 → mfcli-0.2.6}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mfcli
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
4
|
Summary: AI-powered CLI for analyzing hardware engineering documents
|
|
5
5
|
Author: Multifactor AI
|
|
6
6
|
License: MIT
|
|
@@ -75,6 +75,7 @@ An AI-powered engineering document processing pipeline that intelligently analyz
|
|
|
75
75
|
|
|
76
76
|
## 📋 Table of Contents
|
|
77
77
|
|
|
78
|
+
- [Quick Start](#quick-start)
|
|
78
79
|
- [Architecture](#architecture)
|
|
79
80
|
- [Prerequisites](#prerequisites)
|
|
80
81
|
- [Installation](#installation)
|
|
@@ -89,6 +90,23 @@ An AI-powered engineering document processing pipeline that intelligently analyz
|
|
|
89
90
|
- [Development](#development)
|
|
90
91
|
- [Troubleshooting](#troubleshooting)
|
|
91
92
|
|
|
93
|
+
## 🚀 Quick Start
|
|
94
|
+
|
|
95
|
+
**New to mfcli?** Check out our **[Quick Start Guide](QUICKSTART.md)** for step-by-step instructions to get up and running in minutes!
|
|
96
|
+
|
|
97
|
+
The Quick Start Guide covers:
|
|
98
|
+
- ✅ Installing Cline for VS Code
|
|
99
|
+
- ✅ Installing mfcli with pipx (recommended)
|
|
100
|
+
- ✅ Setting up API keys
|
|
101
|
+
- ✅ Creating your first project
|
|
102
|
+
- ✅ Processing your hardware documents
|
|
103
|
+
- ✅ Querying your knowledge base with AI
|
|
104
|
+
- ✅ Currently unsupported features and workarounds
|
|
105
|
+
|
|
106
|
+
**[👉 Go to Quick Start Guide →](QUICKSTART.md)**
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
92
110
|
## 🏗️ Architecture
|
|
93
111
|
|
|
94
112
|
The system uses a streamlined architecture with a single controller agent that orchestrates a sequential processing pipeline:
|
|
@@ -96,7 +114,7 @@ The system uses a streamlined architecture with a single controller agent that o
|
|
|
96
114
|
```
|
|
97
115
|
Controller Agent
|
|
98
116
|
├── Tools:
|
|
99
|
-
│ ├──
|
|
117
|
+
│ ├── run (Sequential pipeline execution)
|
|
100
118
|
│ └── query_knowledgebase (RAG-based document queries)
|
|
101
119
|
│
|
|
102
120
|
└── Pipeline Stages:
|
|
@@ -360,18 +378,18 @@ mfcli init
|
|
|
360
378
|
```
|
|
361
379
|
|
|
362
380
|
You'll be prompted to enter a project name (3-45 characters, alphanumeric with underscores/hyphens allowed). If your directory is a git repository, the repository name will be suggested as the default - simply press Enter to accept it or type a different name. This creates a `multifactor/` folder at the git root (or current directory) containing:
|
|
363
|
-
- `
|
|
381
|
+
- `design/` - **Place your hardware design files here for processing**
|
|
364
382
|
- `config.json` - Project configuration with your project name
|
|
365
383
|
- `file_docket.json` - File tracking and metadata
|
|
366
384
|
- `generated_files/`, `hw_cheat_sheets/`, `data_sheets/`, etc. - Output folders
|
|
367
385
|
|
|
368
|
-
**3. Place your files in the
|
|
386
|
+
**3. Place your files in the design folder:**
|
|
369
387
|
|
|
370
388
|
```bash
|
|
371
|
-
# Copy or move your hardware design files to the
|
|
389
|
+
# Copy or move your hardware design files to the design folder
|
|
372
390
|
# Example for git repo at C:\git\my-project\:
|
|
373
|
-
copy *.pdf C:\git\my-project\multifactor\
|
|
374
|
-
copy *.csv C:\git\my-project\multifactor\
|
|
391
|
+
copy *.pdf C:\git\my-project\multifactor\design\
|
|
392
|
+
copy *.csv C:\git\my-project\multifactor\design\
|
|
375
393
|
```
|
|
376
394
|
|
|
377
395
|
**4. Run the pipeline:**
|
|
@@ -381,7 +399,7 @@ mfcli run
|
|
|
381
399
|
```
|
|
382
400
|
|
|
383
401
|
This will:
|
|
384
|
-
- Process all supported files in the `multifactor/
|
|
402
|
+
- Process all supported files in the `multifactor/design/` directory
|
|
385
403
|
- Skip files that have already been processed (matching MD5 checksum)
|
|
386
404
|
- Prompt for confirmation if a file has been modified (different MD5)
|
|
387
405
|
- Generate BOM CSV files (if schematics are found)
|
|
@@ -416,9 +434,56 @@ This ensures efficient processing by only analyzing new or changed files, while
|
|
|
416
434
|
The `mfcli` tool provides the following commands:
|
|
417
435
|
|
|
418
436
|
- **`mfcli init`** - Initialize a new project in the current directory
|
|
419
|
-
- **`mfcli
|
|
437
|
+
- **`mfcli run`** - Run the analysis pipeline on the current directory
|
|
420
438
|
- **`mfcli web [--port PORT]`** - Start the web UI (default port: 9999)
|
|
421
|
-
- **`mfcli
|
|
439
|
+
- **`mfcli add FILE [--purpose PURPOSE]`** - Add a file to ChromaDB knowledge base
|
|
440
|
+
- **`mfcli ls`** - List all files that have been vectorized into the knowledge base
|
|
441
|
+
- **`mfcli rm FILENAME [--yes]`** - Remove files from the knowledge base by filename
|
|
442
|
+
- **`mfcli configure [--check]`** - Interactive setup wizard to configure API keys and settings
|
|
443
|
+
- **`mfcli log-level LEVEL`** - Set the logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
|
|
444
|
+
- **`mfcli setup-mcp`** - Auto-configure MCP server for Cline and Claude Code
|
|
445
|
+
- **`mfcli doctor`** - Run system health checks and diagnose issues
|
|
446
|
+
- **`mfcli clean [--accept] [--all]`** - Clean all mfcli app data
|
|
447
|
+
- **`mfcli pre-uninstall`** - Check for running processes before uninstallation
|
|
448
|
+
|
|
449
|
+
#### Configure Logging Level
|
|
450
|
+
|
|
451
|
+
Set the logging verbosity level for mfcli operations:
|
|
452
|
+
|
|
453
|
+
```bash
|
|
454
|
+
# Set to DEBUG for detailed troubleshooting
|
|
455
|
+
mfcli log-level DEBUG
|
|
456
|
+
|
|
457
|
+
# Set to INFO for normal operation (default)
|
|
458
|
+
mfcli log-level INFO
|
|
459
|
+
|
|
460
|
+
# Set to WARNING to only see warnings and errors
|
|
461
|
+
mfcli log-level WARNING
|
|
462
|
+
|
|
463
|
+
# Set to ERROR to only see errors
|
|
464
|
+
mfcli log-level ERROR
|
|
465
|
+
|
|
466
|
+
# Set to CRITICAL for only critical errors
|
|
467
|
+
mfcli log-level CRITICAL
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
The log level setting is stored in your configuration file (`~/Multifactor/.env`) and will take effect on the next mfcli command. This is particularly useful when:
|
|
471
|
+
- **DEBUG**: Troubleshooting issues or understanding detailed pipeline operations
|
|
472
|
+
- **INFO**: Normal day-to-day operation with informative messages
|
|
473
|
+
- **WARNING**: Production use where you only want to see potential issues
|
|
474
|
+
- **ERROR**: When you only care about actual errors
|
|
475
|
+
|
|
476
|
+
**Example:**
|
|
477
|
+
```bash
|
|
478
|
+
# Enable detailed logging for troubleshooting
|
|
479
|
+
mfcli log-level DEBUG
|
|
480
|
+
|
|
481
|
+
# Run the pipeline with verbose output
|
|
482
|
+
mfcli run
|
|
483
|
+
|
|
484
|
+
# Return to normal logging
|
|
485
|
+
mfcli log-level INFO
|
|
486
|
+
```
|
|
422
487
|
|
|
423
488
|
#### Start Web UI
|
|
424
489
|
|
|
@@ -519,7 +584,7 @@ To use the MCP server with Cline (or other MCP-compatible clients), add the foll
|
|
|
519
584
|
```bash
|
|
520
585
|
cd /path/to/hardware/files
|
|
521
586
|
mfcli init
|
|
522
|
-
mfcli
|
|
587
|
+
mfcli run
|
|
523
588
|
```
|
|
524
589
|
|
|
525
590
|
3. **Add the MCP configuration** to your Cline/Claude settings file (see Configuration above)
|
|
@@ -543,7 +608,7 @@ To use the MCP server with Cline (or other MCP-compatible clients), add the foll
|
|
|
543
608
|
- **Solution**: Run the pipeline at least once to create the vector database:
|
|
544
609
|
```bash
|
|
545
610
|
mfcli init
|
|
546
|
-
mfcli
|
|
611
|
+
mfcli run
|
|
547
612
|
```
|
|
548
613
|
|
|
549
614
|
**Error**: `MCP server timeout`
|
|
@@ -666,12 +731,11 @@ Created within a **"multifactor"** folder at the **git repository root** if you'
|
|
|
666
731
|
└── multifactor/ # Parent folder for all project files and outputs
|
|
667
732
|
├── config.json # Project configuration (project name, etc.)
|
|
668
733
|
├── file_docket.json # File tracking and processing metadata
|
|
669
|
-
├──
|
|
734
|
+
├── design/ # Place your hardware design files here for processing
|
|
670
735
|
├── generated_files/ # BOM CSV files generated from schematics
|
|
671
736
|
├── hw_cheat_sheets/ # JSON cheat sheets (MCU, errata, debug, functional blocks)
|
|
672
737
|
├── data_sheets/ # Downloaded component datasheets (from BOM processing)
|
|
673
738
|
├── pdf_parts/ # Extracted PDF parts for analysis
|
|
674
|
-
├── agent_instructions/ # (Reserved for future use)
|
|
675
739
|
├── fw_tasks/ # (Reserved for future use)
|
|
676
740
|
└── requirements/ # (Reserved for future use)
|
|
677
741
|
```
|
|
@@ -682,7 +746,7 @@ If you're in a git repository at `C:\git\my-hardware-project\` and run `mfcli in
|
|
|
682
746
|
|
|
683
747
|
- `C:\git\my-hardware-project\multifactor\config.json` - Project configuration
|
|
684
748
|
- `C:\git\my-hardware-project\multifactor\file_docket.json` - File tracking
|
|
685
|
-
- `C:\git\my-hardware-project\multifactor\
|
|
749
|
+
- `C:\git\my-hardware-project\multifactor\design\` - Place source files here
|
|
686
750
|
- `C:\git\my-hardware-project\multifactor\generated_files\` - Generated BOM files
|
|
687
751
|
- `C:\git\my-hardware-project\multifactor\hw_cheat_sheets\` - Cheat sheets
|
|
688
752
|
- `C:\git\my-hardware-project\multifactor\data_sheets\` - Downloaded datasheets
|
|
@@ -694,7 +758,7 @@ If you're NOT in a git repository and run `mfcli init` from `C:\Projects\hardwar
|
|
|
694
758
|
|
|
695
759
|
- `C:\Projects\hardware\board_v1\multifactor\config.json` - Project configuration
|
|
696
760
|
- `C:\Projects\hardware\board_v1\multifactor\file_docket.json` - File tracking
|
|
697
|
-
- `C:\Projects\hardware\board_v1\multifactor\
|
|
761
|
+
- `C:\Projects\hardware\board_v1\multifactor\design\` - Place source files here
|
|
698
762
|
- `C:\Projects\hardware\board_v1\multifactor\generated_files\` - Generated BOM files
|
|
699
763
|
- `C:\Projects\hardware\board_v1\multifactor\hw_cheat_sheets\` - Cheat sheets
|
|
700
764
|
- `C:\Projects\hardware\board_v1\multifactor\data_sheets\` - Downloaded datasheets
|
|
@@ -805,7 +869,7 @@ First, navigate to your hardware files directory and initialize:
|
|
|
805
869
|
```bash
|
|
806
870
|
cd /path/to/hardware/files
|
|
807
871
|
mfcli init
|
|
808
|
-
mfcli
|
|
872
|
+
mfcli run
|
|
809
873
|
```
|
|
810
874
|
|
|
811
875
|
### Starting the Web UI
|
|
@@ -902,10 +966,10 @@ pytest app/tests/
|
|
|
902
966
|
#### 4. Pipeline Processing Failures
|
|
903
967
|
|
|
904
968
|
**Error**: `Could not find metadata file. Please initialize this repo with "mfcli init"`
|
|
905
|
-
- **Solution**: You need to run `mfcli init` in your hardware files directory before running `mfcli
|
|
969
|
+
- **Solution**: You need to run `mfcli init` in your hardware files directory before running `mfcli run`
|
|
906
970
|
|
|
907
971
|
**Error**: `File not found`
|
|
908
|
-
- **Solution**: Make sure you're running `mfcli
|
|
972
|
+
- **Solution**: Make sure you're running `mfcli run` from within your hardware files directory (where you ran `mfcli init`)
|
|
909
973
|
|
|
910
974
|
**Error**: `File extension is not supported`
|
|
911
975
|
- **Solution**: Check that your files are in supported formats (PDF, EDIF, CSV, .net, .cir, .asc)
|
|
@@ -17,6 +17,7 @@ An AI-powered engineering document processing pipeline that intelligently analyz
|
|
|
17
17
|
|
|
18
18
|
## 📋 Table of Contents
|
|
19
19
|
|
|
20
|
+
- [Quick Start](#quick-start)
|
|
20
21
|
- [Architecture](#architecture)
|
|
21
22
|
- [Prerequisites](#prerequisites)
|
|
22
23
|
- [Installation](#installation)
|
|
@@ -31,6 +32,23 @@ An AI-powered engineering document processing pipeline that intelligently analyz
|
|
|
31
32
|
- [Development](#development)
|
|
32
33
|
- [Troubleshooting](#troubleshooting)
|
|
33
34
|
|
|
35
|
+
## 🚀 Quick Start
|
|
36
|
+
|
|
37
|
+
**New to mfcli?** Check out our **[Quick Start Guide](QUICKSTART.md)** for step-by-step instructions to get up and running in minutes!
|
|
38
|
+
|
|
39
|
+
The Quick Start Guide covers:
|
|
40
|
+
- ✅ Installing Cline for VS Code
|
|
41
|
+
- ✅ Installing mfcli with pipx (recommended)
|
|
42
|
+
- ✅ Setting up API keys
|
|
43
|
+
- ✅ Creating your first project
|
|
44
|
+
- ✅ Processing your hardware documents
|
|
45
|
+
- ✅ Querying your knowledge base with AI
|
|
46
|
+
- ✅ Currently unsupported features and workarounds
|
|
47
|
+
|
|
48
|
+
**[👉 Go to Quick Start Guide →](QUICKSTART.md)**
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
34
52
|
## 🏗️ Architecture
|
|
35
53
|
|
|
36
54
|
The system uses a streamlined architecture with a single controller agent that orchestrates a sequential processing pipeline:
|
|
@@ -38,7 +56,7 @@ The system uses a streamlined architecture with a single controller agent that o
|
|
|
38
56
|
```
|
|
39
57
|
Controller Agent
|
|
40
58
|
├── Tools:
|
|
41
|
-
│ ├──
|
|
59
|
+
│ ├── run (Sequential pipeline execution)
|
|
42
60
|
│ └── query_knowledgebase (RAG-based document queries)
|
|
43
61
|
│
|
|
44
62
|
└── Pipeline Stages:
|
|
@@ -302,18 +320,18 @@ mfcli init
|
|
|
302
320
|
```
|
|
303
321
|
|
|
304
322
|
You'll be prompted to enter a project name (3-45 characters, alphanumeric with underscores/hyphens allowed). If your directory is a git repository, the repository name will be suggested as the default - simply press Enter to accept it or type a different name. This creates a `multifactor/` folder at the git root (or current directory) containing:
|
|
305
|
-
- `
|
|
323
|
+
- `design/` - **Place your hardware design files here for processing**
|
|
306
324
|
- `config.json` - Project configuration with your project name
|
|
307
325
|
- `file_docket.json` - File tracking and metadata
|
|
308
326
|
- `generated_files/`, `hw_cheat_sheets/`, `data_sheets/`, etc. - Output folders
|
|
309
327
|
|
|
310
|
-
**3. Place your files in the
|
|
328
|
+
**3. Place your files in the design folder:**
|
|
311
329
|
|
|
312
330
|
```bash
|
|
313
|
-
# Copy or move your hardware design files to the
|
|
331
|
+
# Copy or move your hardware design files to the design folder
|
|
314
332
|
# Example for git repo at C:\git\my-project\:
|
|
315
|
-
copy *.pdf C:\git\my-project\multifactor\
|
|
316
|
-
copy *.csv C:\git\my-project\multifactor\
|
|
333
|
+
copy *.pdf C:\git\my-project\multifactor\design\
|
|
334
|
+
copy *.csv C:\git\my-project\multifactor\design\
|
|
317
335
|
```
|
|
318
336
|
|
|
319
337
|
**4. Run the pipeline:**
|
|
@@ -323,7 +341,7 @@ mfcli run
|
|
|
323
341
|
```
|
|
324
342
|
|
|
325
343
|
This will:
|
|
326
|
-
- Process all supported files in the `multifactor/
|
|
344
|
+
- Process all supported files in the `multifactor/design/` directory
|
|
327
345
|
- Skip files that have already been processed (matching MD5 checksum)
|
|
328
346
|
- Prompt for confirmation if a file has been modified (different MD5)
|
|
329
347
|
- Generate BOM CSV files (if schematics are found)
|
|
@@ -358,9 +376,56 @@ This ensures efficient processing by only analyzing new or changed files, while
|
|
|
358
376
|
The `mfcli` tool provides the following commands:
|
|
359
377
|
|
|
360
378
|
- **`mfcli init`** - Initialize a new project in the current directory
|
|
361
|
-
- **`mfcli
|
|
379
|
+
- **`mfcli run`** - Run the analysis pipeline on the current directory
|
|
362
380
|
- **`mfcli web [--port PORT]`** - Start the web UI (default port: 9999)
|
|
363
|
-
- **`mfcli
|
|
381
|
+
- **`mfcli add FILE [--purpose PURPOSE]`** - Add a file to ChromaDB knowledge base
|
|
382
|
+
- **`mfcli ls`** - List all files that have been vectorized into the knowledge base
|
|
383
|
+
- **`mfcli rm FILENAME [--yes]`** - Remove files from the knowledge base by filename
|
|
384
|
+
- **`mfcli configure [--check]`** - Interactive setup wizard to configure API keys and settings
|
|
385
|
+
- **`mfcli log-level LEVEL`** - Set the logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
|
|
386
|
+
- **`mfcli setup-mcp`** - Auto-configure MCP server for Cline and Claude Code
|
|
387
|
+
- **`mfcli doctor`** - Run system health checks and diagnose issues
|
|
388
|
+
- **`mfcli clean [--accept] [--all]`** - Clean all mfcli app data
|
|
389
|
+
- **`mfcli pre-uninstall`** - Check for running processes before uninstallation
|
|
390
|
+
|
|
391
|
+
#### Configure Logging Level
|
|
392
|
+
|
|
393
|
+
Set the logging verbosity level for mfcli operations:
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
# Set to DEBUG for detailed troubleshooting
|
|
397
|
+
mfcli log-level DEBUG
|
|
398
|
+
|
|
399
|
+
# Set to INFO for normal operation (default)
|
|
400
|
+
mfcli log-level INFO
|
|
401
|
+
|
|
402
|
+
# Set to WARNING to only see warnings and errors
|
|
403
|
+
mfcli log-level WARNING
|
|
404
|
+
|
|
405
|
+
# Set to ERROR to only see errors
|
|
406
|
+
mfcli log-level ERROR
|
|
407
|
+
|
|
408
|
+
# Set to CRITICAL for only critical errors
|
|
409
|
+
mfcli log-level CRITICAL
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
The log level setting is stored in your configuration file (`~/Multifactor/.env`) and will take effect on the next mfcli command. This is particularly useful when:
|
|
413
|
+
- **DEBUG**: Troubleshooting issues or understanding detailed pipeline operations
|
|
414
|
+
- **INFO**: Normal day-to-day operation with informative messages
|
|
415
|
+
- **WARNING**: Production use where you only want to see potential issues
|
|
416
|
+
- **ERROR**: When you only care about actual errors
|
|
417
|
+
|
|
418
|
+
**Example:**
|
|
419
|
+
```bash
|
|
420
|
+
# Enable detailed logging for troubleshooting
|
|
421
|
+
mfcli log-level DEBUG
|
|
422
|
+
|
|
423
|
+
# Run the pipeline with verbose output
|
|
424
|
+
mfcli run
|
|
425
|
+
|
|
426
|
+
# Return to normal logging
|
|
427
|
+
mfcli log-level INFO
|
|
428
|
+
```
|
|
364
429
|
|
|
365
430
|
#### Start Web UI
|
|
366
431
|
|
|
@@ -461,7 +526,7 @@ To use the MCP server with Cline (or other MCP-compatible clients), add the foll
|
|
|
461
526
|
```bash
|
|
462
527
|
cd /path/to/hardware/files
|
|
463
528
|
mfcli init
|
|
464
|
-
mfcli
|
|
529
|
+
mfcli run
|
|
465
530
|
```
|
|
466
531
|
|
|
467
532
|
3. **Add the MCP configuration** to your Cline/Claude settings file (see Configuration above)
|
|
@@ -485,7 +550,7 @@ To use the MCP server with Cline (or other MCP-compatible clients), add the foll
|
|
|
485
550
|
- **Solution**: Run the pipeline at least once to create the vector database:
|
|
486
551
|
```bash
|
|
487
552
|
mfcli init
|
|
488
|
-
mfcli
|
|
553
|
+
mfcli run
|
|
489
554
|
```
|
|
490
555
|
|
|
491
556
|
**Error**: `MCP server timeout`
|
|
@@ -608,12 +673,11 @@ Created within a **"multifactor"** folder at the **git repository root** if you'
|
|
|
608
673
|
└── multifactor/ # Parent folder for all project files and outputs
|
|
609
674
|
├── config.json # Project configuration (project name, etc.)
|
|
610
675
|
├── file_docket.json # File tracking and processing metadata
|
|
611
|
-
├──
|
|
676
|
+
├── design/ # Place your hardware design files here for processing
|
|
612
677
|
├── generated_files/ # BOM CSV files generated from schematics
|
|
613
678
|
├── hw_cheat_sheets/ # JSON cheat sheets (MCU, errata, debug, functional blocks)
|
|
614
679
|
├── data_sheets/ # Downloaded component datasheets (from BOM processing)
|
|
615
680
|
├── pdf_parts/ # Extracted PDF parts for analysis
|
|
616
|
-
├── agent_instructions/ # (Reserved for future use)
|
|
617
681
|
├── fw_tasks/ # (Reserved for future use)
|
|
618
682
|
└── requirements/ # (Reserved for future use)
|
|
619
683
|
```
|
|
@@ -624,7 +688,7 @@ If you're in a git repository at `C:\git\my-hardware-project\` and run `mfcli in
|
|
|
624
688
|
|
|
625
689
|
- `C:\git\my-hardware-project\multifactor\config.json` - Project configuration
|
|
626
690
|
- `C:\git\my-hardware-project\multifactor\file_docket.json` - File tracking
|
|
627
|
-
- `C:\git\my-hardware-project\multifactor\
|
|
691
|
+
- `C:\git\my-hardware-project\multifactor\design\` - Place source files here
|
|
628
692
|
- `C:\git\my-hardware-project\multifactor\generated_files\` - Generated BOM files
|
|
629
693
|
- `C:\git\my-hardware-project\multifactor\hw_cheat_sheets\` - Cheat sheets
|
|
630
694
|
- `C:\git\my-hardware-project\multifactor\data_sheets\` - Downloaded datasheets
|
|
@@ -636,7 +700,7 @@ If you're NOT in a git repository and run `mfcli init` from `C:\Projects\hardwar
|
|
|
636
700
|
|
|
637
701
|
- `C:\Projects\hardware\board_v1\multifactor\config.json` - Project configuration
|
|
638
702
|
- `C:\Projects\hardware\board_v1\multifactor\file_docket.json` - File tracking
|
|
639
|
-
- `C:\Projects\hardware\board_v1\multifactor\
|
|
703
|
+
- `C:\Projects\hardware\board_v1\multifactor\design\` - Place source files here
|
|
640
704
|
- `C:\Projects\hardware\board_v1\multifactor\generated_files\` - Generated BOM files
|
|
641
705
|
- `C:\Projects\hardware\board_v1\multifactor\hw_cheat_sheets\` - Cheat sheets
|
|
642
706
|
- `C:\Projects\hardware\board_v1\multifactor\data_sheets\` - Downloaded datasheets
|
|
@@ -747,7 +811,7 @@ First, navigate to your hardware files directory and initialize:
|
|
|
747
811
|
```bash
|
|
748
812
|
cd /path/to/hardware/files
|
|
749
813
|
mfcli init
|
|
750
|
-
mfcli
|
|
814
|
+
mfcli run
|
|
751
815
|
```
|
|
752
816
|
|
|
753
817
|
### Starting the Web UI
|
|
@@ -844,10 +908,10 @@ pytest app/tests/
|
|
|
844
908
|
#### 4. Pipeline Processing Failures
|
|
845
909
|
|
|
846
910
|
**Error**: `Could not find metadata file. Please initialize this repo with "mfcli init"`
|
|
847
|
-
- **Solution**: You need to run `mfcli init` in your hardware files directory before running `mfcli
|
|
911
|
+
- **Solution**: You need to run `mfcli init` in your hardware files directory before running `mfcli run`
|
|
848
912
|
|
|
849
913
|
**Error**: `File not found`
|
|
850
|
-
- **Solution**: Make sure you're running `mfcli
|
|
914
|
+
- **Solution**: Make sure you're running `mfcli run` from within your hardware files directory (where you ran `mfcli init`)
|
|
851
915
|
|
|
852
916
|
**Error**: `File extension is not supported`
|
|
853
917
|
- **Solution**: Check that your files are in supported formats (PDF, EDIF, CSV, .net, .cir, .asc)
|
|
@@ -35,6 +35,17 @@ llama_cloud_api_key=your_llamaparse_api_key_here
|
|
|
35
35
|
digikey_client_id=your_digikey_client_id_here
|
|
36
36
|
digikey_client_secret=your_digikey_client_secret_here
|
|
37
37
|
|
|
38
|
+
# ============================================================
|
|
39
|
+
# LOGGING CONFIGURATION
|
|
40
|
+
# ============================================================
|
|
41
|
+
|
|
42
|
+
# Log level for mfcli operations
|
|
43
|
+
# Available levels: DEBUG, INFO, WARNING, ERROR, CRITICAL
|
|
44
|
+
# Default: INFO
|
|
45
|
+
# Use DEBUG for detailed troubleshooting, INFO for normal operation
|
|
46
|
+
# Change with: mfcli log-level <LEVEL>
|
|
47
|
+
log_level=INFO
|
|
48
|
+
|
|
38
49
|
# ============================================================
|
|
39
50
|
# VECTOR DATABASE CONFIGURATION
|
|
40
51
|
# ============================================================
|
|
@@ -4,7 +4,7 @@ from google.adk.agents import Agent
|
|
|
4
4
|
|
|
5
5
|
from mfcli.agents.controller.tools import query_knowledgebase, list_projects
|
|
6
6
|
from mfcli.agents.tools.general import load_agent_config
|
|
7
|
-
from mfcli.pipeline.pipeline import
|
|
7
|
+
from mfcli.pipeline.pipeline import run
|
|
8
8
|
|
|
9
9
|
config_path = Path(__file__).parent / "config.yaml"
|
|
10
10
|
config = load_agent_config(config_path)
|
|
@@ -14,6 +14,6 @@ root_agent = Agent(
|
|
|
14
14
|
model=config.model,
|
|
15
15
|
description=config.description,
|
|
16
16
|
instruction=config.instructions,
|
|
17
|
-
tools=[
|
|
17
|
+
tools=[run, query_knowledgebase, list_projects],
|
|
18
18
|
output_key="pipeline_run_output"
|
|
19
19
|
)
|
|
@@ -9,7 +9,7 @@ instructions: |
|
|
|
9
9
|
- The user asks you to analyze documents in a directory
|
|
10
10
|
- If the user does not specify the name of the project to analyze, run the list_projects tool and ask the user to choose it from the returned list first
|
|
11
11
|
- Display the list of projects neatly as a bulleted list
|
|
12
|
-
- Once the user has chosen a project, you MUST then run the
|
|
12
|
+
- Once the user has chosen a project, you MUST then run the run tool to start the pipeline
|
|
13
13
|
- Respond to the user with the output from the pipeline
|
|
14
14
|
- You will receive a summary from the completed pipeline about the number of files which were successfully processed, the number that failed and the total
|
|
15
15
|
- You will also receive a list of errors, if any
|
|
@@ -41,8 +41,8 @@ def run_web_server(port: int):
|
|
|
41
41
|
|
|
42
42
|
|
|
43
43
|
def start_pipeline(project_config):
|
|
44
|
-
from mfcli.pipeline.pipeline import
|
|
45
|
-
asyncio.run(
|
|
44
|
+
from mfcli.pipeline.pipeline import run_with_config
|
|
45
|
+
asyncio.run(run_with_config(project_config))
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
def run_cli():
|
|
@@ -154,6 +154,18 @@ def run_cli():
|
|
|
154
154
|
help="Check for running processes and prepare system for uninstallation"
|
|
155
155
|
)
|
|
156
156
|
|
|
157
|
+
log_level_cmd = sub.add_parser(
|
|
158
|
+
"log-level",
|
|
159
|
+
help="View or set the logging level for mfcli"
|
|
160
|
+
)
|
|
161
|
+
log_level_cmd.add_argument(
|
|
162
|
+
"level",
|
|
163
|
+
type=str,
|
|
164
|
+
nargs="?",
|
|
165
|
+
choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
|
|
166
|
+
help="Logging level to set (DEBUG, INFO, WARNING, ERROR, CRITICAL). If not provided, displays current level."
|
|
167
|
+
)
|
|
168
|
+
|
|
157
169
|
# Parse early to catch --version and --help before initialization
|
|
158
170
|
args = parser.parse_args()
|
|
159
171
|
|
|
@@ -167,7 +179,7 @@ def run_cli():
|
|
|
167
179
|
logger.debug("Starting CLI")
|
|
168
180
|
|
|
169
181
|
# Commands that don't need full initialization
|
|
170
|
-
lightweight_commands = {"pre-uninstall", "doctor", "setup-mcp", "configure"}
|
|
182
|
+
lightweight_commands = {"pre-uninstall", "doctor", "setup-mcp", "configure", "log-level"}
|
|
171
183
|
|
|
172
184
|
# Only run expensive checks for commands that need them
|
|
173
185
|
if args.command not in lightweight_commands:
|
|
@@ -201,6 +213,9 @@ def run_cli():
|
|
|
201
213
|
elif args.command == "pre-uninstall":
|
|
202
214
|
from mfcli.utils.pre_uninstall import run_pre_uninstall_check
|
|
203
215
|
run_pre_uninstall_check()
|
|
216
|
+
elif args.command == "log-level":
|
|
217
|
+
from mfcli.utils.configurator import set_log_level
|
|
218
|
+
set_log_level(args.level)
|
|
204
219
|
else:
|
|
205
220
|
# Commands that need project config
|
|
206
221
|
from mfcli.crud.project import read_project_config_file
|
|
@@ -82,27 +82,72 @@ def init_project(project_name: str | None, repo_dir: Path | None = None):
|
|
|
82
82
|
file_path = app_dirs.config_file_path
|
|
83
83
|
if os.path.exists(file_path):
|
|
84
84
|
project_config = read_project_config_file()
|
|
85
|
-
get_project_by_name(db, project_config.name)
|
|
86
|
-
logger.debug(f"Project has already been initialized: {project_config.name}")
|
|
87
85
|
|
|
88
|
-
#
|
|
86
|
+
# Check if project exists in database
|
|
89
87
|
try:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
88
|
+
get_project_by_name(db, project_config.name)
|
|
89
|
+
logger.debug(f"Project has already been initialized: {project_config.name}")
|
|
90
|
+
|
|
91
|
+
# Create Cline workspace rules file if it doesn't exist
|
|
92
|
+
try:
|
|
93
|
+
from mfcli.utils.cline_rules import create_cline_rules_file
|
|
94
|
+
if create_cline_rules_file(repo_dir):
|
|
95
|
+
print("\n✅ Created Cline workspace rules file: .clinerules/multifactor.md")
|
|
96
|
+
print(" This file provides AI assistants with context about using the MCP server and hw_cheat_sheets/")
|
|
97
|
+
except Exception as e:
|
|
98
|
+
print(f"\n⚠️ Warning: Could not create Cline rules file: {e}")
|
|
99
|
+
logger.error(f"Error creating Cline rules file: {e}")
|
|
100
|
+
|
|
101
|
+
# Run MCP verification even for already initialized projects
|
|
102
|
+
try:
|
|
103
|
+
from mfcli.utils.mcp_configurator import verify_and_prompt_mcp_setup
|
|
104
|
+
verify_and_prompt_mcp_setup()
|
|
105
|
+
except Exception as e:
|
|
106
|
+
print(f"\n⚠️ Warning: Could not verify MCP setup: {e}")
|
|
107
|
+
logger.error(f"Error during MCP verification: {e}")
|
|
108
|
+
return
|
|
109
|
+
except ValueError:
|
|
110
|
+
# Project config exists but not in database - ask user if they want to add it
|
|
111
|
+
print(f"\n⚠️ Found existing config.json with project name: {project_config.name}")
|
|
112
|
+
print(f" However, this project is not in the database.")
|
|
113
|
+
print(f" This can happen if the database was deleted or you moved to a new machine.\n")
|
|
114
|
+
|
|
115
|
+
response = input(f"Would you like to add '{project_config.name}' to the database? (y/n): ").strip().lower()
|
|
116
|
+
|
|
117
|
+
if response in ['y', 'yes']:
|
|
118
|
+
logger.debug(f"Adding existing project to database: {project_config.name}")
|
|
119
|
+
project = Project(
|
|
120
|
+
name=project_config.name,
|
|
121
|
+
repo_dir=str(repo_dir),
|
|
122
|
+
index_id=uuid4().hex
|
|
123
|
+
)
|
|
124
|
+
db.add(project)
|
|
125
|
+
db.flush()
|
|
126
|
+
db.commit()
|
|
127
|
+
print(f"\n✅ Successfully added project '{project_config.name}' to the database!")
|
|
128
|
+
|
|
129
|
+
# Create Cline workspace rules file if it doesn't exist
|
|
130
|
+
try:
|
|
131
|
+
from mfcli.utils.cline_rules import create_cline_rules_file
|
|
132
|
+
if create_cline_rules_file(repo_dir):
|
|
133
|
+
print("\n✅ Created Cline workspace rules file: .clinerules/multifactor.md")
|
|
134
|
+
print(" This file provides AI assistants with context about using the MCP server and hw_cheat_sheets/")
|
|
135
|
+
except Exception as e:
|
|
136
|
+
print(f"\n⚠️ Warning: Could not create Cline rules file: {e}")
|
|
137
|
+
logger.error(f"Error creating Cline rules file: {e}")
|
|
138
|
+
|
|
139
|
+
# Run MCP verification
|
|
140
|
+
try:
|
|
141
|
+
from mfcli.utils.mcp_configurator import verify_and_prompt_mcp_setup
|
|
142
|
+
verify_and_prompt_mcp_setup()
|
|
143
|
+
except Exception as e:
|
|
144
|
+
print(f"\n⚠️ Warning: Could not verify MCP setup: {e}")
|
|
145
|
+
logger.error(f"Error during MCP verification: {e}")
|
|
146
|
+
return
|
|
147
|
+
else:
|
|
148
|
+
print(f"\n❌ Project not added to database.")
|
|
149
|
+
print(f" If you want to reinitialize with a different name, delete config.json first.")
|
|
150
|
+
sys.exit(1)
|
|
106
151
|
|
|
107
152
|
repo_dir_path = repo_dir
|
|
108
153
|
repo_dir = str(repo_dir)
|