# Announcing the AWX CLI

**URL:** <https://forum.ansible.com/t/announcing-the-awx-cli/31267>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [September 12, 2019, 12:41am UTC](https://forum.ansible.com/t/announcing-the-awx-cli/31267 "2019-09-12T00:41:51Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpetrell](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@rpetrell](https://forum.ansible.com/u/rpetrell)\
**Post date:** [September 12, 2019, 12:41am UTC](https://forum.ansible.com/t/announcing-the-awx-cli/31267/1 "2019-09-12T00:41:51Z")

</div>

Hey everyone,

As part of our recent AWX 7.0.0 release, we’re pleased to announce that we’ve released a new official AWX command line interface.

We recently started an initiative to come up with an official community-supported alternative to the open source [https://github.com/ansible/tower-cli/](https://github.com/ansible/tower-cli/) library some of you may be familiar with.

While tower-cli has served many of you well, it has some technical limitations which have made it cumbersome to maintain and add support to as AWX has grown.

The new AWX CLI in 7.0.0 is intended as a spiritual successor (if you’ve used tower-cli in the past, you’ll find this new interface familiar), and is a tool that we intend to test and maintain as AWX changes.

We’d love for you to try it out - installing it and generating its documentation is relatively simple using the instructions at:

[https://github.com/ansible/awx/tree/devel/awxkit/awxkit/cli/docs](https://github.com/ansible/awx/tree/devel/awxkit/awxkit/cli/docs)

If you have feedback, please share it here, and please file any bugs (or enhancement requests) you discover at the official issue tracker: [https://github.com/ansible/awx/issues/new/](https://github.com/ansible/awx/issues/new/)

Happy Automating!

---

<div class="post-metadata">

**Author:** ![Cedric\_A](https://avatars.discourse-cdn.com/v4/letter/c/8e7dd6/32.png) [@Cedric\_A](https://forum.ansible.com/u/Cedric_A)\
**Post date:** [September 13, 2019, 11:32am UTC](https://forum.ansible.com/t/announcing-the-awx-cli/31267/2 "2019-09-13T11:32:46Z")

</div>

Hello Ryan,

I’m trying to download awxkit for 1.0.6.15 (yes it’s an old version!) but I can’t…

[https://github.com/ansible/awx/archive/1.0.6.15.tar.gz#egg=awxkit&subdirectory=awxkit](https://github.com/ansible/awx/archive/1.0.6.15.tar.gz#egg=awxkit&subdirectory=awxkit)  
ERROR: HTTP error 404 while getting [https://github.com/ansible/awx/archive/1.0.6.15.tar.gz#egg=awxkit&subdirectory=awxkit](https://github.com/ansible/awx/archive/1.0.6.15.tar.gz#egg=awxkit&subdirectory=awxkit)

---

<div class="post-metadata">

**Author:** ![rpetrell](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@rpetrell](https://forum.ansible.com/u/rpetrell)\
**Post date:** [September 13, 2019, 11:37am UTC](https://forum.ansible.com/t/announcing-the-awx-cli/31267/3 "2019-09-13T11:37:32Z")

</div>

Hey Cédric,

The new CLI is available _starting_ in 7.0.0, is you’ll want to download using this link:

[https://github.com/ansible/awx/archive/7.0.0.tar.gz#egg=awxkit&subdirectory=awxkit](https://github.com/ansible/awx/archive/7.0.0.tar.gz#egg=awxkit&subdirectory=awxkit)

---

<div class="post-metadata">

**Author:** ![Cedric\_A](https://avatars.discourse-cdn.com/v4/letter/c/8e7dd6/32.png) [@Cedric\_A](https://forum.ansible.com/u/Cedric_A)\
**Post date:** [September 13, 2019, 11:41am UTC](https://forum.ansible.com/t/announcing-the-awx-cli/31267/4 "2019-09-13T11:41:48Z")

</div>

```auto
ho ok, I misunderstood, I thought that we could adapt it to older versions of AWX.

Thanks :)

```

---

<div class="post-metadata">

**Author:** ![barry\_kelliher1](https://avatars.discourse-cdn.com/v4/letter/b/aeb1de/32.png) [@barry\_kelliher1](https://forum.ansible.com/u/barry_kelliher1)\
**Post date:** [September 13, 2019, 7:19pm UTC](https://forum.ansible.com/t/announcing-the-awx-cli/31267/5 "2019-09-13T19:19:14Z")

</div>

hi my interest is given this announcement, does tower-cli support awx 7 ? and at what point will it be dropped entirely ?

---

<div class="post-metadata">

**Author:** ![Bill\_Nottingham1](https://avatars.discourse-cdn.com/v4/letter/b/58f4c7/32.png) [@Bill\_Nottingham1](https://forum.ansible.com/u/Bill_Nottingham1)\
**Post date:** [September 13, 2019, 8:16pm UTC](https://forum.ansible.com/t/announcing-the-awx-cli/31267/6 "2019-09-13T20:16:18Z")

</div>

barry kelliher (whynotnowtoday@gmail.com) said:

> hi my interest is given this announcement, does tower-cli support awx 7  
> ? and at what point will it be dropped entirely ?

tower-cli supports AWX 7 to the extent that the APIs it uses are the same  
as when features were added to tower-cli; this means for most basic operations  
it should work OK. New functionality in AWX 6 or AWX 7 may not be supported in  
tower-cli, and we do not have plans to add it.

Bill

---

<div class="post-metadata">

**Author:** ![dpowell](https://avatars.discourse-cdn.com/v4/letter/d/e95f7d/32.png) [@dpowell](https://forum.ansible.com/u/dpowell)\
**Post date:** [September 20, 2019, 8:27pm UTC](https://forum.ansible.com/t/announcing-the-awx-cli/31267/7 "2019-09-20T20:27:26Z")

</div>

For docker awx installs do you install this on the awx\_web or awx\_task container. I assume you don’t install it on the server hosting the docker containers.

Thanks

---

<div class="post-metadata">

**Author:** ![Jesse\_Keating1](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@Jesse\_Keating1](https://forum.ansible.com/u/Jesse_Keating1)\
**Post date:** [September 30, 2019, 6:08pm UTC](https://forum.ansible.com/t/announcing-the-awx-cli/31267/8 "2019-09-30T18:08:47Z")

</div>

So I’m trying to make use of this, and I’m looking for a bit of advice. When I’m boot strapping an AWX system, I need to use the cli for some tasks. Traditionally I’ve written out a tower\_cli config file that stores the credentials, so that I’m not adding the credentials to every task execution (and then marking them as no\_log to prevent credential leakage). It seems awx cli doesn’t support this and only works via the oauth2 methods. I can either specify the credentials on the command line for every task, or I can get a token and set the token in the ENV. I’m looking for some guidance on bootstrapping that token, via Ansible. I can certainly do a task to get the token output, and then carve up that output to get the actual token bits, but that seems like a bit of a mess. Is there a better way to simply get the token that I can then stash in a file for later reference, or stash in the env of an Ansible play?

Thanks!

---

<div class="post-metadata">

**Author:** ![rpetrell](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@rpetrell](https://forum.ansible.com/u/rpetrell)\
**Post date:** [September 30, 2019, 7:37pm UTC](https://forum.ansible.com/t/announcing-the-awx-cli/31267/9 "2019-09-30T19:37:16Z")

</div>

Hey Jesse,

The new CLI doesn’t pull credentials from a configuration file like tower-cli, but you _can_ use environment variables\*.\*

$ TOWER\_USERNAME=joe TOWER\_PASSWORD=secret awx login

while this works, it prints out a shell variable, e.g.,

export TOWER\_TOKEN=…

You _could_ parse this in Ansible but I agree that’s a little gross. Maybe we should change the default behavior here to better match expectations?

![]()

---

<div class="post-metadata">

**Author:** ![rpetrell](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@rpetrell](https://forum.ansible.com/u/rpetrell)\
**Post date:** [September 30, 2019, 7:39pm UTC](https://forum.ansible.com/t/announcing-the-awx-cli/31267/10 "2019-09-30T19:39:05Z")

</div>

Jesse,

Would this help? [https://github.com/ansible/awx/pull/4854](https://github.com/ansible/awx/pull/4854)

---

<div class="post-metadata">

**Author:** ![Uriel](https://avatars.discourse-cdn.com/v4/letter/u/53a042/32.png) [@Uriel](https://forum.ansible.com/u/Uriel)\
**Post date:** [September 30, 2019, 7:48pm UTC](https://forum.ansible.com/t/announcing-the-awx-cli/31267/11 "2019-09-30T19:48:04Z")

</div>

Could also try pulling the token directly from your AWX instance and store that in an env var /file for later. Maybe even after the play completes you could expire the token. Sample snippet:

`

- name: Create a personal access token with read/write scope  
uri:  
method: POST  
url: [https://awx.com/api/v2/users/1/personal\_tokens/](https://awx.com/api/v2/users/1/personal_tokens/)  
user: “{{ username }}”  
password: “{{ password }}”  
force\_basic\_auth: yes  
body\_format: json  
body: {“description”: “AWXKit Token”, “scope”: “{{ mode }}”}  
status\_code: 201  
register: post\_result  
no\_log: true

- name: Store token into variable ‘oauth2\_token’  
set\_fact:  
awx\_oauth2\_token: “{{ post\_result.json.token }}”  
no\_log: true  
`

---

<div class="post-metadata">

**Author:** ![Jesse\_Keating1](https://avatars.discourse-cdn.com/v4/letter/j/eb9ed0/32.png) [@Jesse\_Keating1](https://forum.ansible.com/u/Jesse_Keating1)\
**Post date:** [September 30, 2019, 8:35pm UTC](https://forum.ansible.com/t/announcing-the-awx-cli/31267/12 "2019-09-30T20:35:22Z")

</div>

I replied in the issue, but I believe that would be great!

---

<div class="post-metadata">

**Author:** ![rpetrell](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@rpetrell](https://forum.ansible.com/u/rpetrell)\
**Post date:** [October 1, 2019, 12:40am UTC](https://forum.ansible.com/t/announcing-the-awx-cli/31267/13 "2019-10-01T00:40:22Z")

</div>

Uriel,

For what it’s worth, this is basically what the awx login command does under the hood: [https://github.com/ansible/awx/blob/devel/awxkit/awxkit/api/pages/base.py#L175](https://github.com/ansible/awx/blob/devel/awxkit/awxkit/api/pages/base.py#L175)
