Human Language to Code

Turn natural language into reviewed, validated code patches in seconds. Write less. Ship safer.

npx human-to-code .
sort.human
Create a reusable TypeScript function that:
  - accepts an array of numbers
  - returns a new sorted array
  - never mutates the input
sort.ts
export function sortNumbers(
  items: number[],
): number[] {
  return [...items].sort((a, b) => a - b);
}

generated TypeScript from human intent

Languages & Frameworks

10 languages through the direct path today, grounded profiles for React, NestJS, FastAPI & Rust — the rest are on the roadmap

Quick start

Local & private by default — no code leaves your machine until you choose a remote provider and consent.

  1. 1

    Choose a provider

    human-to-code runs on any platform supported by Node.js 24+. Make sure Node.js is installed on your system before continuing; no global installation of human-to-code is required.

  2. 2

    Install Ollama & pull the model

    The default config targets your local Ollama on http://localhost:11434 with qwen2.5-coder:7b. human-to-code never pulls a model for you, so pull it once.

    Install Ollama for your platform, then run:

    ollama pull qwen2.5-coder:7b
  3. 3

    Create the config

    --init writes a complete, schema-versioned human-to-code.config.json and never overwrites an existing one. Treat it as a reviewable template.

    npx human-to-code --init .

    The generated file already targets local Ollama — no edits needed:

    {
      "schemaVersion": 1,
      "provider": {
        "name": "ollama",
        "model": "qwen2.5-coder:7b"
      },
      "privacy": { "remoteProviderConsent": false }
    }
  4. 4

    Write your first request

    Create a .human file, or drop an inline @human marker into an existing source file.

    # sort-list.human
    Create a function that returns a new sorted
    copy of a list, with a docstring.
    
  5. 5

    Generate

    Run the guided command. It analyzes the project, shows a receipt, and asks before writing — nothing is generated on --dry-run.

    npx human-to-code .

    For a reviewed, sandbox-validated patch against a recognized React, NestJS, FastAPI, or Rust project, use npx human-to-code guided . instead — it drafts a change contract for your review first.

Examples

Three ways to use it — pick the one that fits your workflow.

Write your request in a *.human file; the generated code lands in a sibling file named after it (extension follows your configured language).

# greet.human
Write a function that takes a name and returns
a friendly greeting, with a docstring.

$ npx human-to-code .
✓ wrote greet.py

Drop a marker inside an existing source file using its native block syntax — for example, /* @human … */ for a multiline TypeScript or JavaScript request and """ @human … """ in Python. The marker region is replaced in place with generated code.

// utils.ts
// @human debounce helper with cancel()

$ npx human-to-code .
✓ wrote utils.ts

For reviewed, sandbox-validated patches against a recognized React, NestJS, FastAPI, or Rust project, use guided: it drafts a change contract for your review before anything is generated.

$ npx human-to-code guided .
Wrote add-health-route.strict.human.json
Review the contract, then rerun to generate
a validated, reviewable patch. Apply is a
separate, explicit step.

Every generation shows a receipt — files, provider, model — and asks before writing. Nothing is written on --dry-run.

Docs

The essentials — the full README covers everything.

Quick start

# default: discover .human files and @human
# markers, show a receipt, write code
npx human-to-code .

# create a reviewable config (never overwrites)
npx human-to-code --init .

# reviewed contract → validated patch
npx human-to-code guided .

Requires Node.js 24+. The default provider is loopback-local Ollama with qwen2.5-coder:7b — no code leaves your machine until you configure a remote provider and consent.

Providers

OpenAI and Ollama (local, Cloud, or a trusted custom endpoint) are the supported providers. Credentials are environment-only — the config stores a variable name like OPENAI_API_KEY, never a key. Remote generation requires explicit consent and reviewed pricing bounds.

Commands

  • human-to-code . — direct .human/@human generation with receipt
  • guided — analyze → contract → grounded patch → sandbox validation
  • analyze — static multi-workspace project profile
  • plan / generate / validate — the pipeline, step by step
  • apply / rollback — explicit, hash-checked, reversible
  • check — verify every .human has a current contract

Safety model

The guided pipeline scans for secrets before any provider call, validates in a no-network container sandbox, and only an explicit apply of a VERIFIED run touches your working tree. Read SECURITY.md and ARCHITECTURE.md.