Skip to content
 
 

Repository files navigation

██╗   ██╗██████╗
╚██╗ ██╔╝╚════██╗
 ╚████╔╝  █████╔╝
  ╚██╔╝  ██╔═══╝
   ██║   ███████╗
   ╚═╝   ╚══════╝

Y2 INFORMATION DOMINANCE

Y2 Information Dominance is an agentic intelligence harness and CLI written in Zig. It is optimized for research, software operations, and embedding in larger systems.

It focuses on minimalism and performance across the board, from system prompt design to its tools, feature set, and 7.8 MiB binary.

For end users, its CLI output style and form factor aim to be closer to a Unix shell than a heavy "IDE in the terminal" TUI.

It's open source (Apache-2.0), model-agnostic, and suitable for both local and cloud inference.

Install

The release installer is published at https://y2.dev/harness/install.sh. Install the latest release with:

export PATH="$HOME/.y2/bin:$PATH" && curl -fsSL https://y2.dev/harness/install.sh | sh

The command makes y2 available in the current terminal. The installer also adds the same PATH entry to your detected shell profile for future terminals. Pass --no-modify-path to leave shell profiles unchanged.

The initial macOS CLI archives are checksum-verified but are not Developer ID signed or Apple-notarized. Signing and notarization are planned for a later Apple release.

For a reproducible install, set Y2_RELEASE_TAG to a tag from the published releases, then pass that exact tag:

export PATH="$HOME/.y2/bin:$PATH" && curl -fsSL https://y2.dev/harness/install.sh | sh -s -- "$Y2_RELEASE_TAG"

Or build from source:

git clone https://github.com/y2-intel/harness.git
cd harness
zig build -Doptimize=ReleaseSafe
./zig-out/bin/y2

Run the harness

Agent Y2 is the default route. Create a scoped key as described in the Y2 API authentication guide, then export it:

export Y2_API_KEY="your-y2-api-key"
y2

The default request target is https://api.y2.dev/api/v1/chat/completions with model y2-agent. The harness sends its repository instructions, transcript, and local function schemas through Agent Y2 client-harness mode. Y2 returns tool calls, while this binary keeps permission checks and tool execution on your machine. Requests without client tools retain Agent Y2's fixed Copilot behavior and server-side intelligence tools.

To call another OpenAI-compatible endpoint directly, configure its base URL, key, and model:

export OPENAI_BASE_URL="https://your-provider.example/v1"
export OPENAI_API_KEY="your-provider-api-key"
export Y2_MODEL="your-model-id"
y2

OPENAI_BASE_URL may include /chat/completions; otherwise y2 appends it. Y2_API_CHAT_URL overrides the full request URL and also enables direct OpenAI-compatible mode. Direct mode sends standard chat messages and function-tool definitions without routing through an intermediary gateway.

In direct mode, y2 models and /model query the endpoint's standard sibling /models route. If a provider does not expose that route, y2 can still run the configured Y2_MODEL, but catalog browsing is unavailable.

Or use an eligible ChatGPT subscription through OpenAI Codex OAuth:

y2 login codex
y2

Or use an eligible Grok subscription through xAI OAuth:

y2 login grok
y2

y2 login codex and y2 login grok select that provider and a model from its authenticated catalog. Inside y2, open /setup and choose Model provider to move between Y2 API, Codex, and Grok. /model lists the active provider's models. Subscription model IDs are the raw IDs returned by each authenticated catalog. Use /logout codex or /logout grok to remove that subscription session without affecting other providers; choosing it again from Model provider starts sign-in.

The OpenAI Codex route uses ChatGPT subscription access directly. The session is stored privately at ~/.y2/chatgpt-auth.json and refreshed when needed. On supported Codex models, /fast requests OpenAI's priority service tier and consumes ChatGPT credits at the higher Fast mode rate.

The Grok route uses subscription access directly at xAI. Its session is stored privately at ~/.y2/grok-auth.json, refreshed when needed, and used only with the authenticated xAI catalog and Responses API.

To create or manage a Y2 API key and store it in the supported local credential backend:

y2 auth

y2 auth opens the Y2 API Keys page, prints the URL as a fallback, and securely prompts for the key. y2 setup remains available as a direct key-entry alias.

When no credential resolves, y2 status and y2 doctor preserve any compatible explicitly selected source in their recovery guidance. Credential selection and fallback behavior are unchanged.

Run y2 from a project:

cd your_project
y2

The current directory becomes the primary workspace. Enter a prompt, or run /help to browse interactive commands. While y2 is working, press Enter to queue a follow-up or Ctrl+Enter to steer the active turn at its next model boundary. If the turn has already closed, y2 safely queues the steering prompt as the next turn.

The status line hides the workspace path and Git branch by default. Enable the Status line workspace option in /settings, run /statusline workspace, or set it in ~/.y2/settings.json:

{
  "statusLine": {
    "workspace": true
  }
}

List saved sessions with y2 sessions. Resume the latest session for the current workspace, or select an exact session ID, through the same command group:

y2 session resume last
y2 session resume <id>

Each interactive session names its terminal tab. The title prefers the session name, falls back to the workspace name, and keeps the active model as secondary context. Renaming or resuming a session updates the tab, and exiting clears the y2-owned title. Noninteractive commands do not emit terminal-title controls.

The /feedback command opens this fork's GitHub issue form. It does not create a diagnostic or change the clipboard.

