oku

package module
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: AGPL-3.0 Imports: 2 Imported by: 0

README

Oku Agent (oku)

Swap and bridge across 30+ chains and trade perps on Oku, from your terminal or your AI agent.

  • Swap tokens across 30+ chains with quotes from multiple routes.
  • Bridge between supported EVM chains.
  • Trade perps on Hyperliquid with orders, positions and risk controls.
  • Work with agents using JSON output, offline docs, skills and MCP. Review every prepared action before submitting.

Status: Public alpha. Commands may change.

AI agents: start here. If a user gave you this repository so you can install or use oku (not develop it), stop. Read and follow Bootstrap in docs/agents.md before you run any install or login command. Login needs the user's interactive terminal.

Install

Pick one method. Upgrades, uninstall and more options are in all install methods.

Homebrew (macOS and Linux)
brew install oku-trade/tap/oku
npm
npm install -g @gfxlabs/oku-cli
Arch Linux (AUR)
yay -S oku-bin
Debian/Ubuntu
V=$(curl -fsSLo /dev/null -w '%{url_effective}' https://github.com/oku-trade/oku-cli/releases/latest); V=${V##*/v}
curl -fsSLO "https://github.com/oku-trade/oku-cli/releases/download/v$V/oku_${V}_linux_amd64.deb" # linux_arm64 on arm64
sudo apt install "./oku_${V}_linux_amd64.deb"
Fedora/RHEL
V=$(curl -fsSLo /dev/null -w '%{url_effective}' https://github.com/oku-trade/oku-cli/releases/latest); V=${V##*/v}
sudo dnf install "https://github.com/oku-trade/oku-cli/releases/download/v$V/oku-$V-1.x86_64.rpm" # aarch64 on arm64
Install script (macOS and Linux, no sudo)
curl -fsSLO https://raw.githubusercontent.com/oku-trade/oku-cli/master/scripts/install.sh
sh install.sh # installs to ~/.local/bin
Go
go install github.com/oku-trade/oku-cli/cmd/oku@latest
mise
mise use -g github:oku-trade/oku-cli
Nix
nix profile add github:oku-trade/oku-cli
From source
git clone https://github.com/oku-trade/oku-cli.git && cd oku-cli
make install # $HOME/.local/bin/oku

Quick start

oku auth login
oku account summary
oku wallet balances --chain 42161
oku orders prepare --market BTC --side buy --type market --size 0.0002
# Review the returned account, market, side, size and digest against your request.
oku orders submit --intent ID --digest SHA
oku orders status --intent ID

Once the companion Accounts fee-association change and authorization-page change are deployed, sign in to your existing Oku site account on the authorization page when running oku auth login. The page proves control of the embedded agent wallet under a separate Privy-based Oku Agent session, then associates that wallet with your site account for fee calculation only. Historical trading volume from both identities, including trades before association, contributes to the fee tier in both directions. The CLI session stays the standalone agent identity, not a login to your primary Oku account. It cannot access the primary account's sessions, settings, balances or order history. Agent-wallet funds and Hyperliquid agent approval remain separate. No accounts or order histories are merged, and there is no unlink flow. Existing CLI sessions remain standalone and do not need logout or re-login for fee association. The shared fee tier is applied server-side. This documentation does not imply a live rollout.

Use your own trusted RPC for wallet transactions: save it once with oku rpc set 42161 URL (or set OKU_RPC_URL_42161, which takes precedence). See usage for agent-wallet funds, JSON input and unknown outcomes.

Use with your AI agent

oku skills install --target claude # or codex, jcode, or --dir PATH
claude mcp add oku -- oku mcp serve

For Codex, add this to ~/.codex/config.toml:

[mcp_servers.oku]
command = "oku"
args = ["mcp", "serve"]

MCP is read-only by default. To expose mutation tools, start the server with oku mcp serve --allow-mutations. See agent setup for skills, permissions and other clients.

Docs

  • Install: methods, upgrades, uninstall and completions.
  • Agents: skills, MCP and authorization.
  • Usage: workflows, JSON, funds and recovery.
  • Commands: command and flag reference.
  • Security: credentials, signing and revocation.
  • Telemetry: optional usage telemetry.
  • Architecture: CLI design.

Read these offline with oku docs list and oku docs show <name>.

License

AGPL-3.0-only. See LICENSE.

Documentation

Overview

Package oku embeds the canonical documentation and agent skill assets that live at the repository root so installed binaries can serve them offline.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Docs

func Docs() fs.FS

Docs returns the bundled docs/ directory as a filesystem rooted at docs/.

func Skills

func Skills() fs.FS

Skills returns the bundled skills/ directory rooted at skills/, one subdirectory per skill containing SKILL.md.

Types

This section is empty.

Directories

Path Synopsis
cmd
oku command
Command oku is the Oku Agent: swap and bridge across 30+ chains and trade perps on Oku from the command line.
Command oku is the Oku Agent: swap and bridge across 30+ chains and trade perps on Oku from the command line.
pkg
api
Package api is the CLI's client for the Oku account API.
Package api is the CLI's client for the Oku account API.
auth
Package auth stores the CLI Privy credential.
Package auth stores the CLI Privy credential.
buildinfo
Package buildinfo holds release metadata injected with -ldflags -X.
Package buildinfo holds release metadata injected with -ldflags -X.
cli
Package cli implements the oku command tree.
Package cli implements the oku command tree.
config
Package config manages profiles stored under the XDG config directory.
Package config manages profiles stored under the XDG config directory.
decimal
Package decimal validates exact decimal strings.
Package decimal validates exact decimal strings.
docs
Package docs serves the documentation bundled in the binary so it is available offline.
Package docs serves the documentation bundled in the binary so it is available offline.
drafts
Package drafts turns malformed order-draft JSON (for example model output wrapped in code fences or using single quotes) into a strictly validated, reviewable candidate.
Package drafts turns malformed order-draft JSON (for example model output wrapped in code fences or using single quotes) into a strictly validated, reviewable candidate.
journal
Package journal persists intent lifecycle and signer-global nonces without secrets.
Package journal persists intent lifecycle and signer-global nonces without secrets.
lending
Package lending builds and checks Morpho Blue, MetaMorpho vault and Euler V2 lending calls, and holds the shared risk and loop math.
Package lending builds and checks Morpho Blue, MetaMorpho vault and Euler V2 lending calls, and holds the shared risk and loop math.
mcp
Package mcp exposes Oku over the Model Context Protocol (stdio) using the official Go SDK.
Package mcp exposes Oku over the Model Context Protocol (stdio) using the official Go SDK.
onchain
Package onchain executes verified, journaled EVM transaction templates.
Package onchain executes verified, journaled EVM transaction templates.
onchain/onchaintest
Package onchaintest provides test helpers for onchain batch fixtures.
Package onchaintest provides test helpers for onchain batch fixtures.
output
Package output implements the versioned JSON envelope and error taxonomy.
Package output implements the versioned JSON envelope and error taxonomy.
pnl
Package pnl computes average-cost positions and profit and loss from the swaps an agent made, in exact rational arithmetic.
Package pnl computes average-cost positions and profit and loss from the swaps an agent made, in exact rational arithmetic.
privy
Package privy implements Privy's OAuth device-grant wallet signing protocol.
Package privy implements Privy's OAuth device-grant wallet signing protocol.
signing
Package signing implements Hyperliquid L1 agent signing (sign_l1_action), ported from trade/src/app/features/perps/lib/hyperliquid{,Hash}.ts.
Package signing implements Hyperliquid L1 agent signing (sign_l1_action), ported from trade/src/app/features/perps/lib/hyperliquid{,Hash}.ts.
skills
Package skills bundles agent skill assets into the binary and installs them without silently overwriting user files.
Package skills bundles agent skill assets into the binary and installs them without silently overwriting user files.
telemetry
Package telemetry sends strictly opt-in, allowlisted usage events to PostHog.
Package telemetry sends strictly opt-in, allowlisted usage events to PostHog.
trading
Package trading defines order intents and validates server-built Hyperliquid actions against them before anything is signed.
Package trading defines order intents and validates server-built Hyperliquid actions against them before anything is signed.
uniswaplp
Package uniswaplp builds and verifies Uniswap v3 and v4 liquidity position actions for the agent wallet.
Package uniswaplp builds and verifies Uniswap v3 and v4 liquidity position actions for the agent wallet.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL