CLI Tools for Bot or Not sessions management
Project description
bonadmin — Bot or Not CLI
A small command‑line tool to register bots/bot‑detectors for Bot or Not sessions, look up registration information for sessions, and fetch results.
Installation
pip install bonadmin
First‑time setup
- Create a starter config (one time):
bonadmin config init
# use --force to overwrite an existing file
This creates ~/.config/bon/config.yaml.
- Edit your configuration (fill in team name and password, change the session id):
# ~/.config/bon/config.yaml
api:
base_url: "http://54.145.53.252:3000"
auth:
team_name: ""
password: ""
team_token: ""
defaults:
session_id: 10
Important: If you don't set the team_name and password you won't be able to run any other commands except bonadmin set-team or the bonadmin config commands.
Notes
- Current default path is
~/.config/bon/config.yaml. If you need a different location set it up manually (change the default location in the code) and usebonadmin config setto populate values.- Run
bonadmin config pathto print the path your CLI is using.
Usage
Every command supports --help. For example:
bonadmin --help
bonadmin list-sessions --help
Commands
bonadmin team-info
Show the current team informations.
Example
bonadmin team-info
bonadmin add-bot <player_name> <player_update_email>
Add a bot player to the team. The player update email is the one used to receive informations related to the player.
Example
bonadmin add-bot BotPlayer player.email@gmail.com
bonadmin add-detector <player_name> <player_update_email>
Add a detector player to the team. The player update email is the one used to receive informations related to the player.
Example
bonadmin add-detector DetectorPlayer player.email@gmail.com
bonadmin list-sessions
Show all sessions past (for which the results are available) and upcoming that are open for registration.
Example
bonadmin list-sessions
bonadmin session-info <session_id>
Show your team registration information. If available the session is past shows the results for that session followed by the registration information of that session.
Example
bonadmin session-info 12
If session id not provided use the default one in the config file (
defaults.session_id).
bonadmin get-session-results <session_id>
Fetch and print in json format the results for a session.
Example
bonadmin get-session-results 12
If session id not provided use the default one in the config file (
defaults.session_id).
bonadmin register <player_name> <dockerhub_image> <dockerhub_tag> <session_id> --env <env_vars>
Register a bot or detector player for a session.
Example (macOS and linux)
bonadmin register bob_bot bob/image latest 12 --env '{"ressource": "token"}'
Example (Windows)
bonadmin register bob_bot bob/image latest 12 --env '{\"ressource\": \"token\"}'
Notes:
- The env_vars key need to start with
ENV_for the backend to accept them.- If session id not provided use the default one in the config file (
defaults.session_id) and if the environment variable are not provided it automatically returns an empty list.
bonadmin unregister <player_name> <session_id>
Unregister a bot/detector player from a session.
Example
bonadmin unregister bob_bot 12
If session id not provided use the default one in the config file (
defaults.session_id).
bonadmin set-team <team_name> <password>
Fetch and print in json format the results for a session.
Example
bonadmin set-team teamName 12345
If password not provided don't modify the password entry in the config file (
auth.password).
bonadmin config init
Create ~/.config/bon/config.yaml from a packaged template.
Options
--force, -f— overwrite if the file exists
Examples
bonadmin config init
bonadmin config init --force
bonadmin config path
Print the absolute path to the active config file.
Example
bonadmin config path
bonadmin config show
Pretty‑print the loaded config.
Example
bonadmin config show
bonadmin config set <dotted.key> <value>
Set and save a single value using dotted lookup; creates the file if missing.
Examples
bonadmin config set api.base_url http://localhost:3000
bonadmin config set defaults.session_id 10
Example
# List available sessions
bonadmin list-sessions
# Inspect one session
bonadmin session-info 10
# Register a bot for session 24
bonadmin register bob_bot bob/bot_image latest 24 --env '{\"ressource\": \"token\"}'
# Later, remove it
bonadmin unregister bob_bot 24
# Show config and path
bonadmin config path
bonadmin config show
Troubleshooting
-
Config not found/failed to read config
Runbonadmin config init, then open~/.config/bon/config.yamland fill in username and password. If you've changed thedefaults.session_idmake sure the id correspond to an existing session. -
HTTP or auth errors
Checkauth.*values. If the username and password are not set, enter your username and password. For other HTTP error an error message will be provided.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bonadmin-1.1.1.tar.gz.
File metadata
- Download URL: bonadmin-1.1.1.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
979bd4883abab38244b12f43b3dcb6d6503aa3d2424b23c3e973a4df336dabd8
|
|
| MD5 |
bf5be3985f119070fea67d8c16dabe2e
|
|
| BLAKE2b-256 |
f5237116371884053e5da8bc47c057708a0303408487f080ad8e3665c1850e0c
|
File details
Details for the file bonadmin-1.1.1-py3-none-any.whl.
File metadata
- Download URL: bonadmin-1.1.1-py3-none-any.whl
- Upload date:
- Size: 8.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5a70172844cab1a3722d06808f7e34b2e0e29d0cc4f24422996521f823b9661
|
|
| MD5 |
6bb3991c00316ad0ffe57548d480770e
|
|
| BLAKE2b-256 |
29d8d00071c97200a36bcfb5d4300081b2978377c42d5566a1e4cb62c67caa65
|