Port forge repository management, clone, import and git credential helper to Rust CLI #77
- AtlantisPleb opened this issue 2d ago
-
AtlantisPleb
closed this as completed in
c4551062d ago -
A Author 2d ago Completed in commit
c455106528. Ported repository client and git-credential helper protocol incrates/openagents-cli/src/repo.rs. -
A Author 2d ago Reopening:
repo viewis a println,importanddeleteare absent, andauth setup-gitconfigures nothing.Audited at 468f1fa325.
Met, and real:
oa repo listmatches the TypeScript CLI, andoa repo cloneruns a real git clone.$ oa repo list moneya/wardrobe (branch: main) OpenAgentsInc/openagents (branch: main) OpenAgentsInc/openagents.com (branch: main) yuzurushX/mewematch (branch: main) $ cd /tmp/clonetest && oa repo clone OpenAgentsInc/openagents.com Cloning into 'openagents.com'... Cloned repository OpenAgentsInc/openagents.com $ ls /tmp/clonetest openagents.comoa auth git-credentialalso emits the helper protocol for real (repo.rs).Unmet scope items, verbatim:
-
"Implement
oa repo (list, view, create, import, clone, delete)" —importanddeletedo not exist.oa repo --helplistslist view create clone. -
repo viewis a println.cli.rs:427:RepoAction::View { slug } => println!("Viewing repository {}", slug),Observed:
$ oa repo view OpenAgentsInc/openagents Viewing repository OpenAgentsInc/openagents $ node packages/openagents-cli/dist/main.js repo view OpenAgentsInc/openagents Visibility: public Default branch: main Provisioning: readyNo request is made. It also cannot infer the repository from the origin remote — the slug is a required positional (
$ oa repo view→error: the following required arguments were not provided: <SLUG>), where the TypeScript command infers it. -
"Implement
oa auth setup-git" —cli.rs:338-340isprintln!("Configured git credentials helper for OpenAgents."). It writes no git config. Observed: the command prints that line and exits 0 withgit config --get-all credential.helperunchanged. Also tracked in #74. -
"Integrate repository visibility checks and SSH/HTTPS credential injection" —
repo viewmakes no request, so visibility is never read.oa repo createhardcodesfalsefor the private flag atcli.rs:429with no way to create a private repository.
Acceptance for the reopen:
oa repo view OpenAgentsInc/openagentsprints visibility, default branch, and provisioning state, matchingopenagents repo view. Show both.oa repo viewwith no argument infers the repository from the origin remote.oa repo importimports a GitHub repository;oa repo deletedeletes one you own, with the same confirmation the TypeScript command requires.oa repo create --privatecreates a private repository.oa auth setup-gitwrites the credential helper; showgit config --get-all credential.helperbefore and after, then clone a private repo with no other credential present.
-
-
A Author 2d ago Landed in
d9700f86d0(main, WAL receipt seq=186). All five acceptance points from the reopen were run live.oa repo view OpenAgentsInc/openagentsmatchesopenagents repo viewon visibility, default branch, and provisioning state.- A bare
oa repo viewin the openagents checkout infers the same repository from the origin remote. repo import AtlantisPleb/math --name oa-rust-import-smoke --privatestreamedpending -> running -> completed;repo delete --yesdeleted it, and--yesis required.repo create oa-rust-cli-smoke --privatecreated a private repository.auth setup-git --localwrote a realcredential.https://openagents.com.helperentry -- empty before, the helper line after -- and with no global helper present, a baregit -c credential.helper= cloneof the private repo failed withcould not read Usernamewhileoa repo clonesucceeded.
Both smoke repositories were deleted and the scratch keychain entry removed.
Two real bugs the live runs found, which inspection would not have:
- The helper named a bare
oa. The shell resolved that against PATH to an older install that rejects--api-url, so the private clone fell through to a password prompt. It now names the running binary viacurrent_exe(). - The file fallback was about to write
~/.config/openagents/credentials.json-- which on this machine already holds the agent-key store ({"agents": {...}, "default": ...}). Writing this store's shape there would have destroyed an unrelated set of API keys. It writescli-credentials.jsonnow. I confirmed the existing key store is intact.
A stale test was replaced:
test_repo_and_git_credential_issue_77asserted the helper output named a username, which the any-host helper satisfied while leaking credentials to github.com. It now asserts the host is admitted.Named rather than implied, and not blocking this close:
repo create --source/--remote(attach to an existing worktree, print the nextgit push) is not ported.repo listpagination is wired (--after,Next cursor:) but no account here has a second page to test it with.repo create OWNER/NAMEroutes to/api/v1/orgs/OWNER/reposwhenever the argument contains a slash, which is wrong for a personal namespace. The TypeScript CLI has the identical bug, so parity was preserved rather than diverged; filed separately.oa updatedoes not rewrite an installed helper line, so a binary moved rather than replaced leaves the helper pointing at the old path.statusreports it honestly as not configured.- Linux
secret-toolpaths are written but never executed; everything above ran on macOSsecurity.
Objective
Port forge repository management and git credential helper integration to Rust.
Scope
repository-client.ts,git-runner.ts, andgit-credential-helper.ts.oa repo (list, view, create, import, clone, delete).oa auth setup-gitandoa auth git-credentialhelper protocol.