Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 25 additions & 25 deletions docs/md/dev/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,36 +337,36 @@ The simplest approach would be a single such script/command, e.g. `python -m mod

```bash
# Show configured registries and status
python -m modflow_devtools.models info
mf models info

# Sync all sources to configured refs
python -m modflow_devtools.models sync
mf models sync

# Force re-download even if cached
python -m modflow_devtools.models sync --force
mf models sync --force

# For a repo publishing models via releases
python -m modflow_devtools.models sync --repo MODFLOW-ORG/modflow6-examples --ref current
mf models sync --repo MODFLOW-ORG/modflow6-examples --ref current

# For a repo with models under version control
python -m modflow_devtools.models sync --repo MODFLOW-ORG/modflow6-testmodels --ref develop
python -m modflow_devtools.models sync --repo MODFLOW-ORG/modflow6-testmodels --ref f3df630 # commit hash works too
```

Or via CLI commands:

```bash
models info
models sync
mf models sync --repo MODFLOW-ORG/modflow6-testmodels --ref develop
mf models sync --repo MODFLOW-ORG/modflow6-testmodels --ref f3df630 # commit hash works too
```

Perhaps leading with a `models` command namespace is too generic, and we need e.g. a leading `mf` namespace on all commands exposed by `modflow-devtools`:
CLI commands are available in two forms:

```bash
# Using the mf namespace (shorter)
mf models info
mf models sync

# Or using the module form
python -m modflow_devtools.models info
python -m modflow_devtools.models sync
```

The `mf` command provides a unified CLI namespace for all `modflow-devtools` commands.

#### Automatic sync

At install time, `modflow-devtools` can load the bootstrap file and attempt to sync to all configured repositories/registries. The install should not fail if registry sync fails (due either to network errors or misconfiguration), however — an informative warning can be shown, and sync retried on subsequent imports and/or manually (see below).
Expand Down Expand Up @@ -709,7 +709,7 @@ _DEFAULT_CACHE.clear()
#### Show Registry Status

```bash
$ python -m modflow_devtools.models info
$ mf models info

Registry sync status:

Expand All @@ -727,19 +727,19 @@ mf6/example (MODFLOW-ORG/modflow6-examples)

```bash
# Sync all configured sources/refs
$ python -m modflow_devtools.models sync
$ mf models sync

# Sync specific source
$ python -m modflow_devtools.models sync --source modflow6-testmodels
$ mf models sync --source modflow6-testmodels

# Sync specific ref
$ python -m modflow_devtools.models sync --source modflow6-testmodels --ref develop
$ mf models sync --source modflow6-testmodels --ref develop

# Force re-download
$ python -m modflow_devtools.models sync --force
$ mf models sync --force

# Test against a fork
$ python -m modflow_devtools.models sync \
$ mf models sync \
--source modflow6-testmodels \
--ref feature-branch \
--repo myusername/modflow6-testmodels
Expand All @@ -749,19 +749,19 @@ $ python -m modflow_devtools.models sync \

```bash
# Summary view
$ python -m modflow_devtools.models list
$ mf models list

# Verbose view (show all model names)
$ python -m modflow_devtools.models list --verbose
$ mf models list --verbose

# Filter by source
$ python -m modflow_devtools.models list --source mf6/test
$ mf models list --source mf6/test

# Filter by ref
$ python -m modflow_devtools.models list --ref registry
$ mf models list --ref registry

# Combine filters
$ python -m modflow_devtools.models list --source mf6/test --ref registry --verbose
$ mf models list --source mf6/test --ref registry --verbose
```

### Registry Creation Tool
Expand Down
71 changes: 30 additions & 41 deletions docs/md/dev/programs.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,19 +481,19 @@ Exposed as a CLI command and Python API:

```bash
# Sync all configured sources and release tags
python -m modflow_devtools.programs sync
mf programs sync

# Sync specific source to specific release version
python -m modflow_devtools.programs sync --repo MODFLOW-ORG/modflow6 --version 6.6.3
# Sync specific source
mf programs sync --source modflow6

# Force re-download
python -m modflow_devtools.programs sync --force
mf programs sync --force

# Show sync status
python -m modflow_devtools.programs info
mf programs info

# List available programs
python -m modflow_devtools.programs list
mf programs list
```

Or via Python API:
Expand Down Expand Up @@ -544,15 +544,15 @@ The `--force` flag has different meanings depending on the command, maintaining
**Common patterns**:
```bash
# Update to latest registry and install
python -m modflow_devtools.programs sync --force
python -m modflow_devtools.programs install mf6
mf programs sync --force
mf programs install mf6

