Advanced Usage
Take your BotBox workflow to the next level with these advanced features and tips.
Customizing the Project Template
You can add your own files, folders, or Python modules to the generated project.
Just keep your cogs in src/cogs/ and update botbox.conf if you add or remove them manually.
Using Multiple Environments
- Set the
envfield for each cog inbotbox.conf(e.g.,development,production) - Only cogs matching the current environment will be loaded at runtime
Automating with Scripts
- Use the
run.shscript for consistent environment setup - Integrate BotBox commands into your own shell scripts or Makefiles
- Run any command headless so nothing waits on a prompt
sh
#!/bin/bash
set -e
export BOTBOX_TOKEN="$DISCORD_TOKEN"
botbox create --name MyBot --description "Scaffolded from a script" --author "$USER" --guild "$DISCORD_GUILD" --force
cd MyBot
botbox add Greeter --commands @../cogs/greeter.json
botbox config sync --headlessGenerating cogs from a JSON file is the useful part here. Keep your command definitions in version control and regenerate the cog files whenever they change. See Headless Mode.
Extending BotBox Itself
Want to add your own CLI commands or customize the TUI experience?
- Check out the
utilspackage in the BotBox source code. - See how Charmbracelet’s Bubble Tea and Huh are used for interactive, beautiful TUI forms and flows.
- All core UI/UX logic for forms, prompts, and navigation is handled in this package.
- New commands are implemented using Cobra.
More Advanced Tips
- Use Doppler for secret management in teams
- Use
botbox project upgradeto keep legacy projects up to date - Use
botbox config setandgetfor scripting config changes, with--rawongetso you can capture the value directly - Use
botbox config --format jsonto feed your project config intojqor another tool - Set
LOG_LEVEL=DEBUGwhile working on a cog and drop it back toINFObefore deploying