diff --git a/zookeeper/core/cli.py b/zookeeper/core/cli.py
index 5769b13..f2ab714 100644
--- a/zookeeper/core/cli.py
+++ b/zookeeper/core/cli.py
@@ -7,6 +7,14 @@ from zookeeper.core.utils import convert_to_snake_case, parse_value_from_string
 
 class ConfigParam(click.ParamType):
     def convert(self, str_value, param, ctx):
+        # Allow the syntax `--name_of_key` to set the boolean flag to `True`,
+        # and likewise `--no-name_of_key` to set the boolean flag to `False`.
+        if re.match("^--[\\w.]+$", str_value):
+            return str_value[2:], True
+        if re.match("^--no-[\\w.]+$", str_value):
+            return str_value[5:], False
+
+        # Otherwise, expect the syntax `name_of_key=value`.
         try:
             key, value = str_value.split("=")
             # Make sure the key is alpha-numeric (possibly with full stops).
diff --git a/zookeeper/core/task.py b/zookeeper/core/task.py
index daf090b..cd1c35f 100644
--- a/zookeeper/core/task.py
+++ b/zookeeper/core/task.py
@@ -44,9 +44,9 @@ def task(cls):
             "the @task decorator is applied to."
         )
 
-    @cli.command(cls.__name__)
-    @click.argument("config", type=ConfigParam(), nargs=-1)
+    @cli.command(cls.__name__, context_settings=dict(ignore_unknown_options=True))
     @click.option("-i", "--interactive", is_flag=True, default=False)
+    @click.argument("config", type=ConfigParam(), nargs=-1)
     def command(config, interactive):
         config = {k: v for k, v in config}
         task_instance = cls()

Flag syntax for boolean params
At the moment, CLI params are passed with arguments of the form `key=value`, meaning that boolean parameters are set with e.g. `use_bias=True` or `use_bias=False`.

It would be nice if we could have the option of passing boolean arguments with `--use-bias` or `--no-use-bias` to set that parameter to `True` and `False` respectively.
diff --git a/zookeeper/core/cli_test.py b/zookeeper/core/cli_test.py
index a5ff3d8..b365162 100644
--- a/zookeeper/core/cli_test.py
+++ b/zookeeper/core/cli_test.py
@@ -8,9 +8,10 @@ from zookeeper.core.task import task
 class TestTask:
     a: int
     b: str = "foo"
+    c: bool = False
 
     def run(self):
-        print(self.a, self.b)
+        print(self.a, self.b, self.c)
 
 
 runner = testing.CliRunner(mix_stderr=False)
@@ -30,7 +31,7 @@ def test_pass_param_values():
     # We should be able to pass parameter values through the CLI.
     result = runner.invoke(cli, ["test_task", "a=5"])
     assert result.exit_code == 0
-    assert result.output == "5 foo\n"
+    assert result.output == "5 foo False\n"
 
 
 def test_param_key_valid_characters():
@@ -51,9 +52,9 @@ def test_param_key_invalid_characters():
 
 def test_override_param_values():
     # We should be able to override existing parameter values through the CLI.
-    result = runner.invoke(cli, ["test_task", "a=5", "b=bar"])
+    result = runner.invoke(cli, ["test_task", "a=5", "b=bar", "c=True"])
     assert result.exit_code == 0
-    assert result.output == "5 bar\n"
+    assert result.output == "5 bar True\n"
 
 
 def test_override_param_complex_string():
@@ -62,4 +63,14 @@ def test_override_param_complex_string():
         cli, ["test_task", "a=5", "b=https://some-path/foo/bar@somewhere"]
     )
     assert result.exit_code == 0
-    assert result.output == "5 https://some-path/foo/bar@somewhere\n"
+    assert result.output == "5 https://some-path/foo/bar@somewhere False\n"
+
+
+def test_boolean_flag_syntax():
+    # We should be able to use a shorthand for setting boolean flags.
+    result = runner.invoke(cli, ["test_task", "a=5", "--c"])
+    assert result.exit_code == 0
+    assert result.output == "5 foo True\n"
+    result = runner.invoke(cli, ["test_task", "a=5", "--no-c"])
+    assert result.exit_code == 0
+    assert result.output == "5 foo False\n"

pip install -e .
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-flake8 pytest-catchlog
apt-get update apt-get install -y gcc
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
absl-py==0.12.0
attrs==22.2.0
certifi==2021.5.30
charset-normalizer==2.0.12
click==8.0.4
coverage==6.2
dataclasses==0.8
dill==0.3.4
flake8==5.0.4
googleapis-common-protos==1.56.3
idna==3.10
importlib-metadata==4.2.0
importlib-resources==5.4.0
iniconfig==1.1.1
mccabe==0.7.0
numpy==1.19.5
packaging==21.3
pluggy==1.0.0
promise==2.3
prompt-toolkit==3.0.36
protobuf==3.19.6
py==1.11.0
pycodestyle==2.9.1
pyflakes==2.5.0
pyparsing==3.1.4
pytest==7.0.1
pytest-catchlog==1.2.2
pytest-cov==4.0.0
pytest-flake8==1.1.1
requests==2.27.1
six==1.17.0
tensorflow-datasets==4.5.2
tensorflow-metadata==1.2.0
termcolor==1.1.0
tomli==1.2.3
tqdm==4.64.1
typeguard==2.13.3
typing_extensions==4.1.1
urllib3==1.26.20
wcwidth==0.2.13
zipp==3.6.0
-e git+https://github.com/larq/zookeeper.git@e4770f13416e160cb5a3fa6122668bf014d567ee#egg=zookeeper

name: zookeeper
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
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - 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=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - absl-py==0.12.0
      - attrs==22.2.0
      - charset-normalizer==2.0.12
      - click==8.0.4
      - coverage==6.2
      - dataclasses==0.8
      - dill==0.3.4
      - flake8==5.0.4
      - googleapis-common-protos==1.56.3
      - idna==3.10
      - importlib-metadata==4.2.0
      - importlib-resources==5.4.0
      - iniconfig==1.1.1
      - mccabe==0.7.0
      - numpy==1.19.5
      - packaging==21.3
      - pluggy==1.0.0
      - promise==2.3
      - prompt-toolkit==3.0.36
      - protobuf==3.19.6
      - py==1.11.0
      - pycodestyle==2.9.1
      - pyflakes==2.5.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-catchlog==1.2.2
      - pytest-cov==4.0.0
      - pytest-flake8==1.1.1
      - requests==2.27.1
      - six==1.17.0
      - tensorflow-datasets==4.5.2
      - tensorflow-metadata==1.2.0
      - termcolor==1.1.0
      - tomli==1.2.3
      - tqdm==4.64.1
      - typeguard==2.13.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - wcwidth==0.2.13
      - zipp==3.6.0
prefix: /opt/conda/envs/zookeeper

zookeeper/core/cli_test.py::test_boolean_flag_syntax
zookeeper/core/cli_test.py::test_command_aliases zookeeper/core/cli_test.py::test_pass_param_values zookeeper/core/cli_test.py::test_param_key_valid_characters zookeeper/core/cli_test.py::test_param_key_invalid_characters zookeeper/core/cli_test.py::test_override_param_values zookeeper/core/cli_test.py::test_override_param_complex_string
zookeeper/core/cli.py zookeeper/core/task.py
zookeeper/core/cli.py zookeeper/core/task.py