# Repair installation without touching registry (offline-friendly)
python -m modflow_devtools.programs install mf6 --force
mf programs install mf6 --force

# Complete refresh of both metadata and installation
python -m modflow_devtools.programs sync --force
python -m modflow_devtools.programs install mf6 --force
mf programs sync --force
mf programs install mf6 --force
```

### Program installation
Expand All @@ -561,38 +561,27 @@ Installation extends beyond metadata to actually providing program executables b

```bash
# Install from binary (auto-detects platform)
python -m modflow_devtools.programs install mf6
mf programs install mf6

# Install specific version
python -m modflow_devtools.programs install mf6@6.6.3
mf programs install mf6@6.6.3

# Install to custom location (interactive selection like get-modflow)
python -m modflow_devtools.programs install mf6 --bindir :

# Install to specific directory
python -m modflow_devtools.programs install mf6 --bindir /usr/local/bin
# Install to custom location
mf programs install mf6 --bindir /usr/local/bin

# Install multiple versions side-by-side (cached separately)
python -m modflow_devtools.programs install mf6@6.6.3
python -m modflow_devtools.programs install mf6@6.5.0

# Select active version (re-copies from cache to bindir)
python -m modflow_devtools.programs select mf6@6.6.3

# List installed programs
python -m modflow_devtools.programs list --installed

# List available versions of a program
python -m modflow_devtools.programs list mf6
mf programs install mf6@6.6.3
mf programs install mf6@6.5.0

# Show where program is installed
python -m modflow_devtools.programs which mf6
# List installation history
mf programs history
mf programs history mf6

# Uninstall specific version
python -m modflow_devtools.programs uninstall mf6@6.6.3
mf programs uninstall mf6@6.6.3

# Uninstall all versions
python -m modflow_devtools.programs uninstall mf6 --all
mf programs uninstall mf6 --all
```

Python API:
Expand Down Expand Up @@ -1055,14 +1044,14 @@ The Programs API has been implemented following a consolidated object-oriented a
- Force re-download support

**CLI Interface** ✅
- `python -m modflow_devtools.programs sync` - Sync registries
- `python -m modflow_devtools.programs info` - Show sync status
- `python -m modflow_devtools.programs list` - List available programs
- `python -m modflow_devtools.programs install` - Install a program
- `python -m modflow_devtools.programs select` - Switch active version
- `python -m modflow_devtools.programs uninstall` - Uninstall a program
- `python -m modflow_devtools.programs which` - Show executable path
- `python -m modflow_devtools.programs installed` - List installed programs
- `mf programs sync` - Sync registries
- `mf programs info` - Show sync status
- `mf programs list` - List available programs
- `mf programs install` - Install a program
- `mf programs uninstall` - Uninstall a program
- `mf programs history` - Show installation history

All commands also support the module form: `python -m modflow_devtools.programs <command>`

**Registry Generation Tool** ✅
- `modflow_devtools/programs/make_registry.py` - Generate registry files
Expand Down
21 changes: 18 additions & 3 deletions docs/md/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,16 @@ for source_name, source_status in status.items():
print(f"{source_name}: {source_status.cached_refs}")
```

Or via CLI:
Or via CLI (both forms are equivalent):

```bash
# Using the mf command
mf models sync
mf models sync --source modflow6-testmodels
mf models sync --source modflow6-testmodels --ref develop
mf models sync --force

# Or using the module form
python -m modflow_devtools.models sync
python -m modflow_devtools.models sync --source modflow6-testmodels
python -m modflow_devtools.models sync --source modflow6-testmodels --ref develop
Expand All @@ -101,10 +108,17 @@ for example_name, model_list in list(examples.items())[:3]:
print(f"{example_name}: {len(model_list)} models")
```

Or by CLI:
Or by CLI (both forms are equivalent):

```bash
# Using the mf command
mf models info # Show sync status
mf models list # Show model summary...
mf models list --verbose # ..or full list
# Filter by source
mf models list --source mf6/test --verbose

# Or using the module form
python -m modflow_devtools.models info # Show sync status
python -m modflow_devtools.models list # Show model summary...
python -m modflow_devtools.models list --verbose # ..or full list
Expand Down Expand Up @@ -268,7 +282,8 @@ export MODFLOW_DEVTOOLS_NO_AUTO_SYNC=1
Then manually sync when needed:

```bash
python -m modflow_devtools.models sync
mf models sync
# Or: python -m modflow_devtools.models sync
```

## Repository Integration
Expand Down
Loading