Package: jccli
jccliA command line client used to administrate the hostedJumpcloudidentity provider service.Getting StartedInstallpipinstallgit+https://github.com/Sage-Bionetworks/jccliUsageUsage:jccli[OPTIONS]COMMAND[ARGS]...Runjccli

Options:-k,--keyTEXTJumpCloudAPIkey(canalsobesetinconfigfileoruseenvironmentalvariable:JC_API_KEY)-p,--profileTEXTAuserprofile,asspecifiedintheconfigfile[default:DEFAULT]-v,--verbosityLVLEitherCRITICAL,ERROR,WARNING,INFOorDEBUG--versionShowtheversionandexit.--helpShowthismessageandexit.

Commands:groupCommandsetforgroupssyncSyncJumpcloudwithadatafileuserCommandsetforusers>jccli--keyXXXXXXXXXX61d2userget--usernamejsmith{"id":"9ba6cc40d82ee45d5f73da2e","account_locked":false,"activated":true,"firstname":"Joe","job_title":"","lastname":"Smith",....}ConfigurationJCCLI will look for an optional configuration file named.jccli.iniin the user's home directory. SeePython's
configparserfor formatting specification. In short,field = "value"pairs go under[profile]headers (replacingprofilewith the desired name of the profile), which can be
switched between using the--profileoption. Currently, the only field that can be set is thekeyfield, which can
be set to a JCCLI API key. Help text for optional arguments indicates whether they can be set in a user's config file.
If the user does not specify a--profileit will default to[DEFAULT].For example:[DEFAULT]key=YOUR-KEY-HERE[alt-account]key=YOUR-OTHER-KEY-HEREA user who has the above content in their~/.jccli.iniconfig file can use jccli with the keyYOUR-KEY-HEREif they
don't specify a--profile; they can use the API keyYOUR-OTHER-KEY-HEREif they specify--profile alt-account; or
they can use neither and pick a third key by using--key YET-ANOTHER-KEY-HERE(regardless of whether--profileis
specified).Settings precedenceJCCLI will look for settings (including API key, etc.) with the following order of precedence:Optional argumentsEnvironmental variablesSelected profile in config fileDEFAULTprofile in config fileContributionsContributions are welcome.RequirementsInstall these utilities:GNU Makepre-commitPandocProcessBefore making a commit, you should syntactically validate your code and configurations with pre-commit.You can set up pre-commit hooks to automatically be run before every commit by running:pre-commit install.
Alternatively, you can manually execute the validations by runningpre-commit run --all-files.TestsJCCLI's test suite consists of unit tests and integration tests. The integration tests are designed to run on an actual
clean JumpCloud instance (see docstrings undersetup_class()methods inintegration_tests/test_*.pyfor details).
You can provide a key either by setting the environmental variableJC_API_KEY, or by setting thekeyfield under the
section[jccli-dev-testing]in your~/.jccli.iniconfiguration file (SeeConfigurationfor
details). You will also need to set theJC_CONNECT_KEYenvironment variable when running the integration test suite.
This is the key used to allow systems to register with your JumpCloud instance, and can be found by navigating to the
"devices" tab in theJumpCloud web console, and clicking the "+" button in the
top-right corner.We useTravis-CIto automate our testing. This repo's Travis configuration is set up to run
the unit test suite (inunit_tests/) on every pull request and push, and to run the integration test suite (inintegration_tests/) only on a push.DockerCertain integration tests require the use ofDockerto simulate JumpCloud systems. Make sure
thatDocker is installedand that the Docker daemon is running in order to
execute these tests.GitHubContributors are requested to use the following process (in the examples, we'll suppose that a user namedjohn-smithwants to fix some typos in the documentation):Make a fork of JCCLI. E.g.Sage-Bionetworks:jccli→john-smith:jccliMake a branch off ofmasternamed after a feature or issue. E.g.john-smith:jccli/master→john-smith:jccli/fix-typo-in-docsMake commits to that branch (in this example,john-smith:jccli/fix-typo-in-docs). When pushed to GitHub, they
should trigger Travis to run unit tests and integration tests. For the integration tests to pass, contributors need to
make sure that theJC_API_KEYenvironmental variable in their Travis CI environment is set to aJumpcloud API Key—specifically, one corresponding to a "clean" JumpCloud instance
(i.e. it should have no users, groups, etc.).Make a pull request from the feature/issue branch on the fork (e.g.john-smith:jccli/fix-typo-in-docs) toSage-Bionetworks:jccli/master.Wait for maintainers to review code and approve the pull request.Maintainers should use the following process for reviewing and approving outside pull requests:Examine proposed changes on GitHub. Pay special attention to hidden environment variables (as of write time,JC_API_KEY) and make sure nothing in the changes could expose them or use them for unintended purposes.If in doubt,
DO NOT proceed to the next step.Incorporate the changes into a new branch in our repo, e.g. create a branchSage-Bionetworks:jccli/fix-typo-in-docsand manually pull in the changes fromjohn-smith:jccli/fix-typo-in-docs. Make a new tracking remote branch (i.e.git push --set-upstream origin fix-typo-in-docs, or whatever the name of your remote is, instead oforigin) and push to
it in order to trigger a Travis CI build. Make sure that theintegration-testjob ran and passed successfully.Approve/merge the pull request and delete the feature branch made for testing purposes
(Sage-Bionetworks:jccli/fix-types-in-docs, in the example).VersioningWe try to followsemantic versioningas much as possble.
We usebump2versionto help automate
versioning of this project.To manually bump the version:bumpversion patch --config-file setup.cfgReleasingWe have setup our CI to automate a release of this app.  To kick off the process just create
a tag (i.e v1.0.0) and push to the repo.  It is important to have thevin the tag and
the tag must be the same number as the current version.  Our CI will do the work of publishing
the app to pypi and then bumping to the next version for development.ResourcesBelow are some handy resource links.Project DocumentationClickis a Python package for creating beautiful command line interfaces in a composable way with as little code as necessary.Sphinxis a tool that makes it easy to create intelligent and beautiful documentation, written by Geog Brandl and licnsed under the BSD license.pytesthelps you write better programs.GNU Makeis a tool which controls the generation of executables and other non-source files of a program from the program's source files.