Skip to main content

Portainer CLI

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.

Install

pip install [--user] portainer-cli

Usage

Global flags

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 command

Configure Portainer HTTP service base url.

portainer-cli configure base_url

E.g:

portainer-cli configure http://10.0.0.1:9000/

login command

Identify yourself and take action.

portainer-cli login username password

E.g:

portainer-cli login douglas d1234

update_stack command

Update stack.

portainer-cli update_stack id endpoint_id [stack_file]

E.g:

portainer-cli update_stack 2 1 docker-compose.yml

Environment variables arguments

portainer-cli update_stack id endpoint_id [stack_file] --env.var=value

Where var is the environment variable name and value is the environment variable value.

Flags

Flag Description
-p or --prune Prune services
-c or --clear-env Clear all environment variables

update_registry command

Update registry.

portainer-cli update_registry id [-name] [-url]

E.g:

portainer-cli update_registry 1 -name="Some registry" -url="some.url.com/r"

Authentication

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=d1234

request command

Make a request.

portainer-cli request path [method=GET] [data]

E.g:

portainer-cli request status

Flags

Flag Description
-p or --printc Print response content in stdout.

Development

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.

Metadata

Release files for portainer-cli 0.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for portainer-cli 0.2.2
File Size Uploaded
portainer-cli-0.2.2.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for portainer-cli 0.2.2
File Interpreter ABI Platform
portainer_cli-0.2.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 10.1 kB

Release files / portainer-cli-0.2.2.tar.gz

Download URL portainer-cli-0.2.2.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c46516468006d4c5f906623ed8512492c57271153bd0097d2709c99c2fb98979
BLAKE2b-256 checksum
How to use checksums
ea94e43a832c4704c3f48b50acadc08eae9923ebfd0a9a3e77c4454f71f2ae88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.7

Release files / portainer_cli-0.2.2-py2.py3-none-any.whl

Download URL portainer_cli-0.2.2-py2.py3-none-any.whl
Size 5.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
762cfdb8d455205017b654ba2013a77bb3c542a5f33fbc772b8f4a2bf301d385
BLAKE2b-256 checksum
How to use checksums
00e2b00a14aa9706daac9fb914ff94713042bad6c81e18042003f8b7dc79a8cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.27.0 CPython/3.6.7

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page