|
| 1 | +# Concore CLI |
| 2 | + |
| 3 | +A command-line interface for managing concore neuromodulation workflows. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +```bash |
| 8 | +pip install -e . |
| 9 | +``` |
| 10 | + |
| 11 | +## Quick Start |
| 12 | + |
| 13 | +```bash |
| 14 | +# Create a new project |
| 15 | +concore init my-project |
| 16 | + |
| 17 | +# Navigate to your project |
| 18 | +cd my-project |
| 19 | + |
| 20 | +# Validate your workflow |
| 21 | +concore validate workflow.graphml |
| 22 | + |
| 23 | +# Run your workflow |
| 24 | +concore run workflow.graphml |
| 25 | + |
| 26 | +# Check running processes |
| 27 | +concore status |
| 28 | + |
| 29 | +# Stop all processes |
| 30 | +concore stop |
| 31 | +``` |
| 32 | + |
| 33 | +## Commands |
| 34 | + |
| 35 | +### `concore init <name>` |
| 36 | + |
| 37 | +Creates a new concore project with a basic structure. |
| 38 | + |
| 39 | +**Options:** |
| 40 | +- `--template` - Template type to use (default: basic) |
| 41 | + |
| 42 | +**Example:** |
| 43 | +```bash |
| 44 | +concore init my-workflow |
| 45 | +``` |
| 46 | + |
| 47 | +Creates: |
| 48 | +``` |
| 49 | +my-workflow/ |
| 50 | +├── workflow.graphml # Sample workflow definition |
| 51 | +├── src/ |
| 52 | +│ └── script.py # Sample processing script |
| 53 | +└── README.md # Project documentation |
| 54 | +``` |
| 55 | + |
| 56 | +### `concore run <workflow_file>` |
| 57 | + |
| 58 | +Generates and optionally builds a workflow from a GraphML file. |
| 59 | + |
| 60 | +**Options:** |
| 61 | +- `-s, --source <dir>` - Source directory (default: src) |
| 62 | +- `-o, --output <dir>` - Output directory (default: out) |
| 63 | +- `-t, --type <type>` - Execution type: windows, posix, or docker (default: windows) |
| 64 | +- `--auto-build` - Automatically run build script after generation |
| 65 | + |
| 66 | +**Example:** |
| 67 | +```bash |
| 68 | +concore run workflow.graphml --source ./src --output ./build --auto-build |
| 69 | +``` |
| 70 | + |
| 71 | +### `concore validate <workflow_file>` |
| 72 | + |
| 73 | +Validates a GraphML workflow file before running. |
| 74 | + |
| 75 | +Checks: |
| 76 | +- Valid XML structure |
| 77 | +- GraphML format compliance |
| 78 | +- Node and edge definitions |
| 79 | +- File references and naming conventions |
| 80 | +- ZMQ vs file-based communication |
| 81 | + |
| 82 | +**Example:** |
| 83 | +```bash |
| 84 | +concore validate workflow.graphml |
| 85 | +``` |
| 86 | + |
| 87 | +### `concore status` |
| 88 | + |
| 89 | +Shows all currently running concore processes with details: |
| 90 | +- Process ID (PID) |
| 91 | +- Process name |
| 92 | +- Uptime |
| 93 | +- Memory usage |
| 94 | +- Command |
| 95 | + |
| 96 | +**Example:** |
| 97 | +```bash |
| 98 | +concore status |
| 99 | +``` |
| 100 | + |
| 101 | +### `concore stop` |
| 102 | + |
| 103 | +Stops all running concore processes. Prompts for confirmation before proceeding. |
| 104 | + |
| 105 | +**Example:** |
| 106 | +```bash |
| 107 | +concore stop |
| 108 | +``` |
| 109 | + |
| 110 | +## Development Workflow |
| 111 | + |
| 112 | +1. **Create a new project** |
| 113 | + ```bash |
| 114 | + concore init my-neuro-study |
| 115 | + cd my-neuro-study |
| 116 | + ``` |
| 117 | + |
| 118 | +2. **Edit your workflow** |
| 119 | + - Open `workflow.graphml` in yEd or similar GraphML editor |
| 120 | + - Add nodes for your processing steps |
| 121 | + - Connect nodes with edges to define data flow |
| 122 | + |
| 123 | +3. **Add processing scripts** |
| 124 | + - Place your Python/C++/MATLAB/Verilog files in the `src/` directory |
| 125 | + - Reference them in your workflow nodes |
| 126 | + |
| 127 | +4. **Validate before running** |
| 128 | + ```bash |
| 129 | + concore validate workflow.graphml |
| 130 | + ``` |
| 131 | + |
| 132 | +5. **Generate and run** |
| 133 | + ```bash |
| 134 | + concore run workflow.graphml --auto-build |
| 135 | + cd out |
| 136 | + ./run.bat # or ./run on Linux/Mac |
| 137 | + ``` |
| 138 | + |
| 139 | +6. **Monitor execution** |
| 140 | + ```bash |
| 141 | + concore status |
| 142 | + ``` |
| 143 | + |
| 144 | +7. **Stop when done** |
| 145 | + ```bash |
| 146 | + concore stop |
| 147 | + ``` |
| 148 | + |
| 149 | +## Workflow File Format |
| 150 | + |
| 151 | +Nodes should follow the format: `ID:filename.ext` |
| 152 | + |
| 153 | +Example: |
| 154 | +``` |
| 155 | +N1:controller.py |
| 156 | +N2:processor.cpp |
| 157 | +M1:analyzer.m |
| 158 | +``` |
| 159 | + |
| 160 | +Supported file types: |
| 161 | +- `.py` - Python |
| 162 | +- `.cpp` - C++ |
| 163 | +- `.m` - MATLAB/Octave |
| 164 | +- `.v` - Verilog |
| 165 | +- `.java` - Java |
| 166 | + |
| 167 | +## Troubleshooting |
| 168 | + |
| 169 | +**Issue: "Output directory already exists"** |
| 170 | +- Remove the existing output directory or choose a different name |
| 171 | +- Use `concore stop` to terminate any running processes first |
| 172 | + |
| 173 | +**Issue: Validation fails** |
| 174 | +- Check that your GraphML file is properly formatted |
| 175 | +- Ensure all nodes have labels in the format `ID:filename.ext` |
| 176 | +- Verify that edge connections reference valid nodes |
| 177 | + |
| 178 | +**Issue: Processes won't stop** |
| 179 | +- Try running `concore stop` with administrator/sudo privileges |
| 180 | +- Manually kill processes using Task Manager (Windows) or `kill` command (Linux/Mac) |
0 commit comments