Skip to content

Install madbot-cli

madbot-cli is a client of the madbot API, the one the web interface uses too. It needs two things: the address of the API, and a personal access token that proves who you are. The token replaces your password: it is created in the interface, and can be revoked at any time.

  1. Install madbot-cli, in an environment of its own, so that it touches no Python package of your machine:

    Fenêtre de terminal
    uv tool install madbot-cli \
    --index https://gitlab.com/api/v4/projects/50871918/packages/pypi/simple

    madbot-cli is published on the package registry of the madbot project, hence the --index option: uv looks for madbot-cli there, and for its dependencies on PyPI. Check that the command is found:

    Fenêtre de terminal
    madbot-cli --help
  2. Create an access token in the madbot interface, on app.madbot.france-bioinformatique.fr:

    • open the menu with your name, then Account settings, then Tokens;
    • click Create a new token, name it, for example “madbot-cli”, and tick the * scope;
    • copy the token: it starts with pat_, and the interface shows it only once.
  3. Give the address and the token to madbot-cli, as two environment variables, in the terminal you will work in:

    Fenêtre de terminal
    export MADBOT_API=https://api.madbot.france-bioinformatique.fr
    export MADBOT_TOKEN=pat_…

    The address is the one of the API, not of the interface: api., not app.. madbot-cli has no default address, so it never writes to an instance you did not name.

  4. Check the address and the token:

    Fenêtre de terminal
    madbot-cli version
Optional What the command does, on the API side

madbot-cli version reads the version of the API, then the list of your workspaces to check the token. The same call, without madbot-cli:

Fenêtre de terminal
curl -H "Authorization: Bearer $MADBOT_TOKEN" "$MADBOT_API/api/workspaces"

Every command of the track does only that: HTTP requests to the API, with the token in the Authorization header. Your platform can make the same ones, in the language of its choice: the API reference describes them all.

  • uv: command not found: uv is not installed, or the terminal was opened before it was. Follow its installation guide, then open a new terminal. Without uv, pipx install madbot-cli --index-url <the same address> does the same.
  • madbot-cli: command not found after the installation: the tools folder of uv is not in your PATH. Run uv tool update-shell, then open a new terminal.
  • “Give the address of the madbot API in the MADBOT_API environment variable”: the variables only hold in the terminal where you defined them. Run both export lines again in the terminal you work in.
  • “madbot refused the token”: the token was copied wrong (it starts with pat_, with no space or quote), it was revoked, or it lacks the read and write scopes. Create another one, with the * scope.
  • “The answer is not JSON”: MADBOT_API points to the interface (app.) instead of the API (api.).
  • “MADBOT_API (or –api) ends with /api”: give the address alone, https://api.madbot.france-bioinformatique.fr; madbot-cli adds /api to each request.
  • On Windows, work in WSL: the commands of the track (export, JSON in single quotes) do not work as they are in PowerShell.