localecmd documentation¶
Localecmd is a command-line interpreter like cmd and cmd2, but where command and parameter names can switch into your language.
It uses babel and gettext to translate all relevant strings.
Contents:
- Main page
- Tutorial
- Features
- Contribution
- API documentation
- Changelog
- 0.12.3 (2026-01-11)
- 0.12.2 (2025-12-27)
- 0.12.1 (2025-12-27)
- 0.12.0 (2025-12-27)
- 0.11.5 (2025-12-18)
- 0.11.4 (2025-12-15)
- 0.11.3 (2025-12-14)
- 0.11.2 (2025-12-14)
- 0.11.1 (2025-12-08)
- 0.11.0 (2025-12-08)
- 0.10.0 (2025-11-06)
- 0.9.0 (2025-11-05)
- 0.8.0 (2025-11-03)
- 0.7.0 (2025-10-30)
- 0.6.3 (2025-10-28)
- 0.6.2 (2025-04-09)
- 0.6.1 (2025-04-05)
- 0.6.0 (2025-03-28)
- 0.5.0 (2025-03-26)
- 0.4.0 (2025-03-22)
- 0.3.0 (2025-03-09)
- 0.2.0 (2025-03-06)
Quickstart¶
Create virtual development environment and install package.
python3 -m venv testing-localecmd
pip install localecmd
Then in python interpreter
>>> from localecmd import programfunction, start_cli
>>> from localecmd.module import Module
>>> @programfunction()
... def hello_world():
... print("Hello, world!")
...
>>> functions = Module('functions', [hello_world])
>>> cli = start_cli([functions])
The language of the command line is fallback language
>>> cli.runcmd("help")
...
This will show a list of all available function, including `hello_world`.
>>> cli.runcmd("hello_world")
Hello, world!
>>> cli.close()