diff --git a/goodtables/cli.py b/goodtables/cli.py
index 6661cc8..186d227 100644
--- a/goodtables/cli.py
+++ b/goodtables/cli.py
@@ -4,6 +4,8 @@ from __future__ import print_function
 from __future__ import absolute_import
 from __future__ import unicode_literals
 
+from sys import exit
+
 import click
 import goodtables
 import json as json_module
@@ -113,7 +115,7 @@ def validate(paths, json, **options):
     if not quiet:
         _print_report(report, output=output, json=json)
 
-    exit(not report['valid'])
+    exit(int(not report['valid']))
 
 
 @cli.command()
@@ -137,7 +139,7 @@ def init(paths, output, **kwargs):
         file=output
     )
 
-    exit(dp.valid)  # Just to be defensive, as it should always be valid.
+    exit(int(not dp.valid))  # Just to be defensive, as it should always be valid.
 
 
 # Internal

Goodtable init command should return 0 on success
It should also use sys.exit() instead of exit()
diff --git a/tests/test_cli.py b/tests/test_cli.py
index 3cfa96a..024a41e 100644
--- a/tests/test_cli.py
+++ b/tests/test_cli.py
@@ -50,7 +50,7 @@ def test_cli_init():
 
     result = CliRunner().invoke(init, [resource_path])
 
-    assert result.exit_code
+    assert result.exit_code == 0
 
     dp = datapackage.Package(json.loads(result.output), strict=True)
     resource = dp.resources[0]

pip install --upgrade -e .[develop,ods]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-mock coverage jsonschema
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==22.2.0
boto3==1.23.10
botocore==1.26.10
cached-property==1.5.2
certifi==2021.5.30
chardet==5.0.0
charset-normalizer==2.0.12
click==8.0.4
click-default-group==1.2.4
coverage==6.2
dataflows-tabulator==1.54.3
datapackage==1.15.4
distlib==0.3.9
docutils==0.18.1
et-xmlfile==1.1.0
ezodf==0.3.2
filelock==3.4.1
-e git+https://github.com/frictionlessdata/goodtables-py.git@58bbf9f3d70a98317c1f2a71cd0f0559a367c3de#egg=goodtables
greenlet==2.0.2
idna==3.10
ijson==3.3.0
importlib-metadata==4.8.3
importlib-resources==5.4.0
iniconfig==1.1.1
isodate==0.6.1
jmespath==0.10.0
jsonlines==3.1.0
jsonpointer==2.3
jsonschema==3.2.0
linear-tsv==1.1.0
lxml==5.3.1
mccabe==0.7.0
mock==5.2.0
openpyxl==3.1.3
packaging==21.3
platformdirs==2.4.0
pluggy==1.0.0
py==1.11.0
pycodestyle==2.10.0
pydocstyle==6.3.0
pyflakes==3.0.1
pylama==7.7.1
pyparsing==3.1.4
pyrsistent==0.18.0
pytest==7.0.1
pytest-cov==4.0.0
pytest-mock==3.6.1
python-dateutil==2.9.0.post0
PyYAML==6.0.1
requests==2.27.1
rfc3986==1.5.0
s3transfer==0.5.2
simpleeval==0.9.13
six==1.17.0
snowballstemmer==2.2.0
SQLAlchemy==1.4.54
statistics==1.0.3.5
tableschema==1.21.0
tabulator==1.53.5
toml==0.10.2
tomli==1.2.3
tox==3.28.0
typing_extensions==4.1.1
unicodecsv==0.14.1
urllib3==1.26.20
virtualenv==20.17.1
xlrd==2.0.1
zipp==3.6.0

name: goodtables-py
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:
      - attrs==22.2.0
      - boto3==1.23.10
      - botocore==1.26.10
      - cached-property==1.5.2
      - chardet==5.0.0
      - charset-normalizer==2.0.12
      - click==8.0.4
      - click-default-group==1.2.4
      - coverage==6.2
      - dataflows-tabulator==1.54.3
      - datapackage==1.15.4
      - distlib==0.3.9
      - docutils==0.18.1
      - et-xmlfile==1.1.0
      - ezodf==0.3.2
      - filelock==3.4.1
      - greenlet==2.0.2
      - idna==3.10
      - ijson==3.3.0
      - importlib-metadata==4.8.3
      - importlib-resources==5.4.0
      - iniconfig==1.1.1
      - isodate==0.6.1
      - jmespath==0.10.0
      - jsonlines==3.1.0
      - jsonpointer==2.3
      - jsonschema==3.2.0
      - linear-tsv==1.1.0
      - lxml==5.3.1
      - mccabe==0.7.0
      - mock==5.2.0
      - openpyxl==3.1.3
      - packaging==21.3
      - platformdirs==2.4.0
      - pluggy==1.0.0
      - py==1.11.0
      - pycodestyle==2.10.0
      - pydocstyle==6.3.0
      - pyflakes==3.0.1
      - pylama==7.7.1
      - pyparsing==3.1.4
      - pyrsistent==0.18.0
      - pytest==7.0.1
      - pytest-cov==4.0.0
      - pytest-mock==3.6.1
      - python-dateutil==2.9.0.post0
      - pyyaml==6.0.1
      - requests==2.27.1
      - rfc3986==1.5.0
      - s3transfer==0.5.2
      - simpleeval==0.9.13
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sqlalchemy==1.4.54
      - statistics==1.0.3.5
      - tableschema==1.21.0
      - tabulator==1.53.5
      - toml==0.10.2
      - tomli==1.2.3
      - tox==3.28.0
      - typing-extensions==4.1.1
      - unicodecsv==0.14.1
      - urllib3==1.26.20
      - virtualenv==20.17.1
      - xlrd==2.0.1
      - zipp==3.6.0
prefix: /opt/conda/envs/goodtables-py

tests/test_cli.py::test_cli_init
tests/test_cli.py::test_cli_version tests/test_cli.py::test_cli_infer_schema_enables_infer_fields tests/test_cli.py::test_cli_accepts_multiple_sources tests/test_cli.py::test_cli_adds_schema_to_nested_sources
goodtables/cli.py
goodtables/cli.py