-
Tod is primary used to work with existing projects in a AI agent environment. It is assumed to be a tool covering every aspects of API, especially for less used features. For project creation, I'd suggest to use API directly.
-
It is assumed to be a tool covering every aspects of API,
It is NOT assumed to be a tool covering every aspects of API...
-
So tod isn't meant to be an equivalent of GitHub's gh CLI? That diminishes its value a lot for my local agents. They work best when one CLI covers the whole forge, and "use the API directly" means leaving tod to find the server URL and token and call curl.
Would you take a
tod api <method> <path>passthrough, similar togh api? It would reuse tod's configured server and token, so the less used parts of the API stay reachable without a dedicated command for each. I can put up the PR. -
Yes, it is not a equivalent of gh. For AI agents, it is quite convenient to use API directly, with the json api help specifically created for AI agents:
-
Thanks, I didn't know about
/~api/help. I had tried/~help/api, which is the web page, so my agent ended up copying a request body from an existing project instead. I've pointed my agents at the JSON help for anything tod doesn't cover, so I'll close this. -
Previous Value Current Value Open
Closed
| Type |
Enhancement
|
| Priority |
Normal
|
| Assignee | |
| Labels |
No labels
|
I use tod (4.3.4) from coding agents against my OneDev 16.9.1 server. An agent needed to create a project for a new repository and found no command for it:
tod projecthaslist,current,getandget-query-description. It fell back to curl againstPOST /~api/projects, with a full request body copied fromGET /~api/projects/<id>of an existing project, since it could not find which fields the endpoint requires. That worked and returned the new id.From reading the code, the required fields are
name,gitPackConfigandcodeIndexingSetting(the e2e helper ine2e-test/tests/api.jssends{}for the last two), but nothing in tod points an agent there.I would like to add
tod project create <path>with--key,--descriptionand the feature toggles (code, issue, pack, wiki, time tracking), printing the same JSON astod project get. I see two ways to do it and would like to know which you prefer:/~api/tod/create-projecttoTodResource. It takes a path likeparent/child, goes throughProjectService.setup()the wayNewProjectPagedoes, and returnsProjectHelper.getDetail(). This is two PRs (server and tod), and the command only works on a server release that has the endpoint.POST /~api/projectsdirectly. This is one tod PR and works on current servers, but tod has to look up the parent id from its path, send the two empty settings objects, and make a second call to print the project detail. tod already callsDELETE /~api/job-runs/{id}when cancelling a build, so it would not be the only call outside/~api/tod.I lean towards A, since it creates projects the same way the web UI does (path based, missing parents created), but B works for me too. I am willing to put up the PR(s) for whichever you pick.
Before filing I searched OD and TOD issues and PRs for project creation from tod or the REST API and found no duplicate. The closest is OD-2831, which asked for endpoints and tod commands for branch association.