valnaa-code
v0.3.0
Published
Branded coding CLI for Cameroon — pay with MoMo, code with Claude
Readme
valnaa-code
A branded coding CLI for Cameroon — code with Claude, pay with Mobile Money.
Users install one command, log in with a token they got after paying via MoMo, and get the Claude Code experience. No card, no Anthropic account. You hold the real Anthropic credential on a gateway; users only ever hold a token.
valnaais a working name — rename freely.
How it works
valnaa (user's laptop)
│ Authorization: Bearer <user token>
▼
gateway ──[ real upstream credential ]──► Claude (Anthropic API, or your claude-max proxy)
│ validates token · checks subscription active · enforces fair-use cap · meters usageThe CLI is a thin wrapper around the Claude Agent SDK (the real harness
behind Claude Code). We don't rebuild the agent — we wrap it, brand it, and
point its API calls at the gateway by setting ANTHROPIC_BASE_URL +
ANTHROPIC_AUTH_TOKEN on the subprocess.
Install & use
Two ways, exactly like installing Claude Code:
# 1. one-liner — downloads a standalone binary, NO Node required (most users)
curl -fsSL https://get.valnaa.com/install.sh | bash
# 2. npm — for people who already have Node (developers)
npm install -g valnaa-codeThen:
valnaa login <token> # token from the user's MoMo subscription
valnaa # start coding
valnaa whoami # show login + gateway status
valnaa logoutWithout a token, valnaa falls back to this machine's local Claude auth so you
can try the agent loop before the gateway is live (dev mode).
Building the standalone binaries
The no-Node binary is built with bun build --compile, which embeds the
platform's Claude Code executable (the Agent SDK supports this directly):
bash scripts/build-binaries.sh # outputs dist/valnaa-<os>-<arch>Upload the results to a GitHub Release; install.sh detects OS/arch and pulls
the right one. Set VALNAA_REPO in install.sh to your repo.
Gateway
npm run gateway # listens on :8787Env:
| Var | Default | Meaning |
|---|---|---|
| PORT | 8787 | gateway port |
| VALNAA_UPSTREAM_URL | https://api.anthropic.com | where validated requests go (or your claude-max proxy) |
| VALNAA_UPSTREAM_KEY | — | the real credential the gateway holds (users never see it) |
| VALNAA_UPSTREAM_AUTH_STYLE | x-api-key | x-api-key for Anthropic, bearer for a proxy |
Tokens + subscriptions live in gateway/tokens.json (stub). The gate enforces:
401 no/bad token · 402 subscription not active · 429 over fair-use cap.
Status
Built & verified:
- CLI wraps the Agent SDK, runs the full agentic loop (real Claude answers; Write/Bash tools create & run files).
- Standalone binary (
dist/valnaa, 287MB) runs with no Node on PATH — the "install like Claude Code" path. Verified it routes a logged-in token through the gateway end-to-end. login/logout/whoamitoken flow.- Gateway token gate + subscription + fair-use-cap checks (401/402/429).
- Usage metering hook (sums
input_tokens+output_tokensper account). install.sh(OS/arch detection) +scripts/build-binaries.sh.
Not yet built (next):
- MoMo / Fapshi checkout → issues a token + sets subscription active.
- Real subscription store (replace
tokens.jsonstub with a DB). - Point the gateway at a real upstream (
VALNAA_UPSTREAM_KEY) to serve real users. - Build + publish binaries for the other platforms (linux-x64/arm64, darwin-arm64, windows-x64) and host on GitHub Releases.
