Powered by Ilhasoft's Web Team.
Portainer CLI is a Python software to use in command line. Use this command line interface to easy communicate with your Portainer application, like in a continuous integration and continuous deployment environments.
pip install [--user] portainer-cli
| Flag | Description |
|---|---|
-l or --local |
Save and load configuration file (.portainer-cli.json) in current directory. |
-d or --debug |
Enable DEBUG messages in stdout |
Configure Portainer HTTP service base url.
portainer-cli configure base_urlE.g:
portainer-cli configure http://10.0.0.1:9000/Identify yourself and take action.
portainer-cli login username passwordE.g:
portainer-cli login douglas d1234Update stack.
portainer-cli update_stack id endpoint_id [stack_file] [-env-file]E.g:
portainer-cli update_stack 2 1 docker-compose.ymlportainer-cli update_stack id endpoint_id [stack_file] --env.var=valueWhere var is the environment variable name and value is the environment variable value.
| Flag | Description |
|---|---|
-env-file |
Pass env file path, usually .env |
-p or --prune |
Prune services |
-c or --clear-env |
Clear all environment variables |
Update registry.
portainer-cli update_registry id [-name] [-url]E.g:
portainer-cli update_registry 1 -name="Some registry" -url="some.url.com/r"You can use authentication passing -a or --authentication flag, but you must pass the -username and -password options.
portainer-cli update_registry 1 -a -username=douglas -password=d1234Make a request.
portainer-cli request path [method=GET] [data]E.g:
portainer-cli request status| Flag | Description |
|---|---|
-p or --printc |
Print response content in stdout. |
This project use Pipenv to manager Python packages.
With Pipenv installed, run make install to install all development packages dependencies.
Run make lint to run flake8 following PEP8 rules.
Run make or make sdist to create/update dist directory.