Accounts and command line: a forge and a server per account #204

Closed
opened 2026-11-11 06:50:50 +00:00 by james.maes · 0 comments
Owner

Part of #201.

Step 2 of the Gitea support epic. Stacked on step 1 (the engine's Gitea listers); not merged before 1.1.1 is tagged.

Scope

Accounts

  • An account names its forge (GitHub, the default, or Gitea) and, for Gitea, the server's address. Both are left out of accounts.json when they are the default, so files written before stay as they are and GitHub accounts written now read the same in an older gclo.
  • A version of gclo that does not know about forges must not take a Gitea account for a GitHub one and send its token to GitHub. The token of an account that is not on GitHub is therefore kept under a name an older version does not look up: to it, the account has no token.
  • One place builds the listers for a forge and a server, used by the command line and the app alike.
  • The default token saved in Settings is a GitHub token. A Gitea account holds its own.

Command line

  • --forge github|gitea and --server <address> on gclo sync, gclo repos, gclo orgs, and on gclo accounts add and edit; gclo accounts list shows both.
  • The token of a Gitea run is read from GITEA_TOKEN when no token option is given. GITHUB_TOKEN is never used for a Gitea server, and the other way round.
  • Exit codes are by the kind of failure, whatever the forge.
  • docs/CLI.md.

Not in this step

The desktop app's wizard and texts (step 3).

To confirm against a live server before this is merged

Gitea accepts the token as the git password with the fixed user name the git client uses.

Part of #201. Step 2 of the Gitea support epic. Stacked on step 1 (the engine's Gitea listers); not merged before 1.1.1 is tagged. ## Scope **Accounts** - An account names its forge (`GitHub`, the default, or `Gitea`) and, for Gitea, the server's address. Both are left out of `accounts.json` when they are the default, so files written before stay as they are and GitHub accounts written now read the same in an older gclo. - A version of gclo that does not know about forges must not take a Gitea account for a GitHub one and send its token to GitHub. The token of an account that is not on GitHub is therefore kept under a name an older version does not look up: to it, the account has no token. - One place builds the listers for a forge and a server, used by the command line and the app alike. - The default token saved in Settings is a GitHub token. A Gitea account holds its own. **Command line** - `--forge github|gitea` and `--server <address>` on `gclo sync`, `gclo repos`, `gclo orgs`, and on `gclo accounts add` and `edit`; `gclo accounts list` shows both. - The token of a Gitea run is read from `GITEA_TOKEN` when no token option is given. `GITHUB_TOKEN` is never used for a Gitea server, and the other way round. - Exit codes are by the kind of failure, whatever the forge. - `docs/CLI.md`. ## Not in this step The desktop app's wizard and texts (step 3). ## To confirm against a live server before this is merged Gitea accepts the token as the git password with the fixed user name the git client uses.
james.maes added the enhancement label 2026-11-11 06:50:50 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/gclo#204