diff --git a/hlp/cli.py b/hlp/cli.py
index c3d2476..33ff11c 100644
--- a/hlp/cli.py
+++ b/hlp/cli.py
@@ -6,7 +6,7 @@ import shlex
 import sys
 from textwrap import dedent
 
-from .compat import iter_modules
+from .compat import builtins, iter_modules
 from .typing import MYPY_RUNNING
 from .util import getattr_recursive, sequences
 
@@ -23,7 +23,9 @@ class NamedObject(object):
     def get_attr(self, name):
         # type: (str) -> NamedObject
         obj = getattr(self.obj, name)
-        return NamedObject("{}.{}".format(self.name, name), obj)
+        if self.name:
+            name = "{}.{}".format(self.name, name)
+        return NamedObject(name, obj)
 
 
 def import_module(spec):
@@ -167,7 +169,9 @@ def autocomplete(current):
             return [context.name]
         options = children_autocomplete_names(context)
     else:
-        options = package_autocomplete_names()
+        options = list(package_autocomplete_names())
+        # Include builtins
+        options.extend(name for name in dir(builtins) if not name.startswith("__"))
 
     return sorted(m for m in options if m.startswith(current))
 
diff --git a/hlp/compat.py b/hlp/compat.py
index 4d0e3b0..f8d0175 100644
--- a/hlp/compat.py
+++ b/hlp/compat.py
@@ -9,6 +9,11 @@ if MYPY_RUNNING:
 
 PY2 = sys.version_info < (3,)
 
+if PY2:
+    import __builtin__ as builtins  # type: ignore
+else:
+    import builtins as builtins  # type: ignore
+
 
 if PY2:
 

Autocomplete builtin names
Currently if autocompleting a prompt like

```
hlp |
```

we only look at top-level packages and modules. We should also be including names of builtins.
diff --git a/tests/test_autocomplete.py b/tests/test_autocomplete.py
index 8cadcc3..7e53f9f 100644
--- a/tests/test_autocomplete.py
+++ b/tests/test_autocomplete.py
@@ -65,7 +65,15 @@ def test_autocomplete_bash_empty(fake_packages, monkeypatch):
     monkeypatch.setenv("COMP_WORDS", "hlp")
     monkeypatch.setenv("COMP_CWORD", "1")
     result = autocomplete_bash()
+    # Builtins
+    assert "open" in result
+    assert "ord" in result
+    # Standard library modules
+    assert "string" in result
+    assert "multiprocessing" in result
+    # Our packages
     assert "pkg_aaa" in result
+    # Only name, no trailing '.'
     assert "pkg_aaa." not in result
 
 

pip install -e .
parse_log_pytest
pytest
pytest pre-commit
3.9
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
cfgv==3.4.0
distlib==0.3.9
exceptiongroup @ file:///croot/exceptiongroup_1706031385326/work
filelock==3.18.0
-e git+https://github.com/chrahunt/hlp.git@b9d32dd1b2e80733582df93363ac5443837dd993#egg=hlp
identify==2.6.9
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
nodeenv==1.9.1
packaging @ file:///croot/packaging_1734472117206/work
platformdirs==4.3.7
pluggy @ file:///croot/pluggy_1733169602837/work
pre_commit==4.2.0
pytest @ file:///croot/pytest_1738938843180/work
PyYAML==6.0.2
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work
virtualenv==20.29.3

name: hlp
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:
      - cfgv==3.4.0
      - distlib==0.3.9
      - filelock==3.18.0
      - hlp==0.1.0
      - identify==2.6.9
      - nodeenv==1.9.1
      - platformdirs==4.3.7
      - pre-commit==4.2.0
      - pyyaml==6.0.2
      - virtualenv==20.29.3
prefix: /opt/conda/envs/hlp

tests/test_autocomplete.py::test_autocomplete_bash_empty
tests/test_autocomplete.py::test_autocomplete_basics[pkg_aa-expected0] tests/test_autocomplete.py::test_autocomplete_basics[pkg_aaa-expected1] tests/test_autocomplete.py::test_autocomplete_basics[pkg_aaa.-expected2] tests/test_autocomplete.py::test_autocomplete_basics[pkg_aaa.m-expected3] tests/test_autocomplete.py::test_autocomplete_basics[pkg_aaa.mod_a.-expected4] tests/test_autocomplete.py::test_autocomplete_basics[pkg_aaa.mod_a.Test-expected5] tests/test_autocomplete.py::test_autocomplete_basics[pkg_aaa.mod_a.Test.-expected6] tests/test_autocomplete.py::test_autocomplete_bash[words0-1-expected0] tests/test_autocomplete.py::test_autocomplete_bash[words1-1-expected1] tests/test_autocomplete.py::test_autocomplete_bash[words2-2-expected2] tests/test_autocomplete.py::test_autocomplete_bash[words3-2-expected3]
hlp/cli.py hlp/compat.py
hlp/cli.py hlp/compat.py