Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
duaraghav8 committed Oct 21, 2019
1 parent d12565a commit 17f9d51
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
57 changes: 56 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,57 @@
# okta-admin
A minimal CLI to perform administrative tasks in Okta
This is a Commandline application to perform administrative tasks in [Okta](https://www.okta.com).

It does not allow you to make requests to arbitrary endpoints of the Okta API. Rather, it is designed to speed up frequently performed administrative tasks like creating users, adding them to groups, listing resources and so forth.

## Usage
Download the pre-compiled binary for your platform from the [Releases](https://github.com/duaraghav8/okta-admin/releases) page or compile the code for your platform using `make build`.

Use `-help` to display the list of commands available and to get information about specific commands.

### Examples
1. Create a new user in your Okta Organization
```bash
okta-admin create-user \
-org-url https://hogwarts.okta.co.uk \
-api-token xxxxx \
-email [email protected] \
-fname Harry -lname Potter \
-team Seekers
```
The above command creates a new user in an organization and assigns them a Team. It also highlights how you can specify the organization URL and Okta API Token via commandline arguments, although **this is not the recommended way to supply credentials**.

2. Add a member to groups in the organization
```bash
export OKTA_ORG_URL="https://hogwarts.okta.com/"
export OKTA_API_TOKEN="xxxxx"

okta-admin assign-groups -email [email protected] -groups TheOrder

okta-admin assign-groups \
-email [email protected] \
-groups "Slytherin, pure-blood, rich_kids"

okta-admin assign-groups \
-email [email protected] \
-groups hogwarts-alumni,MinistryOfMagic
```
These commands demonstrate the different ways in which you can specify `groups` to assign to a member. Any option capable of accepting multiple values can be given a comma-separated list of them. Notice how the organization credentials this time are passed via environment variables. This is the recommended way to work with Okta Admin, especially when running the tool in automation.

3. List Groups present in the organization
```bash
source ~/.okta/creds.env

# List names of all groups
okta-admin list-groups

# Get info about select groups
okta-admin list-groups -groups azkaban,durmstrang -detailed
```

## Developing
After cloning this repository, run `make bootstrap` to download tools necessary for developing. This project uses [Go Modules](https://blog.golang.org/using-go-modules) for dependency management.

Use `make test` to run tests and `make fmt` to run `gofmt` over the codebase. Finally, run `make build` to build binaries for distribution.

## License
This code is licensed under the MPLv2 license.
2 changes: 1 addition & 1 deletion command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ type Metadata struct {

// Command contains objects passed to all CLI commands
type Command struct {
oktaClient *okta.Client
Meta *Metadata
Logger *log.Logger
oktaClient *okta.Client
}

// OktaClient returns an instance of Okta Client initialized
Expand Down

0 comments on commit 17f9d51

Please sign in to comment.