diff --git a/README.md b/README.md
index cc1a540..c50c0e2 100644
--- a/README.md
+++ b/README.md
@@ -137,6 +137,7 @@ maintainability operator:
 You can put a `wily.cfg` file in your project directory and `wily` will override the runtime settings. Here are the available options:
 
 ```ini
+[wily]
 # list of operators, choose from cyclomatic, maintainability, mccabe and raw
 operators = cyclomatic,raw
 # archiver to use, defaults to git
diff --git a/docs/source/commands/build.rst b/docs/source/commands/build.rst
index c1cd7a7..e7311a0 100644
--- a/docs/source/commands/build.rst
+++ b/docs/source/commands/build.rst
@@ -34,7 +34,7 @@ You can override the maximum number of commits recursed by using the ``-n`` or `
 
    $ wily build src/ test/ -n 100
 
-By default, wily will compile the cyclomatic complexity, maintainability and raw metrics. If you only want a subset of those, you can specify with comma-seperate ``--operator`` or ``-o`` flag
+By default, wily will compile the cyclomatic complexity, maintainability and raw metrics. If you only want a subset of those, you can specify with comma-separate ``--operator`` or ``-o`` flag
 
 .. code-block:: none
 
diff --git a/wily/__main__.py b/wily/__main__.py
index d60f01f..4a03e69 100644
--- a/wily/__main__.py
+++ b/wily/__main__.py
@@ -89,7 +89,7 @@ def cli(ctx, debug, config, path, cache):
     type=click.INT,
     help="The maximum number of historical commits to archive",
 )
