forge-research-snapshot
v0.1.1
Published
Forge CLI recovered from a public Claude Code snapshot and adapted into a runnable terminal coding assistant.
Readme
Forge
Forge is a locally recovered and reworked CLI fork built from a public source
snapshot of Anthropic's Claude Code. This repository is not an official
Anthropic project. In its current state, it is a runnable terminal coding
assistant with a working CLI, REPL startup, non-interactive --print mode, and
two authentication paths:
- existing first-party
claude.aistyle login, if present in local config - GPT/OpenAI login imported from official Codex CLI
The repository has moved beyond "snapshot analysis only". The main product path now boots and can execute real requests.
Current status
Verified locally:
bash scripts/run-forge-cli.sh --versionbash scripts/run-forge-cli.sh --helpbash scripts/run-forge-cli.sh auth statusbash scripts/run-forge-cli.sh --print "Reply with the single word OK." --disable-slash-commands --tools "" --max-turns 1bash scripts/run-forge-cli.sh auth login --openaiusing Codex CLI login reuse
The recovery audit also passes:
node scripts/recovery-audit.mjsWhat is solid now:
- self-contained npm launcher with Bun bundled as a dependency
- generated SDK/settings artifacts
- local launcher script
- basic interactive startup
- non-interactive request path
- Codex CLI based OpenAI login import
What is still partial:
- the native OpenAI path is not feature-complete for all tool/multi-turn cases
- if Codex only exposes a ChatGPT OAuth token without
api.responses.write, Forge falls back tocodex execfor simple no-tool text requests - some historical Anthropic-specific integrations remain in compatibility boundaries
Quick start
npm install
Published package name:
npm install -g forge-research-snapshotThen run:
forge --version
forge --helpThe npm package now installs Bun automatically through the official bun npm
package. You should not need to install Bun separately. If you want to override
the runtime, set BUN_BIN=/path/to/bun.
1. Install dependencies
bun install2. Generate derived files
bun run generate3. Start Forge
Canonical launcher:
bash scripts/run-forge-cli.shUseful checks:
bash scripts/run-forge-cli.sh --version
bash scripts/run-forge-cli.sh --help
bash scripts/run-forge-cli.sh auth statusNon-interactive smoke test:
bash scripts/run-forge-cli.sh --print "Reply with the single word OK." --disable-slash-commands --tools "" --max-turns 1You can also use package scripts:
bun run cli
bun run version
bun run recovery:audit
bun run preflight:openaiAuthentication
OpenAI / GPT via Codex CLI
This is the preferred OpenAI path.
- Sign in with official Codex CLI:
codex login
codex login status- Import that login into Forge:
bash scripts/run-forge-cli.sh auth login --openai- Verify:
bash scripts/run-forge-cli.sh auth statusIf the imported Codex credential includes a usable API key or Responses scope,
Forge can use the native OpenAI runtime directly. If not, Forge still imports
the login and can run simple no-tool text requests through a codex exec
fallback.
Detailed validation steps are in docs/openai-oauth-smoke-test.md.
Existing first-party login
If your local config already contains the legacy first-party login state, Forge will continue to read it through the compatibility layer. This repository still contains that path for local continuity, but it is no longer the only way to start the product.
Architecture summary
This codebase is still a large modular CLI monolith. The important top-level areas are:
src/entrypoints/cli.tsx: CLI entrypointsrc/main.tsx: startup orchestration and mode routingsrc/cli/print.ts: non-interactive/headless executionsrc/QueryEngine.ts: query loopsrc/services/api/claude.ts: model dispatchsrc/services/api/openai.ts: native OpenAI path plus Codex fallbacksrc/tools.ts: built-in tool registrysrc/commands.ts: command registry
High-level subsystem layout:
src/commands/: slash/CLI commandssrc/tools/: tool implementationssrc/components/andsrc/screens/: Ink UIsrc/services/: API, auth, MCP, analytics, sync, compactsrc/utils/: pathing, config, permissions, session storage, adapterssrc/bridge/: IDE/remote bridgesrc/skills/andsrc/plugins/: extensibility
Documentation map
Reality-based limitations
- This repository was reconstructed from a public source snapshot and then heavily adapted locally.
- Some module names, compatibility layers, and internal abstractions still reflect Claude/Anthropic heritage.
- OpenAI support is now real, but not all advanced paths are native OpenAI yet.
- A few features are best understood as "publicly runnable recovery build" rather than polished release product.
Recommended next work
- Expand OpenAI runtime coverage beyond simple no-tool requests.
- Reduce remaining Anthropic-specific compatibility naming in public surfaces.
- Tighten build metadata injection so
run-forge-cli.shis no longer the only supported launcher. - Add repeatable regression checks for REPL,
--print, auth, and tool basics.
