Repository navigation
feat: add kody api command mirroring MCP api tool - #19
Merged
Merged
Conversation
Thin Open API wrapper: operationId + flat --params JSON, with the same scoped-token auth as whoami/search/execute. Refuses bootstrap redeem so tokens are never printed; prefer auth bootstrap instead. Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Owner
|
bugbot run |
|
Skipping Bugbot: Unable to authenticate your request. Please make sure Bugbot is properly installed and configured for this repository. |
Owner
Author
|
bugbot run |
|
Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings. |
|
🎉 This PR is included in version 1.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Agents and scripts with CLI auth (
auth bootstrap/KODY_API_TOKEN) need a way to call any Open APIoperationIdwithout going through MCP. This adds a thin CLI twin of the MCPapitool.Usage
Same shape as MCP
api:operationId+ flatparamsobject (path/query/body fields together). Resolves method/path fromhttps://api.kody.codes/openapi.json. Always prints JSON.Auth
Uses existing
requireApiToken/resolveScopedApiToken:--token/KODY_API_TOKENkody auth bootstrap --codekody_at_…;kody loginOAuth is not accepted for general/v1ops)Safety
cliCredentialBootstrapRedeem— redeem returns a token; usekody auth bootstrap --codeinstead (stores, never prints).tokenCreate/tokenRotatestill work and may print a one-time token value (same as MCPapi); prefer env storage over pasting into chat.kody_at_/kody_bc_.Scope kept small
No
api list/ operation discovery CLI beyond a clear unknown-operationIderror pointing at/openapi.json.Version bump
Repo uses semantic-release (
0.0.0-semantically-released). Thisfeat:commit will publish a minor bump on merge tomain. No manualpackage.jsonversion edit.Verification
npm run validate(typecheck, tests, build) — green locallyauth bootstrap):kody api usageGet --params '{}'→{ "plan": "pro", ... }Relation to MCP
apiIdentical call shape (
operationId+ params). MCP invokes operations in-process; the CLI loads/openapi.jsonand issues the corresponding HTTPS request with a scoped Bearer token.