-@click.argument("targets", type=click.Path(resolve_path=True), nargs=-1, required=True)
+@click.argument("targets", type=click.Path(resolve_path=True), nargs=-1, required=False)
 @click.option(
     "-o",
     "--operators",
@@ -122,8 +122,9 @@ def build(ctx, max_revisions, targets, operators, archiver):
         logger.debug(f"Fixing archiver to {archiver}")
         config.archiver = archiver
 
-    logger.debug(f"Fixing targets to {targets}")
-    config.targets = targets
+    if targets:
+        logger.debug(f"Fixing targets to {targets}")
+        config.targets = targets
 
     build(
         config=config,

Cannot override targets from wily.cfg
Example wily.cfg file:
```
[wily]
max_revisions = 100
path = ./tests,config.py,./load
```
Run:
`wily build`

Expected behavior:
Generates wily cache. Existing code in the `WilyConfig` class has support for defaulting the targets to the passed path.

Actual behavior:
Prints help message because `targets` are missing.

Possible Solution:
Remove `required=True` from the click option, set `config.targets` only if targets are passed, and do a check that `config.targets` are defined before running `build`.
diff --git a/test/integration/test_build.py b/test/integration/test_build.py
index 30cf153..688072d 100644
--- a/test/integration/test_build.py
+++ b/test/integration/test_build.py
@@ -6,10 +6,8 @@ Many of the tests will depend on a "builddir" fixture which is a compiled wily c
 
 TODO : Test build + build with extra operator
 """
-import os
 import sys
 import pathlib
-import tempfile
 import pytest
 from click.testing import CliRunner
 from git import Repo, Actor
@@ -62,15 +60,6 @@ def test_build_invalid_path():
     assert result.exit_code == 1, result.stdout
 
 
-def test_build_no_target(tmpdir):
-    """
-    Test that build fails with no target
-    """
-    runner = CliRunner()
-    result = runner.invoke(main.cli, ["--path", tmpdir, "build"])
-    assert result.exit_code == 2, result.stdout
-
-
 def test_build_crash(tmpdir):
     """
     Simulate a runtime error in the build.
@@ -137,6 +126,50 @@ def test_build(tmpdir, cache_path):
     assert rev_path.exists()
 
 
+@pytest.mark.skipif(sys.platform == "win32", reason="does not run on windows")
+def test_build_with_config(tmpdir, cache_path):
+    """
+    Test that build works in a basic repository and a configuration file.
+    """
+    repo = Repo.init(path=tmpdir)
+    tmppath = pathlib.Path(tmpdir)
+
+    config = """
+    [wily]
+    path = test.py
+    """
+    config_path = tmppath / "wily.cfg"
+    with open(config_path, "w") as config_f:
+        config_f.write(config)
+
+    # Write a test file to the repo
+    with open(tmppath / "test.py", "w") as test_txt:
+        test_txt.write("import abc")
+
+    index = repo.index
+    index.add(["test.py"])
+
+    author = Actor("An author", "author@example.com")
+    committer = Actor("A committer", "committer@example.com")
+
+    commit = index.commit("basic test", author=author, committer=committer)
+    repo.close()
+
+    runner = CliRunner()
+    result = runner.invoke(
+        main.cli,
+        ["--debug", "--config", config_path, "--path", tmpdir, "--cache", cache_path, "build"],
+    )
+    assert result.exit_code == 0, result.stdout
+
+    cache_path = pathlib.Path(cache_path)
+    assert cache_path.exists()
+    index_path = cache_path / "git" / "index.json"
+    assert index_path.exists()
+    rev_path = cache_path / "git" / (commit.name_rev.split(" ")[0] + ".json")
+    assert rev_path.exists()
+
+
 def test_build_twice(tmpdir, cache_path):
     """
     Test that build works when run twice.

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest mock pydocstyle
apt-get update apt-get install -y gcc
3.9
docs/requirements_docs.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.16
attrs==25.3.0
babel==2.17.0
certifi==2025.1.31
charset-normalizer==3.4.1
click==8.1.8
colorama==0.4.6
colorlog==4.8.0
dataclasses==0.6
docutils==0.21.2
exceptiongroup==1.2.2
fastjsonschema==2.21.1
future==1.0.0
gitdb==4.0.12
GitPython==3.1.44
idna==3.10
imagesize==1.4.1
importlib_metadata==8.6.1
iniconfig==2.1.0
Jinja2==3.1.6
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
jupyter_core==5.7.2
mando==0.6.4
MarkupSafe==3.0.2
mock==5.2.0
nbformat==5.10.4
packaging==24.2
platformdirs==4.3.7
plotly==5.24.1
pluggy==1.5.0
progress==1.6
pydocstyle==6.3.0
Pygments==2.19.1
pytest==8.3.5
radon==5.1.0
referencing==0.36.2
requests==2.32.3
rpds-py==0.24.0
six==1.17.0
smmap==5.0.2
snowballstemmer==2.2.0
Sphinx==7.4.7
sphinx-click==6.0.0
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
tabulate==0.9.0
tenacity==9.0.0
tomli==2.2.1
traitlets==5.14.3
typing_extensions==4.13.0
urllib3==2.3.0
-e git+https://github.com/tonybaloney/wily.git@cb7fb4e06d933e78f077fc24edfb5ae1c383cbc4#egg=wily
zipp==3.21.0

name: wily
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.16
      - attrs==25.3.0
      - babel==2.17.0
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - click==8.1.8
      - colorama==0.4.6
      - colorlog==4.8.0
      - dataclasses==0.6
      - docutils==0.21.2
      - exceptiongroup==1.2.2
      - fastjsonschema==2.21.1
      - future==1.0.0
      - gitdb==4.0.12
      - gitpython==3.1.44
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==8.6.1
      - iniconfig==2.1.0
      - jinja2==3.1.6
      - jsonschema==4.23.0
      - jsonschema-specifications==2024.10.1
      - jupyter-core==5.7.2
      - mando==0.6.4
      - markupsafe==3.0.2
      - mock==5.2.0
      - nbformat==5.10.4
      - packaging==24.2
      - platformdirs==4.3.7
      - plotly==5.24.1
      - pluggy==1.5.0
      - progress==1.6
      - pydocstyle==6.3.0
      - pygments==2.19.1
      - pytest==8.3.5
      - radon==5.1.0
      - referencing==0.36.2
      - requests==2.32.3
      - rpds-py==0.24.0
      - six==1.17.0
      - smmap==5.0.2
      - snowballstemmer==2.2.0
      - sphinx==7.4.7
      - sphinx-click==6.0.0
      - sphinxcontrib-applehelp==2.0.0
      - sphinxcontrib-devhelp==2.0.0
      - sphinxcontrib-htmlhelp==2.1.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==2.0.0
      - sphinxcontrib-serializinghtml==2.0.0
      - tabulate==0.9.0
      - tenacity==9.0.0
      - tomli==2.2.1
      - traitlets==5.14.3
      - typing-extensions==4.13.0
      - urllib3==2.3.0
      - wily==1.11.0
      - zipp==3.21.0
prefix: /opt/conda/envs/wily

test/integration/test_build.py::test_build_with_config
test/integration/test_build.py::test_build_crash
test/integration/test_build.py::test_build_not_git_repo test/integration/test_build.py::test_build_custom_cache test/integration/test_build.py::test_build_invalid_path test/integration/test_build.py::test_build test/integration/test_build.py::test_build_twice test/integration/test_build.py::test_build_no_commits test/integration/test_build.py::test_build_dirty_repo test/integration/test_build.py::test_build_no_git_history test/integration/test_build.py::test_build_archiver[git] test/integration/test_build.py::test_build_archiver[filesystem]
docs/source/commands/build.rst README.md wily/__main__.py
docs/source/commands/build.rst README.md wily/__main__.py