-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Labels
guidanceQuestion that needs advice or information.Question that needs advice or information.pr:work-in-progressThis PR is a draft and needs further work.This PR is a draft and needs further work.
Description
I've done code spelunking and found interesting ideas in:
Lines 25 to 27 in c0d866a
:type plugin_mapping: dict | |
:param plugin_mapping: A dict of plugin name to import path, | |
e.g. ``{"plugingName": "package.modulefoo"}``. |
aws-cli/awscli/customizations/s3/s3.py
Lines 23 to 26 in 5ce60be
This function is require to use the plugin. It calls the functions | |
required to add all neccessary commands and parameters to the CLI. | |
This function is necessary to install the plugin using a configuration | |
file |
aws-cli/awscli/customizations/commands.py
Lines 47 to 49 in 37aac25
# This is the name of your command, so if you want to | |
# create an 'aws mycommand ...' command, the NAME would be | |
# 'mycommand' |
and finally
Line 55 in c0d866a
load_plugins(session.full_config.get('plugins', {}), |
which lead me to try:
$ aws configure set plugins '{"mycommand": "awsplugins.mycommand"}'
$ cat ~/.aws/config
[default]
region = us-east-1
output = json
plugins = {"mycommand": "awsplugins.mycommand"}
$ aws help | grep mycommand
$ aws mycommand
usage: aws [options] <command> <subcommand> [parameters]
aws: error: argument command: Invalid choice, valid choices are:
autoscaling | cloudformation
cloudfront | cloudhsm
cloudsearch | cloudsearchdomain
cloudtrail | cloudwatch
cognito-identity | cognito-sync
datapipeline | directconnect
dynamodb | ec2
ecs | elasticache
elasticbeanstalk | elastictranscoder
elb | emr
glacier | iam
importexport | kinesis
kms | lambda
logs | opsworks
rds | redshift
route53 | route53domains
sdb | ses
sns | sqs
ssm | storagegateway
sts | support
swf | s3api
s3 | configure
deploy | configservice
help
Are there any examples of a working aws-cli plugin external to the aws-cli package? Is it supposed to be possible?
nitrocode, anishpatel and justinmk3
Metadata
Metadata
Assignees
Labels
guidanceQuestion that needs advice or information.Question that needs advice or information.pr:work-in-progressThis PR is a draft and needs further work.This PR is a draft and needs further work.