https://github.com/operable/cogctl
CLI admin interface for Cog
https://github.com/operable/cogctl
Last synced: 11 months ago
JSON representation
CLI admin interface for Cog
- Host: GitHub
- URL: https://github.com/operable/cogctl
- Owner: operable
- License: other
- Created: 2015-12-31T18:27:01.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2018-07-11T16:25:35.000Z (over 7 years ago)
- Last Synced: 2025-04-02T09:44:58.779Z (12 months ago)
- Language: Python
- Size: 598 KB
- Stars: 3
- Watchers: 3
- Forks: 4
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.MD
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
cogctl: Command-Line Administration Interface for Cog
#####################################################
[](https://travis-ci.org/operable/cogctl)
[](https://coveralls.io/github/operable/cogctl?branch=master)
`cogctl` is a CLI tool for administering a
[Cog](https://github.com/operable/cog) chat server installation.
# Installation
Binaries for musl-based (e.g. Alpine Linux) and libc-based
(e.g. Ubuntu) Linux distributions, as well as for MacOS are available
on the [latest Cog release
page](https://github.com/operable/cog/releases). If you would like to
build an executable for another platform, read on for how to set up a
local development and build environment.
Once you have a binary, you may run it from anywhere you like; it is
completely self-contained and stand-alone.
# Configuring
`cogctl` uses an INI-formatted configuration file, conventionally
named `.cogctl` in your home directory. This is where you can store
connection credentials to allow `cogctl` to interact with Cog's REST
API.
An example file might look like this:
```
[defaults]
profile = cog
[cog]
password = "seekrit#password"
url = https://cog.mycompany.com:4000
user = me
[preprod]
password = "anotherseekrit#password"
url = https://cog.preprod.mycompany.com:4000
user = me
```
Comments begin with a `#` character; if your password contains a `#`,
surround the entire password in quotes, as illustrated above.
You can store multiple "profiles" in this file, with a different name
for each (here, we have `cog` and `preprod`). Whichever one is noted
as the default (in the `defaults` section) will be used by
`cogctl`. However, you can pass the `--profile=$PROFILE` option to
`cogctl` to use a different set of credentials.
While you can add profiles to this file manually, you can also use the
`cogctl profile create` command to help.
# Getting Help
The `cogctl` executable contains a number of commands and
subcommands. Help is available for all of them by passing the `--help`
option. Start with `cogctl --help`, and go from there.
# Local Development
This is a Python 3 project. On MacOS, you can install this with
Homebrew:
```sh
brew install python3
pip3 install --upgrade pip
```
To set up an isolated development environment, use `virtualenv`. The
`virtualenvwrapper` software makes this easier to manage, and is
described below.
First we'll setup virtualenvwrapper.
```sh
pip3 install virtualenvwrapper
export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
```
Note: You will probably want to add those env vars and source the
virtualenvwrapper.sh in your shell rc file.
Finally we can set up our virtual env.
```sh
mkvirtualenv cogctl
workon cogctl
add2virtualenv .
make python-deps
```
The final `add2virtualenv` command ensures that the project is on your
`PYTHONPATH`. This allows you to run the `cucumber` acceptance tests
locally (although it runs based on the code directly, and not on the
`pyinstaller`-built binary).
To set up for Cucumber tests, do the following
```sh
make ruby-deps
bin/cucumber
```
To build a stand-alone binary for your current platform, run `make build`.