Skip to main content

Overview

Bot tokens are credentials designed for automated processes — CI/CD pipelines, containers, deploy scripts — that need to authenticate to FOKS without interactive login. A bot token encodes a user’s key in a compact, script-friendly string with no spaces or special characters.
The command group also has the alias bot-token, and foks bot use is a synonym for foks key use-bot-token.

bot new

Creates a new bot token for the currently logged-in user and prints it. The token is generated with the specified role and tied to the current user’s identity. Output — a token in the form name.key, for example:
The token has no spaces or special characters and is safe to use in shell scripts and environment variables.
Store bot tokens securely. Anyone with the token can authenticate as the user that created it, at the role specified.

bot use

Loads a bot token into the agent and sets it as the active key. The agent then operates as the user who created the token. The token is resolved in this order:
  1. --token flag
  2. FOKS_BOT_TOKEN environment variable
  3. Standard input (prompted if neither above is set)
Passing --token and FOKS_BOT_TOKEN simultaneously is an error.

Typical CI/CD workflow

Step 1 — On a developer machine, create the bot token:
Copy the printed token and store it as a secret in your CI/CD system (e.g., a GitHub Actions secret or Docker secret). Step 2 — In the container or CI job, load the token at startup:
Step 3 — Use FOKS normally for the rest of the job:
The bot token remains active for the lifetime of the agent process.

Roles for bots

Choose the minimum role needed for the bot’s task: See team roles for a full description of the member(n) sub-level system.