okta-cli


Nameokta-cli JSON
Version 18.1.2 PyPI version JSON
download
home_page
SummaryAn Okta command line interface for scripting and quickly performing routine tasks
upload_time2024-01-16 23:48:49
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT License
keywords okta cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Okta-CLI

**NOW WITH HOMEBREW TAP ON A MAC - SEE "INSTALLATION" BELOW :))**

This is a python-based CLI tool for Okta.
**It is not made or maintained by or in any way affiliated with anyone working at Okta.**
It is mainly driven by the personal needs of its author, although the feature set is becoming quite complete now.

It basically is a CLI wrapper around the [Okta REST API](https://developer.okta.com/docs/reference/).

**NOTE:** This is _not_ the same as Okta's own [`okta`](https://cli.okta.com/) CLI interface.
The latter is apparently used for setting up the source for development projects.

## Requirements

- A Mac or Linux machine, it _might_ work on Windows (untested)
- Python 3.7+, for the change log see [CHANGES.rst](CHANGES.rst).
- unfortunately **Python 3.11 is not _yet_ supported** due to a dependency.

## Installation

### Mac & homebrew

```bash
brew tap flypenguin/okta-cli
brew install okta-cli
```

### All others

- create a python virtualenv: `mkvirtualenv okta-cli`
- `pip install okta-cli`
- start using it: `okta-cli config new`

## Quickstart

Every more complex function should have help texts available: `okta-cli users add -h`, or
maybe `okta-cli users update -h` or maybe `okta-cli apps add -h` ... those are probably the
most interesting ones.

```bash
$ pip install okta-cli                                # install :)

$ okta-cli config new \                               # create a new okta profile
           -n my-profile -\
           -u https://my.okta.url \
           -t API_TOKEN

$ okta-cli -h                                         # get help

$ okta-cli apps -h                                    # get help
$ okta-cli apps adduser \                             # assign an app to a user
           -a my_app_name -u 0109121 \
           -f profile.employeeId

$ okta-cli users -h                                   # get help
$ okta-cli users list --csv                           # list all users as csv
$ okta-cli users list \                               # search users with a query
           -f 'profile.email eq "my@email.com"'
$ okta-cli users update id012345678 \                 # update a field of a user record
           --set profile.email=my@other.email.com
$ okta cli users groups adduser \                     # add a user to a group
$ okta-cli users get my-login -vvvvv                  # see http debug output
$ okta-cli users bulk-add add-list.csv                # Bulk-ADD users
$ okta-cli users bulk-update update-list.xlsx         # Bulk-UPDATE users

$ okta-cli features -h                                # get help
$ okta-cli features list                              # list okta server-side features
$ okta-cli features enable "Recent Activity"          # enable an Okta feature
           -g app1_rollout \
           -u fred.flintstone@flintstones.com

$ okta-cli version                                    # print version and exit
```

## Configuration

Running `config new` (see above) will store a JSON configuration file in the directory determined by the `appdirs` module.

## CSV / Excel file formats

The commands `bulk-add` and `bulk-update` can read from CSV or Excel. Consider this:

**CSV:**

* the first line _MUST_ be a header line (yes, also in Excel).
* for the command `bulk-add` there _MUST_ be a `profile.login` column, and there _MUST NOT_ be an `id` column.
* for the command `bulk-update` there _MUST_ be either a `profile.login` or an `id` column, the latter has preference.
* all other will most probably refer to profile fields, and map to the add/update API call.
  * most probably you will want to have `profile.FIELD` columns (e.g. `profile.firstName`, `profile.zipCode`, ...).
  * you can see the valid standard field names here: https://developer.okta.com/docs/reference/api/schemas/#user-profile-base-subschema.
* all columns which do not contain a "." are _ignored_.

**Excel:**

* There _MUST NOT_ be any formulas.
* Behavior with more than one sheet is undefined.
* Apart from that, be aware of number formatting, which is _most probably_ not respected by `okta-cli`.
* Otherwise, the same restrictions as for csv files apply.

**Remarks:**

* Some fields have value limitations on the Okta side
  * e.g. `profile.preferredLanguage` must be a valid two-letter country code

**Example:**

In this example, the columns "country" and "gender" are ignored – their name does not contain a ".".

```csv
profile.login,profile.firstName,profile.lastName,profile.email,gender,profile.streetAddress,profile.zipCode,profile.city,country,profile.countryCode
ibrabben0@prlog.org,Iosep,Brabben,ibrabben0@prlog.org,Male,7931 Division Point,86983 CEDEX,Futuroscope,France,FR
```

(those fields are not part of Okta's standard field set, and this is an easy way to exclude columns from being used)

### CSV files with only one column

If for any reason you want to create a CSV file with only one column, do it like this:

```csv
profile.login,
my@email.com,
```

Note the trailing comma.

Reasoning: `okta-cli` tries to determine the column separator, and without one ... determination is tricky, and `okta-cli` will shamelessly crash.

## References

This project uses a few nice other projects:

- [Click](https://click.palletsprojects.com)
- [appdirs](https://pypi.org/project/appdirs/)

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "okta-cli",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "okta,cli",
    "author": "",
    "author_email": "Axel Bock <ab@a3b3.de>",
    "download_url": "",
    "platform": null,
    "description": "# Okta-CLI\n\n**NOW WITH HOMEBREW TAP ON A MAC - SEE \"INSTALLATION\" BELOW :))**\n\nThis is a python-based CLI tool for Okta.\n**It is not made or maintained by or in any way affiliated with anyone working at Okta.**\nIt is mainly driven by the personal needs of its author, although the feature set is becoming quite complete now.\n\nIt basically is a CLI wrapper around the [Okta REST API](https://developer.okta.com/docs/reference/).\n\n**NOTE:** This is _not_ the same as Okta's own [`okta`](https://cli.okta.com/) CLI interface.\nThe latter is apparently used for setting up the source for development projects.\n\n## Requirements\n\n- A Mac or Linux machine, it _might_ work on Windows (untested)\n- Python 3.7+, for the change log see [CHANGES.rst](CHANGES.rst).\n- unfortunately **Python 3.11 is not _yet_ supported** due to a dependency.\n\n## Installation\n\n### Mac & homebrew\n\n```bash\nbrew tap flypenguin/okta-cli\nbrew install okta-cli\n```\n\n### All others\n\n- create a python virtualenv: `mkvirtualenv okta-cli`\n- `pip install okta-cli`\n- start using it: `okta-cli config new`\n\n## Quickstart\n\nEvery more complex function should have help texts available: `okta-cli users add -h`, or\nmaybe `okta-cli users update -h` or maybe `okta-cli apps add -h` ... those are probably the\nmost interesting ones.\n\n```bash\n$ pip install okta-cli                                # install :)\n\n$ okta-cli config new \\                               # create a new okta profile\n           -n my-profile -\\\n           -u https://my.okta.url \\\n           -t API_TOKEN\n\n$ okta-cli -h                                         # get help\n\n$ okta-cli apps -h                                    # get help\n$ okta-cli apps adduser \\                             # assign an app to a user\n           -a my_app_name -u 0109121 \\\n           -f profile.employeeId\n\n$ okta-cli users -h                                   # get help\n$ okta-cli users list --csv                           # list all users as csv\n$ okta-cli users list \\                               # search users with a query\n           -f 'profile.email eq \"my@email.com\"'\n$ okta-cli users update id012345678 \\                 # update a field of a user record\n           --set profile.email=my@other.email.com\n$ okta cli users groups adduser \\                     # add a user to a group\n$ okta-cli users get my-login -vvvvv                  # see http debug output\n$ okta-cli users bulk-add add-list.csv                # Bulk-ADD users\n$ okta-cli users bulk-update update-list.xlsx         # Bulk-UPDATE users\n\n$ okta-cli features -h                                # get help\n$ okta-cli features list                              # list okta server-side features\n$ okta-cli features enable \"Recent Activity\"          # enable an Okta feature\n           -g app1_rollout \\\n           -u fred.flintstone@flintstones.com\n\n$ okta-cli version                                    # print version and exit\n```\n\n## Configuration\n\nRunning `config new` (see above) will store a JSON configuration file in the directory determined by the `appdirs` module.\n\n## CSV / Excel file formats\n\nThe commands `bulk-add` and `bulk-update` can read from CSV or Excel. Consider this:\n\n**CSV:**\n\n* the first line _MUST_ be a header line (yes, also in Excel).\n* for the command `bulk-add` there _MUST_ be a `profile.login` column, and there _MUST NOT_ be an `id` column.\n* for the command `bulk-update` there _MUST_ be either a `profile.login` or an `id` column, the latter has preference.\n* all other will most probably refer to profile fields, and map to the add/update API call.\n  * most probably you will want to have `profile.FIELD` columns (e.g. `profile.firstName`, `profile.zipCode`, ...).\n  * you can see the valid standard field names here: https://developer.okta.com/docs/reference/api/schemas/#user-profile-base-subschema.\n* all columns which do not contain a \".\" are _ignored_.\n\n**Excel:**\n\n* There _MUST NOT_ be any formulas.\n* Behavior with more than one sheet is undefined.\n* Apart from that, be aware of number formatting, which is _most probably_ not respected by `okta-cli`.\n* Otherwise, the same restrictions as for csv files apply.\n\n**Remarks:**\n\n* Some fields have value limitations on the Okta side\n  * e.g. `profile.preferredLanguage` must be a valid two-letter country code\n\n**Example:**\n\nIn this example, the columns \"country\" and \"gender\" are ignored \u2013 their name does not contain a \".\".\n\n```csv\nprofile.login,profile.firstName,profile.lastName,profile.email,gender,profile.streetAddress,profile.zipCode,profile.city,country,profile.countryCode\nibrabben0@prlog.org,Iosep,Brabben,ibrabben0@prlog.org,Male,7931 Division Point,86983 CEDEX,Futuroscope,France,FR\n```\n\n(those fields are not part of Okta's standard field set, and this is an easy way to exclude columns from being used)\n\n### CSV files with only one column\n\nIf for any reason you want to create a CSV file with only one column, do it like this:\n\n```csv\nprofile.login,\nmy@email.com,\n```\n\nNote the trailing comma.\n\nReasoning: `okta-cli` tries to determine the column separator, and without one ... determination is tricky, and `okta-cli` will shamelessly crash.\n\n## References\n\nThis project uses a few nice other projects:\n\n- [Click](https://click.palletsprojects.com)\n- [appdirs](https://pypi.org/project/appdirs/)\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "An Okta command line interface for scripting and quickly performing routine tasks",
    "version": "18.1.2",
    "project_urls": {
        "Homepage": "https://github.com/flypenguin/okta-cli",
        "Repository": "https://github.com/flypenguin/okta-cli"
    },
    "split_keywords": [
        "okta",
        "cli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4597fda4830ef7c2a177dd4005735c23b38e869ac583d1f8eea2cfa528757075",
                "md5": "7083c6ddf99407d0625c9a7f3b35201f",
                "sha256": "3debb12ce860dc0168e2fee05b10bdb10a289439591ccceaabf13d9428fca426"
            },
            "downloads": -1,
            "filename": "okta_cli-18.1.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7083c6ddf99407d0625c9a7f3b35201f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 28472,
            "upload_time": "2024-01-16T23:48:49",
            "upload_time_iso_8601": "2024-01-16T23:48:49.508449Z",
            "url": "https://files.pythonhosted.org/packages/45/97/fda4830ef7c2a177dd4005735c23b38e869ac583d1f8eea2cfa528757075/okta_cli-18.1.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-16 23:48:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "flypenguin",
    "github_project": "okta-cli",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "tox": true,
    "lcname": "okta-cli"
}
        
Elapsed time: 0.17226s