Separate Dosya CLI profiles

Isolate Dosya CLI credentials with separate XDG config roots or environment keys, then verify each account and target workspace before every job.

Last reviewed

The CLI has no named-profile store and no --profile flag. Isolate identities with different XDG_CONFIG_HOME directories, or inject different DOSYA_API_KEY values for each process.

Four workflow panels show creating private XDG roots, logging in without an unsupported profile flag, checking whoami, and pinning the workspace.
The diagram covers creating private XDG roots, logging in without an unsupported profile flag, checking whoami, and pinning the workspace. Open full-size screenshot.

Before you start

  • The normal XDG file is $XDG_CONFIG_HOME/dosya/config.json; without XDG configuration, the fallback is ~/.dosya/config.json.
  • Key precedence is command-line --key, then DOSYA_API_KEY, then config. Base URL environment configuration precedes the saved value and built-in default.
  • The CLI creates its config directory with mode 0700 and file with 0600; loose existing modes produce a warning.

Steps

  1. Create one private config root per identity, for example ~/.config/dosya-work and ~/.config/dosya-personal, and restrict each parent to the account owner.
  2. Set XDG_CONFIG_HOME for the desired identity, then save its key through stdin rather than a literal argument. Never invent --profile; argument parsing does not support it.
  3. Run XDG_CONFIG_HOME=… dosya whoami --json and assert the expected account identifier before any mutation.
  4. Pass the intended workspace explicitly to commands that accept it, or verify the current workspace returned by the relevant read command. Config isolation does not choose a workspace for you.
  5. For ephemeral jobs, prefer DOSYA_API_KEY from the scheduler’s secret store and an isolated empty XDG root. Remember that --key overrides both.
  6. Log the nonsecret profile label, config root, verified account ID, and workspace ID. Refuse to run if any value differs from the job definition.
Dosya CLI overview with installation and command references for separate dosya cli profiles.
The CLI overview supplies the installation and command references used by “Separate Dosya CLI profiles”. Open full-size screenshot.

Expected result

Each process resolves one intended key from a private config root or environment, verifies its account, and acts only in the explicitly checked workspace. No unsupported profile flag is required.

Troubleshooting

The wrong account appears. Check for a higher-precedence --key or DOSYA_API_KEY before editing the config file.

The CLI warns about permissions. Restore 0700 on the directory and 0600 on config.json, then verify ownership.

Two jobs still interfere. Give them different XDG_CONFIG_HOME values and avoid exporting one shared key in the parent shell.

Was this helpful?

Loading helpfulness results…

Voting saves a necessary ballot cookie for up to 180 days so you can change your answer.

Questions and replies

Ask about the steps in this guide. Questions are reviewed before publication.

Keep account details, credentials and private files out of public questions. Use private support for those.

Loading questions…

    Sign in to your Dosya account to ask a question.

    Check the outcome before you retry

    Use these shared checks when a task needs a second look.