Run /trace to create a private Markdown diagnostic with logs, session context, runtime state, permissions, and recent activity. On macOS, y2 copies the .md file to the clipboard; on other platforms, it saves the file and prints its path. Review and redact the trace before sharing it.

Use y2 ask for a single request:

y2 ask "explain the changes in this repository"

Repository instructions are discovered from applicable AGENTS.md files, with deeper files scoping the directories beneath them. The same local agent loop supports skills, subagents, file creation and editing, and command execution under the active permission policy.

Pass --system "your instructions" to replace the built-in base prompt for one request. Tool, skill, project, and runtime context still apply.

With --json, output contains accumulated assistant Markdown across the request, while final_output contains only a completed final assistant response and is "" for interrupted, failed, background, or otherwise absent final responses.

Foreground terminal commands run with an explicit finite deadline. y2 uses durable terminal sessions for services, watchers, GUI applications, and other long-lived work, and keeps captured foreground output available through an opaque bounded-read handle for the active session or --no-save process.

y2 starts in auto permission mode. Routine understood development actions run directly. Each unresolved action receives one narrow safety review based on the current user request and the exact pending action. A clear result authorizes only that action. A caution or unavailable review holds the action and returns advice to the agent without opening a permission prompt or ending the turn.

JSON and quiet requests stay noninteractive by default. Add --prompt-permissions to allow configured approval prompts when stdin is a TTY. Automatic safety review never opens that prompt. Prompt text is written to stderr, so JSON stdout stays parseable and quiet stdout stays empty. Piped or redirected stdin remains noninteractive and fails instead of waiting for approval.

Inside a saved session, /permissions remember <allow|deny> <tool-name> <arguments-json> stores an exact confirmed rule without running the action. /permissions lists stable rule IDs, and /permissions revoke <rule-id> removes a stored rule even when its original workspace or file state has changed.

The /model picker accepts /models as a compatibility alias. Both open the same model and reasoning-effort picker; y2 models remains available for text and JSON catalog output.

The native CLI's local usage ledger includes token and request counts reported by Agent Y2, direct OpenAI-compatible endpoints, and subscription providers, including separately streamed direct-endpoint usage totals. Missing or late totals and unreported pricing remain marked incomplete; spend includes only known costs.

Embed y2

y2 builds as a native binary or WebAssembly. Applications embedding y2 can provide network transport, session storage, configuration, permission handling, and terminal I/O.

Surface Use
y2 acp Connect the native agent to editors and other Agent Client Protocol clients.
createY2Agent() Embed the agent core in a JavaScript host with y2-core.wasm.
createY2Terminal() Embed the interactive terminal with y2-term.wasm.

The WebAssembly SDK is experimental. See the WebAssembly SDK.

Extend y2

Add reusable instructions with skills, connect external tools through MCP, or delegate independent work to subagents. Run y2 mcp add NAME COMMAND [ARGS...] for a local server or y2 mcp add --transport http NAME URL for Streamable HTTP without opening the interactive shell; the equivalent /mcp add forms remain available inside y2. A workspace may also provide Claude-compatible .mcp.json with a top-level mcpServers object. Pending project servers stay disconnected on every surface until they are approved with /mcp trust approve <server> or y2 mcp trust approve <server>. Interactive y2 presents the trust prompt after startup. y2 ask reports skipped pending servers on stderr, and ACP leaves them unavailable. Repository files cannot persist approval or expose environment-expanded values before approval. /mcp trust reject <server> rejects one and /mcp trust reset clears the workspace choices. Profile entries win same-name collisions. Profile ~/.y2/mcp.json accepts mcpServers as an alias for mcp, while writes always use mcp and ambiguous server-like keys produce a visible warning. Project instruction files may link within their scope, and read-only workspace or compatibility skill directories and their primary SKILL.md files may link within their owning workspace or home; managed skills, secondary resources, and escaping links remain no-follow. Skills installed via symlinks that resolve outside home or workspace (e.g. Nix store paths) are loaded when their resolved target is inside a directory listed in the Y2_SKILL_SYMLINK_AUTHORITIES environment variable (colon-separated absolute paths). y2 status and y2 doctor report invalid or suspicious trusted MCP profiles without starting their servers.

Use y2 mcp list, y2 mcp path, and y2 mcp remove NAME for noninteractive profile management. y2 mcp trust approve|reject NAME, y2 mcp trust approve-all, and y2 mcp trust reset manage workspace-scoped project trust. y2 mcp auth NAME and y2 mcp logout NAME run the existing remote credential lifecycle without opening the TUI or contacting a model endpoint.

MCP servers have a 30-second startup timeout by default; set startup_timeout_ms on a server when its cold start needs a different bound. For direct docker run stdio entries, y2 uses a private container ID file to remove the owned container after shutdown or startup failure. A configuration that already supplies --cidfile keeps ownership of its own cleanup policy.

Documentation

Read the Y2 API documentation for Agent Y2, authentication, and API contracts. Run y2 help or /help for the native CLI and interactive command reference.

Build from source

Building y2 requires Zig 0.16.0+:

git clone https://github.com/y2-intel/harness.git
cd harness
zig build -Doptimize=ReleaseSafe
./zig-out/bin/y2

Run the test suite with zig build test. See CONTRIBUTING.md for development and contribution guidelines.

License

Apache-2.0

Third-party licenses and attributions are listed in THIRD_PARTY_NOTICES.md.

Credits

Interface sounds by cuelume.

About

Y2 Information Dominance native agentic intelligence harness

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages