cd /news/ai-tools/cbash-rust-posix-hub-2fa-vault-and-s… · home › topics › ai-tools › article
[ARTICLE · art-179617] src=cbash.ai ↗ pub= topic=ai-tools verified=true sentiment=↑ positive

Cbash – Rust POSIX Hub, 2FA Vault, and Scoped SDK for AI CLIs and GPUs

A new MIT-licensed Rust command-line tool called cbash has been released, offering a single POSIX interface across 11 AI backends including Claude, Codex, Gemini, Grok and free open models, plus 9 GPU compute targets such as Slurm, Modal, Ray, Kubernetes and Hugging Face Jobs. cbash keeps personal, .edu, business and free accounts signed in side by side through isolated config directories with exit-12 failover, and stores keys locally in an encrypted vault using Argon2id and XChaCha20-Poly1305 with optional 2FA via OS Keychain or keyfile. The tool also adds scoped per-app SDK capability tokens and fail-closed SHA-256 plus SLSA provenance releases, targeting developers who juggle differing vendor flags and authentication states across AI CLIs.

key takeaway

cbash replaces per-vendor flags and auth state with one POSIX contract (-P, -m, -f ndjson, --permission readonly) across 11 AI backends and 9 compute targets, with isolated config dirs for parallel accounts and an Argon2id + XChaCha20-Poly1305 vault adding 0 ms overhead on normal runs.

by read6 min views31 publishedDec 1, 2026
Cbash – Rust POSIX Hub, 2FA Vault, and Scoped SDK for AI CLIs and GPUs
Image: source

100% OPEN SOURCE (MIT) / SUPER FAST / WRITTEN IN RUST

One CLI for every AI model, account, and GPU.

cbash puts one super fast, 100% open source Rust command in front of Claude, Codex, Gemini, Grok, free open models, and 9 GPU clusters. Tired of memorizing different flags and logging out to switch between personal, .edu, and work accounts? You are not alone.

Use the exact same -P, -m, -f ndjson, and --permission readonly flags across 11 AI backends.

02 / ZERO LOGOUTS

Keep personal, .edu, business, and free accounts signed in side by side with isolated config dirs and exit-12 failover.

03 / FREE MODELS + 9 GPUS

Built-in cbash free open models (Open Research, Hugging Face, OpenRouter, Ollama) plus cbash compute for Slurm, Modal, Ray, K8s, and HF Jobs.

04 / ENCRYPTED VAULT

Store keys locally in cbash vault with Argon2id + XChaCha20-Poly1305 and 0 ms overhead on normal runs. 100% open source (MIT).

01 / LIVE

Live Command Collapser

Pick any provider, isolated account tier, and task, or spin Flag Roulette to roll random terminal chaos. Watch vendor flags and environment variables collapse into one POSIX command backed by src/providers.rs and src/compute.rs.

Without cbash (vendor syntax + manual auth state)0 chars

With cbash (uniform POSIX contract)Copy command

Inspect --dry-run output

02 / DIAGNOSE

Multi-CLI Fatigue Symptom Checker

Check every workaround living in your dotfiles or shell history, dial in your account and cluster counts, and share your diagnosis on X.

You typed --output-format stream-json into codex exec and wondered why nothing streamed.+15You logged out of your personal Claude account to use your .edu credits, then forgot to switch back before work.+15Running grep on your ~/.zshrc reveals four OPENAI_API_KEY_* exports with numbers at the end.+15Your automation script scraped vendor stderr text for "rate limit" and broke when a CLI reworded one error line.+15You wanted a safe read-only audit, passed --sandbox read-only to gemini, and hit an unknown flag error.+10You stored a Hugging Face or OpenRouter key in plaintext inside a config file and had to rotate tokens on a Friday.+10You burned twenty minutes checking whether Modal takes --env, Slurm takes --gres, or HF Jobs takes --flavor.+10Your wrapper CLI boots an interpreted Node or Python runtime just to print --help before making one network call.+10

cbash compute run -C modal-dev --dry-run -- python train.py

tinker

Training

tinker run

TINKER_API_KEY, TINKER_BASE_URL

cbash compute run -C tinker-lab --dry-run -- python rl.py

hf-jobs

Serverless

hf jobs run

HF_TOKEN via secret_ref / secret_env

cbash compute run -C hf-a10g --dry-run -- python eval.py

open-research

Cluster

Open Research HTTP API

OPEN_RESEARCH_API_KEY, OPEN_RESEARCH_COMPUTE_URL

cbash compute run -C or-cluster --dry-run -- python run.py

kubernetes

Cluster

kubectl run

KUBECONFIG, --context, --namespace

cbash compute run -C k8s-gpu --dry-run -- python job.py

vercel-sandbox

Sandbox

vercel sandbox exec

VERCEL_TOKEN, VERCEL_ORG_ID, VERCEL_PROJECT_ID

cbash compute run -C vercel-dev --dry-run -- npm test

prime-intellect

Sandbox

prime pods exec

PRIME_API_KEY

cbash compute run -C prime-rl --dry-run -- python train.py

slurm

Cluster

srun / sbatch

--partition, --account, --gres gpu:<spec>

cbash compute run -C slurm-mit --dry-run -- python train.py

ray

Cluster

ray job submit

RAY_ADDRESS

cbash compute run -C ray-cluster --dry-run -- python worker.py

04 / SECURITY

Zero-Trust Security, 2FA Vault, and Semantic Exit Codes

Hardened for security-conscious developers: Argon2id + XChaCha20-Poly1305 with optional 2FA OS Keychain/keyfile wrapping, scoped per-app SDK capability tokens, fail-closed SHA-256 + SLSA provenance releases, and zero daemon.

2FA VAULT

