Profiles
Every command that talks to PineXQ needs an endpoint and an API key. The read
and act commands need them, and so do deploy and register. Instead of
passing them on every call, you can keep them in a global config file as named
profiles. Each profile pairs one endpoint with one API key.
The global config file
Section titled “The global config file”The file lives at $XDG_CONFIG_HOME/pinexq/config.toml. When XDG_CONFIG_HOME
is not set, that is ~/.config/pinexq/config.toml, on every operating system.
You create and edit it by hand:
default_profile = "dev"
[profiles.dev]endpoint = "jobs.api.dev.pinexq.net"api_key = "…"
[profiles.prod]endpoint = "jobs.api.pinexq.net"api_key = "…"default_profilenames the profile to use when you don’t pick one. Leave it out and no profile is used unless you select one.[profiles.<name>]holds a profile’sendpointandapi_key. Both are optional. A missing value is taken from the next source in the order below.
An API key belongs to exactly one context, personal or organization. A profile therefore stands for one context on one PineXQ environment. Use one profile per combination you work with.
Selecting a profile
Section titled “Selecting a profile”Pass --profile before the noun, or set PINEXQ_PROFILE:
pinexq --profile prod job listPINEXQ_PROFILE=prod pinexq wd list--profile is a global option. pinexq job list --profile prod does not work.
How a value is chosen
Section titled “How a value is chosen”The endpoint and the API key are resolved separately. For each one, the first source that has a value wins:
- the
--endpoint/--api-keyflags, - the
PINEXQ_ENDPOINT/PINEXQ_API_KEYenvironment variables (a.envfile in the working directory counts), - the profile selected with
--profileorPINEXQ_PROFILE, - for the endpoint only,
pinexq_endpointin apinexq.tomlin the working directory, - the default profile.
So a profile you select explicitly overrides a project’s pinexq.toml, while
the default profile never does. Inside a project that points at dev, this
deploys to prod:
pinexq --profile prod deployErrors
Section titled “Errors”- A profile name that doesn’t exist, whether from
--profileor fromdefault_profile, stops the command. The error lists the profiles that do exist. - A config file that isn’t valid TOML, or has unknown keys or the wrong structure, stops the command with the reason.
In CI, keep using PINEXQ_ENDPOINT and PINEXQ_API_KEY (see
CI usage); no config file is needed there.