coveralls: 
[![Coverage Status](https://coveralls.io/builds/8905620/badge)](https://coveralls.io/builds/8905620)

Coverage decreased (-1.4%) to 77.193% when pulling **c8444f7b1c104cf771d66488efd7a4ad611a9666 on indent** into **ed76ad8ae8f2b189c7dcfbdb2c3ec3668f403b35 on master**.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/8905634/badge)](https://coveralls.io/builds/8905634)

Coverage decreased (-1.4%) to 77.193% when pulling **e02710dccdf7aee7e46e993f8ac37a1583576544 on indent** into **ed76ad8ae8f2b189c7dcfbdb2c3ec3668f403b35 on master**.

coveralls: 
[![Coverage Status](https://coveralls.io/builds/8905634/badge)](https://coveralls.io/builds/8905634)

Coverage decreased (-1.4%) to 77.193% when pulling **e02710dccdf7aee7e46e993f8ac37a1583576544 on indent** into **ed76ad8ae8f2b189c7dcfbdb2c3ec3668f403b35 on master**.

diff --git a/README.rst b/README.rst
index a30b8d5..3308e34 100644
--- a/README.rst
+++ b/README.rst
@@ -58,7 +58,10 @@ Example
 ::
 
     % echo '{"name": "Taro", "age": 10}' | jqp '[j["name"], j["age"]]'
-    ["Taro", 10]
+    [
+        "Taro",
+        10
+    ]
 
 
 License
diff --git a/jqp/__init__.py b/jqp/__init__.py
index 6d3ed17..038953f 100644
--- a/jqp/__init__.py
+++ b/jqp/__init__.py
@@ -21,7 +21,7 @@ def _exit(error, return_code, message):
 
 
 def run(in_io, out_io, cmd, imports=[], sort_keys=False, raw_input_mode=False,
-        raw_output=False, join_output=False, ascii_output=True):
+        raw_output=False, join_output=False, ascii_output=True, indent=None):
     environment = {}
     for mod_name in imports:
         try:
@@ -55,7 +55,7 @@ def run(in_io, out_io, cmd, imports=[], sort_keys=False, raw_input_mode=False,
             try:
                 json.dump(
                     out, out_io, ensure_ascii=ascii_output,
-                    sort_keys=sort_keys)
+                    sort_keys=sort_keys, indent=indent)
             except Exception as e:
                 _exit(e, 3, 'Cannot dump result: line %d' % line_no)
 
@@ -72,6 +72,9 @@ def main():
     parser.add_argument(
         '--import', action='append', default=[],
         help='modules to import')
+    parser.add_argument(
+        '--indent', type=int, default=4,
+        help='use the given number of indent')
     parser.add_argument(
         '--sort-keys', '-S', action='store_true',
         help='sort keys in objects when the command print it')
@@ -93,4 +96,4 @@ def main():
     run(sys.stdin, sys.stdout, args.cmd, imports=getattr(args, 'import'),
         sort_keys=args.sort_keys, raw_input_mode=args.raw_input,
         raw_output=args.raw_output, join_output=args.join_output,
-        ascii_output=args.ascii_output)
+        ascii_output=args.ascii_output, indent=args.indent)

Formatted output
Currently jqp print json in one line. Formatted output is preferable.
diff --git a/tests/run_test.py b/tests/run_test.py
index 50613ce..1f38058 100644
--- a/tests/run_test.py
+++ b/tests/run_test.py
@@ -61,6 +61,13 @@ class RunTest(unittest.TestCase):
         jqp.run(inputs, outputs, u'"\u3042"', ascii_output=True)
         self.assertEqual(outputs.getvalue(), '"\\u3042"\n')
 
+    def test_indent(self):
+        inputs = StringIO('''[1]
+''')
+        outputs = StringIO()
+        jqp.run(inputs, outputs, 'j', indent=4)
+        self.assertEqual(outputs.getvalue(), '[\n    1\n]\n')
+
     def test_parse_error(self):
         inputs = StringIO('invalid\n')
         outputs = StringIO()

pip install -e .
parse_log_pytest
pytest
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio pytest
apt-get update apt-get install -y gcc
3.9
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
coverage==7.8.0
exceptiongroup @ file:///croot/exceptiongroup_1706031385326/work
execnet==2.1.1
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
-e git+https://github.com/unnonouno/jqp.git@ed76ad8ae8f2b189c7dcfbdb2c3ec3668f403b35#egg=jqp
packaging @ file:///croot/packaging_1734472117206/work
pluggy @ file:///croot/pluggy_1733169602837/work
pytest @ file:///croot/pytest_1738938843180/work
pytest-asyncio==0.26.0
pytest-cov==6.0.0
pytest-mock==3.14.0
pytest-xdist==3.6.1
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work
typing_extensions==4.13.0

name: jqp
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
  - exceptiongroup=1.2.0=py39h06a4308_0
  - iniconfig=1.1.1=pyhd3eb1b0_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
  - packaging=24.2=py39h06a4308_0
  - pip=25.0=py39h06a4308_0
  - pluggy=1.5.0=py39h06a4308_0
  - pytest=8.3.4=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
  - tomli=2.0.1=py39h06a4308_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - coverage==7.8.0
      - execnet==2.1.1
      - pytest-asyncio==0.26.0
      - pytest-cov==6.0.0
      - pytest-mock==3.14.0
      - pytest-xdist==3.6.1
      - typing-extensions==4.13.0
prefix: /opt/conda/envs/jqp

tests/run_test.py::RunTest::test_indent
tests/run_test.py::RunTest::test1 tests/run_test.py::RunTest::test_ascii tests/run_test.py::RunTest::test_dump_error tests/run_test.py::RunTest::test_execution_error tests/run_test.py::RunTest::test_import tests/run_test.py::RunTest::test_import_error tests/run_test.py::RunTest::test_join_output tests/run_test.py::RunTest::test_parse_error tests/run_test.py::RunTest::test_raw_input tests/run_test.py::RunTest::test_raw_output tests/run_test.py::RunTest::test_sort_keys
README.rst jqp/__init__.py
README.rst jqp/__init__.py