CLI Implementation Guide
1.Step: Create inktechs
package
create 'init.py' file. it should be empty,
Now, create __main__.py
file
def main():
print('Hello! from inktechs cli')
if __name__ == '__main__':
main()
2.Step: Then, create setup.py
file and define meta for your CLI
from setuptools import setup
setup(
name='inktechs-cli',
version='0.1.0',
packages=['inktechs'],
author="Md. Sadhan Sarker",
author_email="cse.sadhan@gmail.com",
description="This is an Example Package",
keywords="keyword1 keyword2",
entry_points={
'console_scripts': [
'inktechs = inktechs.__main__:main'
]
})
3.finally create install.sh
file
pip install -e .
4.Now, Run CLI, hit your package name from terminal
inktechs -c ./home/file.conf --o ./home/text.file
Output: like below
Hello! from inktechs cli
Update configuration as following: ./home/file.conf
Generate output as following ./home/text.file
5.If you want to uninstall package, base on your cli package name
pip uninstall inktechs-cli
Top comments (0)