SwarmOps
ReferenceCommandsswarmops remote set

Page kind: Reference

swarmops remote set#

Describes stable at ae3c29c4, ; latest release v0.13.0what changedLast changed View as Markdown

Name, change or clear the forge a remote lives on, and its token's source.

--forge (github, forgejo or gitea) and --api, which come together, record the forge and the base address of its API: https, or http to a loopback address, with no user part, query or fragment, and at most 255 bytes. --no-forge forgets both, and the remote is a plain git remote again. --token-env names the variable that holds the remote's token, or --token-file the file, by an absolute path, in place of the source the remote names; --no-token forgets it. A token file serves the forge's API alone, so it needs a forge; the file is not opened here. Nothing else of the remote changes: its URL and its branch are changed by remote remove and remote add, which also drop the mirror's refs of it. A so:// remote takes no forge. No request is made. It needs no identity.

Metadata
Group
remotes
Since
0.14.0
Mutates
yes
Identity required
no
MCP tool
none
Envelope op
remote_set
Exit codes
0
Errors
none

Syntax#

Syntax
swarmops remote set [OPTIONS] <NAME>

Required arguments#

Syntax: <NAME>.

The remote's name.

Optional arguments#

The command also takes the global options.

Syntax: --forge <KIND>.

The forge the remote lives on: github, forgejo or gitea. Comes with --api. Values: github: GitHub; forgejo: Forgejo; gitea: Gitea.

Syntax: --api <ADDRESS>.

The base address of the forge's API: https, or http to a loopback address, with no user part, query or fragment. Comes with --forge.

Syntax: --no-forge.

Forget the remote's forge and API address.

Syntax: --token-env <VAR>.

The environment variable that holds the remote's token, by its name.

Syntax: --token-file <PATH>.

The file that holds the token of the forge's API, by an absolute path.

Syntax: --no-token.

Forget the remote's token variable or token file.

Examples#

No recorded example yet.

Return information#

result is a RemoteInfo (swarmops schema RemoteInfo prints its JSON Schema).

FieldTypeRequiredDescription
apistring or nullnoThe base address of the forge's API, as recorded; omitted when the remote names no forge.
branchstringyesThe remote branch main follows.
forgestring or nullnoThe forge the remote names, as written in remotes.toml: github, forgejo or gitea, or a word a later build wrote; omitted for a plain git remote.
lossyarray of LossyClassyesThe classes of content the import of this remote's commits may drop or normalize.
namestringyesThe remote's name.
token_envstring or nullnoThe environment variable that holds a token for the remote, by its name; omitted when the remote names none.
token_filestring or nullnoThe file that holds the token of the forge's API, by its path on the caller's host; omitted when the remote names none. The token itself is in no result.
urlstringyesThe remote's URL, as it was given.
warningsarray of string or nullnoWhat adding the remote has to say that did not stop it, such as default_branch_unknown (the remote named no default branch, so branch is main). Omitted when there is nothing.

Envelope op: remote_set.

Exit codes:

  • 0: Success.

Errors#

No golden step shows this command failing yet.

Any command that opens a store may also fail with a store error, such as E_NOT_A_REPO, E_IO or E_STORE_CORRUPT; a command line the grammar refuses is E_INVALID_ARG (exit 2).

See also#

On this page