| name | nkmc |
| description | The gateway of internet for all agents — manage credentials, proxy CLI tools, and peer with other gateways |
| version | 0.5.0 |
| gateway | nkmc |
| roles | ["agent"] |
The gateway of internet for all agents. NaKaMiChi - the middle path, the right path.
nkmc lets AI agents securely discover and call APIs, proxy CLI tools with credential injection, and participate in a federated gateway network.
Install: npm install -g @nkmc/cli @nkmc/server
Quick Reference
nkmc gateway start
nkmc gateway start --tunnel
nkmc ls /
nkmc grep "weather" /
nkmc cat /api.github.com/skill.md
nkmc cat /api.github.com/repos/nkmc-ai/gateway
nkmc write /discord.com/channels/123/messages '{"content":"hello"}'
nkmc rm /api.cloudflare.com/zones/z1/dns_records/rec_1
nkmc run gh repo list
nkmc run stripe customers list --limit 10
nkmc run openai api chat.completions.create -m gpt-4 -p "hello"
nkmc keys set github.com --token ghp_xxx
nkmc keys set api.openai.com --token sk-xxx
nkmc keys list
nkmc keys remove github.com
nkmc gateway start
nkmc gateway start --tunnel
nkmc gateway start --daemon
nkmc gateway stop
nkmc gateway status
nkmc register --url http://localhost:3000
nkmc register --url http://localhost:3000 --spec-url http://localhost:3000/openapi.json
nkmc peers discover
nkmc peers discover --domain api.openai.com
nkmc peers add --id bob --name "Bob" --url https://xyz.tunnel.nkmc.ai --secret xxx
nkmc peers list
nkmc peers remove bob
nkmc rules set api.openai.com --allow --pricing free
nkmc rules set api.stripe.com --allow --pricing per-request --amount 0.01
nkmc rules set github.com --deny
nkmc rules list
nkmc rules remove api.openai.com
nkmc claim api.example.com
nkmc claim api.example.com --verify
Commands
nkmc auth
Authenticate with a gateway and save JWT token to ~/.nkmc/credentials.json.
nkmc auth
nkmc auth --gateway-url http://localhost:9090
Token is valid for 24h. All subsequent commands use the saved token automatically.
nkmc ls <path>
List services or directory contents.
nkmc ls /
nkmc ls /api.github.com/
nkmc cat <path>
Read data from a virtual path.
nkmc cat /api.github.com/skill.md
nkmc cat /api.github.com/repos/nkmc-ai/gateway
nkmc cat /rpc.ankr.com/blocks/21000000.json
nkmc grep <pattern> <path>
Search services or endpoints.
nkmc grep "weather" /
nkmc grep "alerts" /api.weather.gov/
nkmc write <path> <data>
Send data to a POST endpoint.
nkmc write /api.cloudflare.com/zones/z1/dns_records '{"type":"A","name":"app","content":"1.2.3.4"}'
nkmc rm <path>
Delete a resource.
nkmc rm /api.cloudflare.com/zones/z1/dns_records/rec_1abc
nkmc pipe <expression>
Pipe data between two paths.
nkmc pipe 'cat /api.weather.gov/alerts/active | write /discord.com/channels/123/messages'
nkmc run <tool> [args...]
Proxy a CLI tool through the gateway. The gateway looks up credentials for the tool, injects them as environment variables, executes the tool, and returns output.
nkmc run gh repo list
nkmc run stripe customers list --limit 5
nkmc run aws s3 ls
Built-in tools: gh (GitHub), stripe, openai, anthropic, aws.
nkmc keys set <domain>
Store an API key in the gateway vault (AES-GCM encrypted).
nkmc keys set github.com --token ghp_xxx
nkmc keys set api.openai.com --token sk-xxx
nkmc keys set api.stripe.com --token sk_test_xxx
nkmc keys list / remove
nkmc keys list
nkmc keys remove github.com
nkmc gateway start / stop / status
Run a local gateway instance.
nkmc gateway start
nkmc gateway start --port 8080
nkmc gateway start --tunnel
nkmc gateway start --daemon
nkmc gateway stop
nkmc gateway status
nkmc register
Register a service with the gateway.
nkmc register --url http://localhost:3000
nkmc register --url http://localhost:3000 --spec-url http://localhost:3000/docs/openapi.json
nkmc register --domain api.example.com --dir ./my-project
nkmc peers
Manage peer gateways for federation.
nkmc peers discover
nkmc peers discover --domain api.openai.com
nkmc peers add --id bob --name "Bob" --url https://xyz.tunnel.nkmc.ai --secret shared-key
nkmc peers list
nkmc peers remove bob
nkmc rules
Manage credential lending rules.
nkmc rules set api.openai.com --allow --pricing free
nkmc rules set api.stripe.com --allow --peers peer-bob --pricing per-request --amount 0.01
nkmc rules set github.com --deny
nkmc rules list
nkmc rules remove api.openai.com
nkmc claim <domain>
Claim domain ownership via DNS TXT verification.
nkmc claim api.example.com
nkmc claim api.example.com --verify
Environment Variables
| Variable | Description |
|---|
NKMC_GATEWAY_URL | Gateway URL (default: https://nkmc.ai) |
NKMC_TOKEN | Agent JWT token (prefer nkmc auth) |
NKMC_ADMIN_TOKEN | Admin token for gateway management |
NKMC_GATEWAY_NAME | Display name for tunnel discovery |
NKMC_HOME | Config directory (default: ~/.nkmc) |
Links