Optional --hardware-key (OS Keychain) or --keyfile mixes a random 256-bit machine secret with Argon2id, blocking offline password cracking even if vault.json is stolen.

SCOPED SDK GRANTS

Issue per-app cbash_app_... tokens (SHA-256 hashed at rest) capping allowed profiles, --max-permission readonly, and daily turn limits. Work and GPU accounts stay hidden.

Never modifies ~/.claude*, ~/.codex, or ~/.gemini. Temporary credential reads wipe via Zeroizing. No background server and zero prompt logging.

Argon2id + XChaCha20-Poly1305 + Opt-In 2FA Vault

cbash vault encrypts API tokens inside vault.json beside config.toml. Normal commands never open the vault unless a profile sets vault:<KEY>.

KDF + 2FAArgon2id (v0x13, 64 MiB, t=3, p=4, bounded against DoS) + optional 256-bit OS Keychain or keyfile second factor + --generate-passphrase

AEAD cipherXChaCha20-Poly1305 with 256-bit key, fresh 128-bit OsRng salt, and fresh 192-bit random nonce rotated on every write

Tamper checkVersion, KDF params, cipher, 2FA mode, and salt are bound via AAD. Any 1-bit header, nonce, or ciphertext edit fails with exit 11.

Memory & I/Ozeroize::Zeroizing wipes keys and decrypted maps on drop. Atomic temp rename with 0600 Unix mode. No raw vault get CLI dump.

Normal-run tax0 ms KDF cost when executing subscription CLIs (~8 ms cold start).

cbash vault init --hardware-key --generate-passphrasecbash vault set HF_TOKEN --from-env HF_TOKEN cbash sdk grant my-agent --profiles claude --max-permission readonly --daily-limit 50 cbash sdk policy --strict-auth true

Semantic POSIX Exit Codes (Failover on 12)

Orchestrators and shell scripts branch deterministically on numeric exit status. When account quota runs out, exit 12 triggers clean failover to your next profile or free endpoint.

Code

Constant

Orchestrator Action

0

OK

Consume stdout

2

USAGE_ERROR

Fix flags or config; do not retry

10

PROVIDER_NOT_FOUND

Run cbash doctor or pick another provider

11

AUTH_ERROR

Re-auth profile or check vault passphrase

12

RATE_LIMITED

Fail over immediately to next -P profile

13

UNSUPPORTED

Flag rejected fail-closed by backend

14

CONTEXT_EXCEEDED

Compact input prompt and retry

15

PERMISSION_DENIED

Adjust --permission policy

16

TIMEOUT

Increase --timeout or retry

17

NETWORK_ERROR

Retry with backoff

130

INTERRUPTED

Propagate SIGINT cancellation

git diff | cbash run -P claude-work "Review diff" rc=$? if [ "$rc" -eq 12 ]; then git diff | cbash run -P free-openrouter "Review diff" fi

05 / SDK

Connect Your Agentic App to User Subscriptions

Stop asking users to paste API keys into your IDE extension, agent harness, or desktop app. Shell out to cbash sdk discover --json to detect every Claude, Codex, Gemini, Grok, GPU, and free endpoint already authenticated on their machine — with zero secrets exposed.

ZERO-DEPENDENCY APP INTEGRATION

5 Lines to Discover & Run Any Subscription

cbash sdk discover --json returns a stable cbash-sdk/v1 manifest containing masked account hints, capabilities, and ready-to-spawn invoke.argv arrays. Your app never touches vendor credentials or logs the user out.

TypeScriptPythonRustGoMCP / Agent

import { execFileSync, spawn } from "node:child_process";

const { subscriptions } = JSON.parse(
  execFileSync("cbash", ["sdk", "discover", "--json"], { encoding: "utf8" })
);

// Spawn any user subscription with streaming NDJSON + read-only guard
const [bin, ...args] = subscriptions[0].invoke.argv;
const child = spawn(bin, [...args, "--permission", "readonly", "Review diff"]);

Zero API keys stored in your appCLI: cbash sdk snippet ts|python|rust|go|mcp

Emails are masked by default (r***@gmail.com), raw tokens and vendor credential files are never returned, and per-app grants (cbash sdk grant <app> --profiles claude --max-permission readonly) keep your work and GPU accounts invisible to untrusted apps.

$ cbash sdk discover --jsonCopy

{
  "sdk_version": "cbash-sdk/v1",
  "subscriptions": [
    {
      "id": "claude",
      "provider": "claude",
      "tier": "personal",
      "plan": "max",
      "signed_in": true,
      "account_hint": "r***@gmail.com",
      "invoke": {
        "argv": ["cbash", "run", "-P", "claude", "-f", "ndjson"],
        "chat_argv": ["cbash", "chat", "-P", "claude"]
      }
    }
  ],
  "compute_services": [
    { "service": "modal", "category": "compute", "detail": "active" },
    { "service": "prime-intellect", "category": "compute" }
  ]
}

06 / OPEN SOURCE

100% Open Source Under MIT

Built in the open, compiled to a single stripped Rust binary, and verified by an executable POSIX conformance suite.

100% open sourceMIT LicenseRust 1.78+

Built in the open. Built for speed.

cbash is 100% open source under the MIT License with zero proprietary components and zero runtime lock-in. Test your own AI CLI wrapper against the spec using cbash conformance <binary>, or add a provider driver in src/providers.rs and compute adapter in src/compute.rs.

Install the SHA-256 verified release binary, auto-detect every local Claude, Codex, Gemini, and Grok folder without moving your existing configs, sign in across services, and self-update anytime.

── more in #ai-tools 4 stories · sorted by recency
── more on @cbash 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/cbash-rust-posix-hub…] indexed:0 read:6min 2026-12-01 · —