code.oscarkilo.com/okg

git clone https://code.oscarkilo.com/okg
.gitignore
README.md
auth.go
authz.go
chat.go
chat/
client.go
config.go
embed.go
exemplary.go
go.mod
go.sum
group.go
internal/
klee/
klex.go
main.go
okg_test.go
one.go
pr.go
repo.go
who/
9e495d4e igor //okg/who: SetAuthzMulti + SetAuthz wraps it
5d8118d5 igor okg: drop all env vars; thread *Config explicitly to handlers
84020207 igor okg: cfg gains Host (public) + CodeHost (klee); fixes //who 404s
08462a11 igor okg/chat: add SetPermissions
76d140db igor okg: add `okg exemplary` — few-shot batch runner
a1b60895 igor okg/who: add AppDataEntry + AppData field; document position
a34149f2 igor okg/who: add username helpers (mirrors //clients/who)
8e04243a igor okg: collapse main dispatch into a command map
bec500d1 igor okg: add `okg chat send` and `okg chat fetch`
31cd1822 igor okg: add `okg authz {list,set,delete}`
0556fcde igor okg: add `okg group delete`
6b990f7f igor okg: add `okg group members`
9b4c953f igor okg: add `okg group remove-member`
25b69d4f igor okg: add `okg group add-member` (variadic users)
05b47fee igor okg: add `okg group create` (auto-resolves owner from caller)
fb141023 igor okg: bootstrap //okg/who; add `okg group list`
95b1523d igor okg: extract //okg/internal/rest as shared HTTP helper
ac9ffc81 igor okg: add `okg one` — single LLM inference
2f5e75b1 igor okg auth login: --key flag + stdin; drop KLEX_API_KEY env; drop --user
4168cab2 igor okg: expand to Oscar Kilo Goodness; add embed; man-page-style help
98f1be1e igor Default okg to the production klee host
6c0aa1c5 igor Refactor okg CLI to use klee/ library package
e5db2074 igor Add klee/ library package for Klee API client
119bd420 igor Add okg repo create command
bb3bd924 igor Accept remote URLs with or without .git suffix
946f8dbe igor okg: gh-style CLI for klee git server

okg — Oscar Kilo Goodness

A command-line tool that bundles Oscar Kilo’s externally usable services into one binary. Today: git ops against klee, and LLM embeddings against klex. More LLM utilities (one, exemplary) coming as the legacy klex-git binaries fold in.

Designed for both humans and AI agents (Claude, OpenClaw) to use directly from the command line.

Position

okg is world-public. It runs anywhere — on developer laptops, in cloud workers, in agent sandboxes — and authenticates against OscarKilo services with a Klex API key saved to ~/.config/okg/config.json. The wire formats it sends and decodes are deliberately limited to fields that are safe to expose outside any data center.

If you’re writing an LLM agent, an automation script, or anything else that runs outside Oscar Kilo’s infrastructure, okg is the entry point.

Install

go install oscarkilo.com/okg@latest

Or build from source:

git clone https://code.oscarkilo.com/okg
cd okg && go build .

Setup

By default okg talks to the production klee host (https://code.oscarkilo.com); the only setup you need is your API key. okg auth login saves it to ~/.config/okg/config.json.

# Non-interactive (for agents and scripts).
okg auth login --key sk-...
cat ~/.klex.key | okg auth login        # equivalent, ps-safe

# Interactive (prompts for host then key).
okg auth login

Override the host for dev/local work with --host on auth login.

Commands

okg repo list

okg pr list    [--state open|closed]
okg pr create  --head BRANCH [--base master] --title TITLE [--body BODY]
okg pr view    NUMBER
okg pr diff    NUMBER
okg pr comment NUMBER --body BODY [--approve | --request-changes]
okg pr merge   NUMBER
okg pr close   NUMBER
okg pr reopen  NUMBER

okg auth login [--key KEY] [--host HOST]

okg group list          [--json]
okg group create        NAME [--full-name TEXT] [--owner USER]
okg group add-member    GROUP USER [USER ...]
okg group remove-member GROUP USER [USER ...]
okg group members       GROUP [--json]
okg group delete        NAME

okg authz list   [--json]
okg authz set    URI OWNER READER
okg authz delete URI

okg chat send  TO TEXT
okg chat fetch [--to GROUP] [--json]

okg embed      [--model NAME] [--dims N] [--full-path]
               (reads stdin → vectors on stdout)
okg one        [--model NAME] [--system-file FILE] \
               [--prompt-file FILE] [--attach FILE] \
               [--format text|json|jsonindent] [--fast-fail]
               (reads stdin as a JSON MessagesRequest)
okg exemplary  [--dir DIR] [--model NAME] [--dry-run] [--debug]
               (few-shot batch runner; walks <case>.<ext>
                files in DIR, writes responses to <case>.out)

With okg exemplary in place, the standalone klex-git binaries (one, embed, exemplary) are deprecated.

Flags

Repo Detection

Like gh, okg detects the repo from the current directory’s git remote:

git remote get-url origin
→ https://code.oscarkilo.com/widget.git
→ repo = "widget"

Dependencies