Skip to main content

A command line interface for creating your own command line interface

Project description

Autocleus

A demi god amongst CLIs: A CLI for creating your own CLIs in Python Easily. Autocleus provides the core engine for your CLI, allowing you to focus on building out the functionality of your CLI without the concern of actually building a CLI. When you finished developing your CLI, you can then package it up using Autocleus. Let Autocleus be of service to you.

Quickstart

You can install the most recent version of autocleus from the PyPi repository:

pip3 install autocleus

Autocleus requirements:

  • Pydantic==1.7.3
  • typing==3.7.4.3
  • PyInquirer==1.0.3
  • virtualenv==20.4.4
  • art==5.1
  • jinja2==2.10.1
  • setuptools==45.2.0
  • pip==20.0.2
  • asciimatics==1.12.0
  • yaspin==1.5.0
  • yamldirs==1.1.8

Also need to install python3-venv (Ubuntu, apt-get install -y python3-venv)

Please note that this is still under development and has not been properly unit tested.

Once you've installed autocleus, the CLI will be accessible from your environment. Currently there is only 1 subcommand generate with two options:

  1. --custom_cli: Will launch the interactive form for starting an autocleus CLI project, which is contained within a virtual environment.
  2. --concretized_cli: Will launch the interactive form to package an autocleus CLI project into an installable .whl file and a .tar archive (if desired). This will also produce a CLI spec, which is an sqlite database that stores all information about your package, including all of the building blocks of your package. This is meant to be used in an upcoming feature to allow any number of autocleus CLI projects to be combined into a single "master" CLI.

Here we will go through the two options for the generate subcommand.

  1. autocleus generate --custom_cli

autocleus custom_cli demo Questions

  • Tasks: Use space bar or click to select what tasks you would like performed. While all are suggested, only those required are selected by default.
  1. autocleus generate --concretized_cli
    work in progress

autocleus concretized_cli demo

Questions

  • Tasks: Use space bar or click to select what tasks you would like performed. While all are suggested, only those required are selected by default.

Developing a CLI with Autocleus

TODOs

  • Finish README
  • The main parser help function does not work (i.e --help-all or --help)
  • Add feature to output responses to interactive form to YAML and allow autocleus to auto-detect such YAMLs or allow build from such YAMLs (i.e non-interactive mode).
  • Way to many redundant (lazy) imports across package - needs to be cleaned up.
  • More error catching needs to be added in many places (when creating files, directories, etc...).
  • Write real unit tests and setup GitHub actions for CI/CD - current codes in 'tests' directory are just me trying to get things to work :)

Known Issues

Autocleus depends on python-virtualenv library: On Unbuntu 20.04 sometimes it is required that you remove and re-install this.

sudo apt-get remove python3-venv
sudo apt-get install -y python3-venv

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autocleus-0.1.1.tar.gz (25.9 kB view hashes)

Uploaded Source

Built Distribution

autocleus-0.1.1-py3-none-any.whl (37.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page