cli
Command-line interface for Snakemake workflow monitoring.
Classes¶
Functions¶
log_handler_path ¶
Print the path to the log handler script for Snakemake 8.x.
Use with: snakemake --log-handler-script $(snakesee log-handler-path) --cores 4
This enables real-time job tracking without requiring Snakemake 9+.
Source code in snakesee/cli.py
main ¶
Entry point for the snakesee CLI.
Source code in snakesee/cli.py
profile_export ¶
profile_export(workflow_dir: Path = Path('.'), *, output: Path | None = None, merge: bool = False) -> None
Export timing profile from workflow metadata.
Creates a portable JSON file containing historical timing data that can be shared across machines or used to bootstrap estimates for new runs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workflow_dir
|
Path
|
Path to workflow directory containing .snakemake/. |
Path('.')
|
output
|
Path | None
|
Output file path. Defaults to .snakesee-profile.json in workflow_dir. |
None
|
merge
|
bool
|
If output file exists, merge with existing data instead of replacing. |
False
|
Source code in snakesee/cli.py
profile_show ¶
Display contents of a timing profile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
profile_path
|
Path
|
Path to the profile file. |
required |
Source code in snakesee/cli.py
status ¶
status(workflow_dir: Path = Path('.'), *, no_estimate: bool = False, profile: Path | None = None) -> None
Show a one-time status snapshot (non-interactive).
Useful for scripting or quick checks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workflow_dir
|
Path
|
Path to workflow directory containing .snakemake/. |
Path('.')
|
no_estimate
|
bool
|
Disable time estimation from historical data. |
False
|
profile
|
Path | None
|
Optional path to a timing profile for bootstrapping estimates. |
None
|
Source code in snakesee/cli.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 | |
watch ¶
watch(workflow_dir: Path = Path('.'), *, refresh: float = 2.0, no_estimate: bool = False, profile: Path | None = None, wildcard_timing: bool = True, weighting_strategy: Literal['index', 'time'] = 'index', half_life_logs: int = 10, half_life_days: float = 7.0, colorblind: bool = False) -> None
Watch a Snakemake workflow in real-time with a TUI dashboard.
Passively monitors the .snakemake/ directory without requiring special flags when running snakemake. Press 'q' to quit the TUI.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
workflow_dir
|
Path
|
Path to workflow directory containing .snakemake/. |
Path('.')
|
refresh
|
float
|
Refresh interval in seconds (0.5 to 60.0). |
2.0
|
no_estimate
|
bool
|
Disable time estimation from historical data. |
False
|
profile
|
Path | None
|
Optional path to a timing profile (.snakesee-profile.json) for bootstrapping estimates. If not specified, will auto-discover. |
None
|
wildcard_timing
|
bool
|
Use wildcard conditioning for estimates (estimate per sample/batch). Enabled by default. Toggle with 'w' key in TUI. |
True
|
weighting_strategy
|
Literal['index', 'time']
|
Strategy for weighting historical timing data. "index" (default) - weight by run index, ideal for active development where each run may fix issues. "time" - weight by wall-clock time, better for stable pipelines. |
'index'
|
half_life_logs
|
int
|
Half-life in number of runs for index-based weighting. After this many runs, a run's weight is halved. Default: 10. Only used when weighting_strategy="index". |
10
|
half_life_days
|
float
|
Half-life in days for time-based weighting. After this many days, a run's weight is halved. Default: 7.0. Only used when weighting_strategy="time". |
7.0
|
colorblind
|
bool
|
Use colorblind-accessible mode with distinct characters in progress bars. Can also be toggled with 'a' key in TUI. |
False
|