docs/openagents-cli/git.md

main at 58e6347eeb72 · 2 KB

Clone, push, and pull

OpenAgents serves Git smart HTTP at an HTTPS URL returned by the repository API and web interface. Standard Git performs clone, fetch, push, and pull.

Clone with the CLI

openagents repo clone OWNER/REPOSITORY

Choose a destination directory:

openagents repo clone OWNER/REPOSITORY ./local-directory

Run one clone without a global installation:

npx --yes @openagentsinc/cli@latest repo clone OWNER/REPOSITORY

The command uses the server-provided clone URL and invokes Git without putting the token in the URL or process arguments. For the clone operation, it scopes the OpenAgents credential helper to the selected API origin.

Clone with Git

Copy the HTTPS URL from the repository page, then run:

git clone https://openagents.com/OWNER/REPOSITORY.git

Public repositories support anonymous clone and fetch. Private repositories require an authorized credential.

Before you use standard Git with a private repository, install the CLI globally and configure the helper:

cd existing-worktree
openagents auth setup-git --local

Do not run auth setup-git through npx. The saved helper calls openagents, and the temporary executable is unavailable after npx exits.

Use global setup only when you want every local repository to use the helper for the selected OpenAgents origin:

openagents auth setup-git --global --yes

Push and pull

After you configure the helper, use standard Git commands:

git push -u origin main
git fetch origin
git pull --ff-only

Repository owners, maintainers, and contributors can push. Viewers can clone and fetch but cannot push. Token authorization is checked again for each Git request, so revoking or expiring a token takes effect without changing the remote URL.

Infer a repository from origin

From a worktree whose origin is an exact OpenAgents clone URL:

openagents repo view

The CLI accepts only /OWNER/REPOSITORY.git on the selected API origin. It does not infer authority from an arbitrary URL that resembles a repository path. Override inference explicitly when needed:

openagents repo view --repo OWNER/REPOSITORY
openagents repo clone -R OWNER/REPOSITORY

Authentication safety

The credential helper:

  • Returns credentials only for the exact selected OpenAgents origin.
  • Rejects username, port, path, or protocol mismatches.
  • Reads OPENAGENTS_TOKEN or the operating-system credential store.
  • Never writes a token into the Git remote URL.
  • Never logs complete credential-helper input.

OpenAgents uses HTTPS in this release. SSH remotes and SSH-key management are not available yet.

Next steps